4 ms·
If you have to handle (write code for) 2 and 3, why isn’t something like Postgres better?
by harikb 7y ago
If you have to handle (write code for) 2 and 3, why isn’t something like Postgres better?
- cheez 7y agoIt's a good question. For me, lack of yet-another-service.
- bob1029 7y agoThis is my primary answer as well. I have no problem with Postgres as a solution, but I will only invite additional complexity into my life when absolutely required by the business constraints. SQLite is dead simple compared to Postgres (or any other hosted solution). I can copy a SQLite .db file from a production machine to my local box and be reviewing rows/running queries within seconds. Also, sharing SQLite databases with other users & developers or even using them as a contract between systems is a very compelling set of use cases. Finally, going from a blank windows machine to a working development (or production) environment is very quick if your application exclusively uses SQLite to store its data. You simply stop thinking about databases after a while because everything just works.
- jbverschoor 7y agoFor me, the single file is the nr 1 reason. It sluist works, the file is the data.. very clear.
- ebg13 7y agoI can answer this. Adding a queue thread to your executable is infinitely easier to redistribute and run than something that requires the user to install a persistent postgres daemon. There are premade libraries for several languages that provide thread safe query queueing for sqlite transparently as drop in imports so you don't even really need to think about it. See e.g. https://github.com/dashawn888/sqlite3worker https://github.com/dashawn888/sqlite3worker (not mine)
- barrkel 7y agoSomething like Firebird Embedded would be better than Sqlite if you have concurrency and performance requirements alongside an embedded packaging constraint. Sqlite is more like a structured persistent file format with a SQL interface than a database.
- mceachen 7y agoI'd love to use Postgres with PhotoStructure, but it would triple the installation size (!!), make my code more complicated (I'd basically need to automate common dba work), and Windows support is shaky (last time I checked, at least). I picked SQLite to reduce moving parts.