← Return to program

N+1 Problem in Django Rest Framework

Friday 4:50 PM–5:20 PM in Hall E

Part of the DjangoCon AU specialist track

N+1 problems in Django are not new. Anyone who has worked with Django must have had some interaction with the N+1 problem. Django Rest Framework allows building robust APIs on top of Django. We will explore the N+1 problem in DRF, understand its occurrence in DRF views and serializer fields, and review its performance implications.

See this talk and many more by getting your ticket to PyCon AU now!

I want a ticket!

Django and N+1 problems are a match made in heaven. N+1 is a common performance issue encountered in Django projects. Django Rest Framework builds on top of Django and allows the development of highly robust and dynamic APIs for Django apps. Using model serializers, creating a CRUD API with DRF has become simple. The simplicity comes with hidden costs and N+1 is among such costs. In this talk, we will dive into the N+1 problem within the context of Django Rest Framework (DRF), and explore how it can appear on both Views and within the Serializers.

Outline: - Speaker Introduction (2 mins) - N+1 problem introduction (5 mins) - N+1 on DRF views (7 mins) - N+1 on Serializer (8 mins) - Detecting & Resolving N+1 problems (5 mins) - Closing thoughts (3 mins)

Syed Muhammad Dawoud Sheraz Ali he/him • dawoudsheraz

A software engineer that is always getting amazed at the wonders Tech is producing every day.