As a Django application grows, the database is usually the first and most significant bottleneck. Scaling it involves query optimization, indexing, connection management, read replicas, caching, and eventually architectural changes — addressing the database is the highest-leverage scaling work for most Django apps.
1. Optimize queries first (biggest, cheapest wins)
Book.objects.select_related().prefetch_related()
Article.objects.only(, )
Article.objects.values()
django.db.models Count, Sum
Author.objects.annotate(book_count=Count())
