For my assets web app, written in Flask (Python) I have separated the app and the database into separate instances. This allows me to update the app and its dependencies without impacting the database and its dependencies, or vice-versa.
The database could be one of many as I’m using SQLAlchemy to handle the connectivity between the web app and the database. In this instance I’m using MySQL as the database and when I deployed my web app into a Microsoft Azure App Service WebApp I hit some issues as the container was missing a Python module for MySQL and the one most StackOverFlow answers pointed to (mysqlclient) required installing either MySQL or more Linux packages (such as default-libmysqlclient-dev).
In what turns out to be a good moment to remind myself to read the manual, SQLAlchemy has different connectivity strings to offer various ways to connect to a MySQL database. Instead of the connection string “mysql:“, I found that the Python module PyMySQL and the connection string “mysql+pymysql:” worked for me.
Full guidance notes for SQLAlchemy’s database connectivity options can be found at https://docs.sqlalchemy.org/en/20/core/engines.html#mysql .