3 ms·
Storing stuff in a json file sounds horrible to me. Why would you want that?
by dncornholio 5y ago
Storing stuff in a json file sounds horrible to me. Why would you want that?
- Spivak 5y agoBecause your data is teeny tiny, not performance critical, and `json.load` and `json.dump` is easy and usually less brittle then you're language's marshalling library.
- dncornholio 5y agoWhy save 10 minutes on setting up a proper database? Data is never teeny tiny, data is never not performance critical :) These decisions only bite you in the ass.
- lghh 5y agoSetting up a database takes way longer than 10 minutes. Data can be teeny tiny. Data can not be performance critical. You literally know nothing about the commenter’s application.
- hmottestad 5y agoAll my side projects have teeny tiny amounts of data. JSON file in the order of KB. Performance is great. I have one project with a dozen users that handles around 50 reads per second and maybe 30 writes per day, no issues at all. Setting up a DB for that would just bite the next dev in the behind since it would need a lot more maintenance then an apache server with php.
- paul_f 5y agoPHP supports complex data structures using associative arrays which map to the application requirements. Which can be easily saved in JSON. A SQL database with rows and fields does not always work well with these data structures. Often, as long as the data size is manageable, a json saved in a mediumtext field in MySQL works just fine.