PyCon Pune 2017

A conference on the Python programming language

Django on Steroids -- Lessons from Scale

Submitted by Sanket Saurav (@sanketsaurav) on Nov 30, 2016

Technical level: Intermediate Status: Confirmed & scheduled

Abstract

This talk summarizes my learnings (best practices and gotchas) by using Django as the core application engine in a production application for the past two years at DoSelect. I’ll discuss about the common, and not-so-common patterns you should take care of when you hit scale with Django, complete with real-life scenarios. Topics include (non-exhaustive) – production server configuration, best practices when using Django as provider for an SPA (Single-page app), caching, query optimization while using the ORM, gotchas while using async tasks, et al.

The talk is intended for people who have a basic knowlegde 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.

Outline

The Usual Suspects

  • Tuning your web server configuration (using Nginx and Gunicorn as example)
  • Caching whatever you can, but no more
  • How to write Django ORM queries that scale
  • When NOT to write Django ORM queries
  • Async tasks while maintaining data consistency

The Non-usual Suspects

  • Using Django with an SPA front-end
  • Scaling Postgres while scaling Django
  • Optmizing async task runners (more stuff to be added)

The talk will include real-world code examples while illustating the points above – explaining what we faced in production, and how we solved it (and then realized that’s what we should have done in the first place). I plan to have a bit longer Q&A session, due to the nature of this talk.

Requirements

Preliminary knowledge of Python and Django.

Speaker bio

Sanket (@sanketsaurav) is co-founder and Chief of Geeks at DoSelect. He’s 50% developer and 50% designer. He’s been dabbling with computers since the age of 10, and had started his first venture at 18. He loves the Web and likes building cool stuff that matter. His languages of choice are Python, Go and JavaScript, and he’s been building production apps using these for the past two years. He’s also spoken at more than 50 events and hackathons across the country on open source technologies including Python, HTML5 and web applications in general.

Links

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('You need to be a participant to comment.') }}

{{ formTitle }}
{{ gettext('Post a comment...') }}
{{ gettext('New comment') }}

{{ errorMsg }}