Database organisation

Using two databases instance

The application uses two PostgreSQL instances:

  • webapp: stores and serves the data used to administer and display objects for the “La Carte” and “L’Assistant” applications

  • warehouse: used for all data processing, calculations, and consolidation work. It also hosts the Airflow metadata database and, when enabled, the Metabase application database.

The goal is to separate the databases so that data processing does not impact the performance of the web application. We also need much more storage capacity for data processing, and higher responsiveness for the web application.

webapp_sample database

webapp_sample is a database stored in the webapp instance in preprod and locally (not in prod).

It holds a sample of the data (Auray and Montbéliard EPCIs, plus all digital acteurs) used by the e2e tests. The sample is always built locally by the compute_sample_acteur Airflow DAG from the webapp database — no remote sample database is copied. See create_webapp_sample_db.md.