Taking Django's ORM Async
|Countdown link||Open timer|
Django 3.1 has asynchronous views - but the next step is to put asynchronous support right into the beating heart of Django, its ORM. Learn the challenges of asynchronous API design in Python, how threading is crucial even in an async world, and what it takes to teach this ORM dog new tricks.
The quest to add "hybrid" asynchronous support to Django - where it can run both synchronous and asynchronous code - is a long one. Django 3.1 reached an important milestone with synchronous and asynchronous views, and now the next big step is to take a long, hard look at the thing that makes up over half the Django codebase: the ORM.
The ORM is gigantic, old, and complex - and has an API designed and tweaked over many years. We'll look at some of those design decisions and how they reflect in the world of async, the challenges that underlie a hybrid API, as well as how the safety-first nature of the ORM has to evolve to deal with new and exciting async ways of breaking things.
We'll also dive into what it means to have asynchronous database backends, and how support for those are progressing in the Python world - and how we're trying to ship something that's useful before fully asynchronous database APIs are done.
Andrew is a Django core developer and contributor, a staff engineer at Robinhood, and has been behind several Django feature changes, including migrations and async support.
In his spare time, he likes to fly light aircraft, adventure around any nearby mountains, or try his hand at making a whole series of weird and wonderful hobby projects.