dev.to
Everyone Is Wrong About SQLite - DEV Community
Excerpt
### 1. Read-Heavy Workloads If your app is 95% reads (like most SaaS apps), SQLite will embarrass your Postgres setup. No network roundtrips. No connection overhead. Just direct disk reads with an intelligent page cache. I've seen query times drop from 50ms to 0.5ms just by switching from Postgres to SQLite. … ### ❌ High Write Concurrency (But It's Not That Simple) SQLite uses a single writer model. One write at a time. But here's what the haters don't tell you: since Write-Ahead Logging (WAL) mode was introduced, SQLite can handle concurrent readers WHILE writing. No more blocking reads during writes. In WAL mode: - Writers don't block readers - Readers don't block writers - Multiple readers work simultaneously - Write performance improved dramatically … With WAL enabled and proper configuration, I've seen SQLite handle 500-1000+ writes/second on modern hardware while serving thousands of concurrent reads. Yes, Postgres can push higher numbers with multiple writers, but ask yourself: is your SaaS really doing more than 1000 writes per second? (Spoiler: it's not.) … ### ✅ But Here's What People Get Wrong: - "SQLite can't handle concurrent reads" – **Wrong.** It handles unlimited concurrent reads. - "SQLite doesn't support JSON" – **Wrong.** Full JSON support since 2015. - "SQLite can't do full-text search" – **Wrong.** FTS5 is excellent. - "SQLite databases corrupt easily" – **Wrong.** It's one of the most reliable storage formats ever created. … ## Top comments (50) ... Having separate servers for the application and the database is mainly because security concerns and different server requirement needs. It has less to do with what flavour of database you choose. Also Sqlite has no build-in authentication. This is a potential security risk. Sqlite is certainly a good sql database, and it is great the nice parts are getting promoted. Just be aware it is a tool like any other, it comes with flaws too. Yawar Amin • Jun 29 '25 > Sqlite has no build-in authentication. This is a potential security risk. Potentially, in the sense that if you don't give your database file the correct ownership and permissions on disk, it could be read by other users on the machine. Or if you let your machine accept incoming connections that can read files on disk, and can access the SQLite database file, they can potentially read your data. … - Rails 8 defaults to SQLite, so for my new projects I use SQLite as it's actually less work from the start!