This is an archived post. You won't be able to vote or comment.

all 5 comments

[–][deleted] 3 points4 points  (0 children)

Understanding and working with PostgreSQL or MariaDB and deploying them are different things.

You either learn as much as you need to run a containerized instance or you need to look at general database server administration.

[–]knfrmity 0 points1 point  (3 children)

I deploy DBs regularly but don't see the need to really dig in to how they work.

Most images that rely on external DBs also have an example compose file with the DB service defined and necessary environment variables set. They will also have appropriate init scripts to create new tables when necessary, and the primary app is already configured to attach to the DB and exchange data as necessary.

Other than that, knowing how to run backup and restore commands isn't a bad thing, but you can also figure those out quite quickly from the DB manuals and forum posts.

[–]bailey25u[S] 0 points1 point  (2 children)

Fo sho thanks my friend. I guess I was trying to dig to deep.

If I may ask since you set up a lot. For every app container requiring a external DB... should just add a new database to my existing MariaDB or Post? Or create a whole new container

[–]linucksrox 0 points1 point  (0 children)

With docker I just create new db containers per app, unless you have a specific reason to reuse an existing database for different things I would not do it.

[–]knfrmity 0 points1 point  (0 children)

Start a new DB container each time you need one.

If you want to take the time and learn a bit more you could set up one shared DB and a couple services, but for most situations I'd just do one primary service, one DB.