Django on Steroids -- Building Applications at Web Scale
Sanket Saurav (~sanket) |
Django is an excellent web-application framework to build scalable, extensible and high-performance web applications that can serve hundreds of thousands of requests per second -- while keeping the development cycle optimal and maintaining the sanity of developer mind-space. The success of the framework can be attributed to the well-thought out design patterns and opinionated decisions the framework makes that walks the thin line between having all batteries included and giving the developer tremendous room to grow out of the box.
This talk summarizes my learning from using Django as the core application engine in multiple production applications for the past two years at DoSelect to serve tens of millions of requests everyday, while maintaining stringent availability SLAs and extremely low response times. The content of the talk outlines the best practices and gotchas in using Django meant for web scale -- right from designing the project layouts to writing different components of your app, and finally breaking out of Django and using the best tools to support performance and reliability of your application.
The talk would be structured around the following focus areas:
- Structuring your Django project for extensibility and performance
- Designing your request-response workflow for optimal throughput
- How to write Django queries that don't kill your application
- Designing your caching workflow
- Using components around your Django app optimally -- Gunicorn, NGINX, PostgreSQL, etc.
The talk will include real-world code examples while illustrating the points above – explaining what I faced in production, and how I solved it (and then realized that’s what I should have done in the first place). This talk builds on top of a talk given by me at PyCon Pune 2017 -- the content has evolved as I have while continuing on quest to use Django better in production.
The talk is intended for people who have a basic knowledge of Python / Django, know how web applications work in general. Key take-aways would be things you can directly drop into your production Django application for better performance.