Practical lessons learned from running SQLite as a production database for a Django site. Key discoveries include: running ANALYZE to fix a 5-second query that dropped to 0.05 seconds, handling slow DELETE operations that cause write timeouts by batching cleanups, two backup strategies (restic with VACUUM INTO and Litestream for incremental backups), and splitting tables across multiple SQLite database files. The post also reflects on SQLite's single-writer limitation compared to Postgres.
Table of contents
ANALYZE is apparently importantcleaning up the database is trickyno notes on performance of ORM queries yetbacking up sqliteyou can use multiple databasesthat’s all!some references1.9K Impressions