Django, SQLite, and Production
06-07, 10:15–10:45 (Europe/Madrid), Auditorium

SQLite is a capable database that can run production Django apps efficiently under the right conditions. In this talk, we will explore the strengths and weaknesses of SQLite to understand if it's a good fit for your production workload.


SQLite is the most widely deployed database in the world, and it's the default database for Django when starting a new project with the startproject command. However, the Django documentation warns users against using SQLite in production. In this talk, we will look at the most common issues with SQLite and how to mitigate them.

We will look at issues like database lock errors, timeouts, concurrent reads and writes, and slow performance and show how to work around some of these limitations. We will also show how to manage backups, replicas, and point-in-time recovery, which is necessary for many production applications.

We will look at the issues I had with SQLite on my side projects (fedidevs.com), how I overcame them, and how people use SQLite outside of the Django/Python community. We will also look at benchmarks to see how SQLite compares to PostgreSQL.

We will also cover some recent patches merged into Django that make it much easier to configure SQLite for web application use cases, starting with Django 5.1.

The talk's goal is not to convince you that your next application should use SQLite in production but to help you understand the trade-offs and make a good decision for your specific use case.

Video: https://youtu.be/GTDYwEXv-sE


Topics –

Django Internals, DB, Documentation

Audience Level –

Advanced

I enjoy writing Python code and surfing waves πŸ„β€β™‚οΈ

Side Projects:
πŸ’» https://github.com/anze3db/django-tui a TUI for all your Django commands
πŸ§‘β€πŸ’» https://fedidevs.com find awesome devs across the fediverse
πŸ§ͺ https://flakytest.dev tame your test suite flakiness