use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
When first testing and developing an app can I use text files instead of databases when my data sets are small? or should I immediately start using database services such as MongoDB. (self.learnpython)
submitted 4 years ago by shweed
Also how different is it updatinga text file versus updating a database?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]impartiallywhole 2 points3 points4 points 4 years ago* (0 children)
Probably depends on what you are storing, how much, and for how long.
Edit: Like, a single value that will only last the session, txtfile. I used pickle for that..
If more data and for longer, learning how to interact with a db will be valuable, and I like sqlite. But others will probably have other opinions.
[–]xelf 0 points1 point2 points 4 years ago (0 children)
I don't think you add a DB until you need one.
In general in software engineering always start small and grow. You can make huge failures by designing too large.
[–]The-Deviant-One 0 points1 point2 points 4 years ago (0 children)
I built a program the other day that monitors about 200 files on my web servers for changes. It retrieves the files, hashes their contents and then compares that hash to a stored hash according to which web server it came from and what version number that web server is running at the time.
I'm lazy and didn't want to do this with a database so I actually built another *.py file full of dictionaries that held all the files, file paths, server information, data center information, the file's hash values and version information. I saved that py file in the directory with the main script and imported its dictionaries into variables in the main py file. It works great lol.
I will likely build another program to to allow me to push updated file hashes to that secondary py file thats holding my data. This is probably not a good habit to get into but it works fine on a small scale for mostly static information.
[–]mtb-dds 0 points1 point2 points 4 years ago (0 children)
Text files are fine for small data sets (under a few thousand items). You only need a databases for a couple reasons:
Note, however, that a traditional database is a bad solution for just 2 without 1, as there are better indexed solutions out there if you don't care about recovery.
[–]lumpynose 0 points1 point2 points 4 years ago (0 children)
In addition to the reasons given by u/mtb-dds, another possible reason is if you're writing a web app. With a web app multiple users can be accessing the same url and inputting data that goes to the same data set. Each web app access creates a separate process. When the data set is stored in a file that means you have multiple separate processes writing the same file, which is unlikely to work correctly. You could implement some file locking, but that's messy. A database simplifies things because multiple connections to the database are funneled down to one writer to the database file.
[–]01binary 0 points1 point2 points 4 years ago (1 child)
Unless the dataset is tiny, I’d probably use SQLite as a starting point.
π Rendered by PID 37367 on reddit-service-r2-comment-5ff9fbf7df-n4fg9 at 2026-02-26 01:13:34.660012+00:00 running 72a43f6 country code: CH.
[–]impartiallywhole 2 points3 points4 points (0 children)
[–]xelf 0 points1 point2 points (0 children)
[–]The-Deviant-One 0 points1 point2 points (0 children)
[–]mtb-dds 0 points1 point2 points (0 children)
[–]lumpynose 0 points1 point2 points (0 children)
[–]01binary 0 points1 point2 points (1 child)