The hack behind the curtain! Deploying a Multitenant Django application to more than 1600 stores
09-21, 17:10–17:40 (Europe/Lisbon), Auditorium

Data isolation is key when working with bounded physical tenants like grocery stores. All the APIs and data are tenant dependent and we don't want to mix them between stores. This is the tale of the yellow brick road to multitenancy and how a Django project hack became an open-source library for everyone to use. The hack behind the curtain, welcome to Oz!


In MercadonaTech we have online orders preparation warehouses called hives. We have evolved and optimized the tools used in these facilities over the last 5 years and we were ready to bring them to our stores where we planned to prepare online orders as well. But we had one little problem, we wanted to move from 3 isolated warehouses to more than 1600 stores. And until that moment, all the logic we developed for them didn't expect data from other centres, we had simple on-premise deployments for each hive and different databases that did not share data between them. That was a problem.

This is a story of wonder that tells how we hacked Django's ORM to automagically isolate the data from different stores and how we converted this messy hack into an amazing open-source library you can use to implement your own multitenant applications. The hack behind the curtain, welcome to Oz!

Video: https://youtu.be/_9vMEAHNmHE

Staff Engineer @ MercadonaTech. Machine Learning enthusiast. PDD (Python Driven Developer).
Doctoral student @ Universitat Politécnica de Valencia.

This speaker also appears in: