TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Django SQLite Benchmark

1 pointsby anze3dbover 1 year ago

1 comment

hrukover 1 year ago
We came to pretty much the same conclusions for our Django app. We ended up using the &quot;connection created&quot; signal to set SYNCHRONOUS=NORMAL, but I hope to see that supported natively in Django soon enough.<p>Honestly, this setup will keep us going for a long time. There are some design considerations that you need to keep in mind while structuring your Python code. For example, on a gp3 EBS volume, our mean single-write latency IN SQLite is about 100 microseconds, so in theory, if we can keep transactions short, the scale we can achieve on just SQLite is massive. We&#x27;ll also get serialized isolation on writes and snapshot isolation on reads for &quot;free.&quot; However, Django&#x2F;Python are not super quick, so if we decorate all our Python functions that make writes with `@transaction.atomic` we end up with 10+ MILLIsecond locks on the DB, massively reducing throughput.<p>This is a price to pay for using SQLite, but honestly, even if we end up having to move to a proper RDBMS later, our database will probably be happier we wrote our code with transaction length in mind.