Using Postgres Schemas to Separate Data of Your SaaS Application in Django
EuroPython Conference via YouTube
Pass the PMP® Exam on Your First Try — Expert-Led Training
The Private Equity Associate Certification
Overview
Build a Learning Habit
Download Class Central's free printable study calendar
Download for Free
Learn how to implement secure and performant data separation in Django SaaS applications using PostgreSQL schemas through this 30-minute conference talk from EuroPython 2025. Discover the challenges of ensuring customers only access their own data while maintaining performance at scale, moving beyond the traditional approach of filtering tables with foreign keys. Explore PostgreSQL's schema feature as a database-within-a-database solution and master the django-tenants library for implementing multi-tenancy. Understand the distinction between shared apps containing globally accessible data and tenanted apps specific to individual customers, where data availability depends on the active tenant typically determined by subdomain. Walk through a simplified problem setup and see how django-tenants streamlines SaaS application development while maintaining the familiar Django model workflow without manual filtering requirements. Examine both the benefits of this approach and the new challenges it introduces for scalable multi-tenant architecture.
Syllabus
Using Postgres schemas to separate data of your SaaS application in Django — Mikuláš Poul
Taught by
EuroPython Conference