Premature optimization is evil, but preemptive optimization is necessary unless you want to paint yourself into a corner. I realized this after implementing a bitcoin full node. In my bitcoin implementation, as an experiment, I tried storing the blockchain in sqlite, postgres, and leveldb. I gathered up a bunch of data from the first ~200k blocks of the blockchain and benchmarked all three databases. I queried for so…
We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
61–70 of 149 posts
Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#62Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#63Earlier quoted context omitted.
What operations were you doing in your benchmark? What was SQLite actually doing (CPU?, disk I/O?) while taking 30 seconds to finish? This would be a lot more useful and less FUDdy with more detail.
I'll clarify here: these weren't very scientific benchmarks, as I alluded to. So, don't take my word for it. I didn't measure ops per second, I didn't take into account system load or cpu usage, etc. This is all anecdotal evidence. I'm not saying this an announcement that "you shouldn't use sqlite". I measured the time of one query. It was a benchmark I ran just to personally give me a general idea of what I was up a…
Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#64I don't get the point of this article. SQLite is fine, especially in an embedded database, but once you have concurrent access, it starts to suffer because it has very coarse grained locks, so a "real" database is better for a distributed single-DB design. It's more about using the right tool for the job, and the author seems to be talking himself out of some kind of guilt for SQLite being the right tool for him.
Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#65As the developers behind the project, I'd have to think the authors are in the best position to make the determination about which tool is appropriate.
Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#66Earlier quoted context omitted.
Consider multi-user wordpress site for example. You can have one SQLite DB per user - there is simply no information to share between users. If so you can split all your users between multiple backend machines and do per user request routing - like one machine serving users from A to F. SQLlite has cheap DB loading sequence so you can open/close it for each page request. That would be perfect horizontal scaling as al…
well, you kinda just move the problem to another layer. You'll face same horizontal scaling issues once you need to scale on each user.
Of course, all this depends on amount of data you need to store for each user and informational structure of the app.
Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#67Earlier quoted context omitted.
What are the limitations? I love SQLite, and have vaguely heard that it has issues with concurrency, but what , exactly? I use it on production for www.tithess.gr and it seems to be working beautifully, no concurrency problems whatsoever there. What problems should I be expecting in a multi-access scenario? I've never had that question answered adequately.
It only supports a subset of ALTER TABLE and the work around for the limitations is very annoying: https://www.sqlite.org/lang_altertable.html
Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#68Earlier quoted context omitted.
What are the limitations? I love SQLite, and have vaguely heard that it has issues with concurrency, but what , exactly? I use it on production for www.tithess.gr and it seems to be working beautifully, no concurrency problems whatsoever there. What problems should I be expecting in a multi-access scenario? I've never had that question answered adequately.
You cannot have multiple writers to a SQLite database. Only a single file descriptor may be open with 'write' access. As long as you can get the performance you need out of a single writer, then you're good!
Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#69Single user, embedded-database situations is what DBMS like SQLite is designed for. And this guy thinks he deserves a pat on the back for using a tool in the way it was designed to be used?
This was a useful and informative post. Where on earth do you think the author is asking for a 'pat on the back' in this?
I'm glad the author of beet uses Sqlite, but to use a client/server database system would be ludicrous!
It's not that I am trying to hate on the guy, he had good intentions and wanted other people to listen up.
At the end of the day, though, dudes just another dev who made a reasonable decision. Bfd.
Re: We’re pretty happy with SQLite and not urgently interested in a fancier DBMS
#70Earlier quoted context omitted.
What are the limitations? I love SQLite, and have vaguely heard that it has issues with concurrency, but what , exactly? I use it on production for www.tithess.gr and it seems to be working beautifully, no concurrency problems whatsoever there. What problems should I be expecting in a multi-access scenario? I've never had that question answered adequately.
You cannot have multiple writers to a SQLite database. Only a single file descriptor may be open with 'write' access. As long as you can get the performance you need out of a single writer, then you're good!