this post was submitted on 14 Jun 2026
40 points (97.6% liked)

Selfhosted

59923 readers
778 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam.

  3. Posts here are to be centered around self-hosting. Please ensure it is clear in your post how it relates to self-hosting.

  4. Don't duplicate the full text of your blog or git here. Just post the link for folks to click.

  5. Submission headline should match the article title.

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

Hello,

As the title suggests, how do you manage your DBs for docker services.

Do you spin a new DB for every new docker cluster or do you have a centralized DB that is accessible to the docker clusters.

What are the pros and cons of both method?

For the moment, I spin a new DB for every services as I feel it is easier to backup the service in case of a problem.

you are viewing a single comment's thread
view the rest of the comments
[–] JC1@lemmy.ca 7 points 1 day ago

I work per stack. Each stack can have multiple services/containers. So one db per stack. I usually work with the compose file provided by the app I want to run and they usually provide their database container in those. My persistent data for a stack is in a single folder for every services. For backup, I only have to backup the compose and environment files and also the persistent folder and that's it. Every stack is independent from each other so it's easier to move them from a server to another if I want to use more than one server.

I used to use only one db container for all db. It worked well, until I had a data corruption issue. I had to rollback from a backup for all services that used this db. Then I moved to 1 db per stack and it happened again, but this time, only that stack was impacted, so no big deal. Just did a rollback and everything was fine.