6 ms·
Why do so many websites urge readers to avoid using sqlite as a production database? From what it looks like sqlite can handle a million daily users
by orangepurple 4y ago
Why do so many websites urge readers to avoid using sqlite as a production database? From what it looks like sqlite can handle a million daily users
- quaffapint 4y agoA couple of things come to mind. Scaling, specifically horizontally (though there are some solutions for that) and being write heavy like storing analytics. For many cases though it should work just fine for your average read heavy site.
- jerryjerryjerry 4y agoIMHO, going production also requires scalability, high availability, and tooling ecosystem (backup/restore/replication), etc, besides functionalities and performance.
- otoolep 4y agoAgreed. In the real world actually operating the database is just as important as its intrinsic query functionality.
- jerryjerryjerry 4y agoYes, that's also why certified Oracle DBAs can earn $$$ for their expertise on this.
- stonemetal12 4y agoI would add SQLite is missing access control, it is a big all or nothing. Usually it doesn't matter as much since the scope is so much smaller, but if you really want to back a major website with it some defense in depth would be nice.
- jerryjerryjerry 4y agoGood point! Security and regulation are other key requirements in real world for many industries.
- bob1029 4y agoWe've been using SQLite in production (B2B setting) for almost a decade. Concurrent, multi-user systems too. Sometimes thousands of concurrent users will be hitting the same databases all at the same time. Literally not once have we had an incident related to SQLite/IO corruption or performance. SQLite could handle a billion daily users with just one decent NVMe drive. You don't even have to do anything crazy to make this work. Just pick one of the top 10 techempower web frontends, tack on SQLite and set journal mode to WAL. Oh - try to use the same connection throughout as well. That one trips up a lot of developers used to the hosted SQL patterns. Oh but what about high availability? DQLite, RQLite, et. al. are now ready to take you to the next level. You can also address this in your application logic instead of deferring to your RDBMS vendor (this is our path).
- otoolep 4y agorqlite author here, happy to answer any questions.
- ufmace 4y agoSeems to me, it can work great if your use-cases match its strengths well. But if they ever don't, then it'll be a big mess with probably no solution but to fully switch over to a conventional RDBMS.
- wruza 4y agoWhen I search for “sqlite sucks at” it gives some claims opposite to what commenters here say, mostly from 2000-2010. For which use cases is it not strong enough? In practice, not in theory or based on initial fopen() purpose.
- ufmace 4y agoTheir own page here lists out the things it's not good for at the end: https://www.sqlite.org/whentouse.html https://www.sqlite.org/whentouse.html
- wenc 4y agoThis SQLite page actually tells you when it’s appropriate or inappropriate to use SQLite for a website. https://www.sqlite.org/whentouse.html https://www.sqlite.org/whentouse.html SQLite supports high read concurrency but has to queue concurrent writers. If your writes are small and concurrency low, you may be able to get away with it but ymmv.