3 ms·
A DB server won't have to go to disk for every query, sqlite almost always will, or at least reach out from user space to virtual memory, which is still slower
by winrid 3y ago
A DB server won't have to go to disk for every query, sqlite almost always will, or at least reach out from user space to virtual memory, which is still slower than reading from a buffer table.
So ya, in process is faster for trivial stuff. But it's not faster when doing heavier workloads that benefit from things being in memory or having a better query planner.
- simonw 3y agoI don't think that's true? SQLite uses in-memory caching just like MySQL and PostgreSQL do.
- winrid 3y agoyeah my bad it does have a page cache: https://www.sqlite.org/arch.html https://www.sqlite.org/arch.html The more you know :) The query planner is still not nearly as good as PG's, but it's okay for simple applications. I have actually used sqlite "at scale"... I'm still not sure people know that system (30k+qps dumping data into kafka) is running on sqlite on an EBS volume lol. But in this case it's just streaming stuff from disk, so pretty much any DB would have worked.