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.

  • Zikeji@programming.dev
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    2 days ago

    Individually. If the app requires a DB, I put it in the compose file. This simplifies both backups and migrations. My tooling for backups has a pre and post script I can customize on a per app basis so I just have the pre do whatever *dump for that DB and the post clean it up (backup takes a tar of the folder).

    • mertn@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 hours ago

      My backup tooling just shuts down the container and associated db, then rysncs it all somwhere safe and restarts the container. Am I missing somethoing critical by not doing a db dump in the middle of that?

      • Zikeji@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 hours ago

        Most of the time that’s perfectly fine, but if the database were in the middle of an operation you risk corruption.