How to support both approaches with Flask & SQLAlchemy at once

Photo by Jan Antonin Kolar on Unsplash

In this article, you will learn how to manage multi-tenancy with Flask and SQLAlchemy. You will learn how to do it with many databases for many tenants and many schemas (one database for all tenants and for each tenant a schema). It’s possible to apply both approaches at the same time. You can do this with a proper session and connection management.

Business Background

When developing web applications that have to serve many customers, you often go for multi-tenancy. Especially if you do not want to build dedicated software versions per customer. This means that you will have one platform where every…

Johannes Groschopp

Software Engineer in Munich, Germany

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store