Scaling Django for millions of users

  • Choosing the right database — I’m used to working with Postgres and have seen great results. The community also likes it for its performance, proven capabilities at scale, data integrity and people who keep working on making it better every day. Unless of course you want to go the NoSQL route for partition tolerance (remember CAP theorem?) but who says you can’t create partitions in Postgres, yes they do have it, check it out
  • Indexes — Adding appropriate indexes can speed up your DB (SELECT) Queries and reduce the time to respond to users. It is best to look at slow (above 30 ms) queries and queries that are done often to look at avenues for improvements. But don’t overdo it. More indexes would impact performance of INSERT and UPDATE and also increase the load on disks to store the indexes. pgFouine is a good log analyzer tool that you may want to try to get to these slow performing queries.
  • Also it is recommended that the CPU and RAM is tuned correctly for the number of client connections. Pgtune does a great job of helping you tune Postgres config by your hardware.

Product and Technology

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Everything you need to know about no-code apps

Creating an Automated Backup System for Files with Perl

WHAT and HOW

GraphQL Server With Java & Clients in Go and Rust

A Recap of my job search journey after a bootcamp graduation in April 2021.

How to Puzzle Out Object Oriented Programming Concepts

Responsive-Web-Design

What do people call DevSecOps role in Japan?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chetan Giridhar

Chetan Giridhar

Product and Technology

More from Medium

Deploying Django Application on AWS EC2 and Docker

Connecting Django to Amazon RDS

An Authentication Pattern for microservices using Django

Faster API development with django-dataclasses