10 ms·
Is FastAPI just bad with SQLite? I would have expected SQLite to smoke Postgres in terms of ops/s.
by kevinak 11mo ago
Is FastAPI just bad with SQLite? I would have expected SQLite to smoke Postgres in terms of ops/s.
- makapuf 11mo agoSQLite is in process, but concurrent write / performance is a complex matter : https://sqlite.org/wal.html https://sqlite.org/wal.html
- kevinak 11mo agoYes, that's why I would expect it to smoke Postgres here, in process is orders of magnitude faster. Do you really need concurrency here when you can do 10-100k+ inserts per second?
- ies7 11mo agoIf 100k users each hit purchase button at the same time will sqlite write it in 1 second? This is different than 1 user doing the purchase for 100k fans
- kevinak 11mo agoI mean it depends on the query and what you're doing of course, but it's not impossible to reach writes/s in the 80k range.
- koakuma-chan 11mo agoI think Python is bad in general if you want “high-performance”
- 0cf8612b2e1e 11mo agoAlso surprised. My yardstick was this post which showed SQLite beating Postgres in a Django app. Benchmarking is hard, and the author said the Postgres results were not tuned to the same degree as SQLite, so buyer beware. https://blog.pecar.me/django-sqlite-benchmark https://blog.pecar.me/django-sqlite-benchmark