Add native support for multi-tenant applications

It would be very cool if Django had native support for truly multi-tenant applications, e.g. with one database per customer. It’s a common setup once scaling an application to a certain point, and in enterprise settings it might even be a compliance requirement that a customer’s data is kept in a separate database.

For convenience, a common way to solve this at the moment is to just run an entire separate environment with all services, including database, on its own domain etc. But this creates a lot of overhead and it would be much nicer if everything could be shared except the database. It can be accomplished with third-party apps, or elaborate routing rules based on multi-database support, but it would be way better of such a setup came with the batteries included.

What are people’s thoughts on this?

Welcome @peppersghost !

We support multiple clients - each client has their own Django instance, but all clients running on a server share the same PostgreSQL engine. (This works extremely well for us, because it allows us to customize the application for each client - and also perform maintenance on the system(s) without having to coordinate schedules between clients, with the exception of major system maintenance affecting all clients on that server.)