I'm setting up a MariaDB database in a container and will have between two to three other containers that need to access it. My main question is whether these containers can share the same database using different credentials without needing to create multiple MariaDB containers. Also, if I have a Docker Compose file that sets up MariaDB, how can I configure the other containers to connect to the same database while maintaining separate logins?
1 Answer
It sounds like you're mixing up the concept of clients and servers a bit. Just think of it this way: you've got one database server (MariaDB) and multiple clients (your other containers) that can connect to it. Each client can have its own separate access, or they can share the same database — both are possible. Remember, containerization is just a technology layer; the underlying server/client relationship remains the same.

Got it! So the containers act more like clients connecting to the same server rather than needing to be separate servers themselves. That clears things up.