I have an architectural question.
Suppose we have a system that has multiple sub-systems: A
, B
, and so on. Each of these sub-system needs to persist their data and they all use MariaDB
. Sub-system A
may need a database
(as in create database ...
) called a_db
; and Sub-system B
may need a database called b_db
. Furthermore, there are no data sharing across A
and B
In a monolithic world before microservice and docker, it is common to set up one central MariaDB
instance and ask each sub-system to use it and to just use your own database
while on the shared instance (That is, A
uses a_db
, B
uses b_db
, and so on)
With docker, I think we could also have multiple mariadb containers running, and each maps their own volume for storage (e.g. /data/mdb_a
and /data/mdb_b
, respectively).
An obvious advantage would be complete isolation between A
and B
. There would be no worries that A
may accidentally mess with B
's data. And the two sub-systems can independently choose to shutdown/restart their own MariaDB container or even upgrade their MariaDB binary.
On the other hand, some of my colleagues argue that running multiple MariaDB containers is inefficient and this approach imposes waste of resources.
Are their good empirical measurements and articles discuss the trade-offs between the two approaches?