So I’m in the process of (re-) setting up my homelab and unsure about how to handle databases. Many images require a database, which the docker-compose usually provides inside the stack.

Now my question, shall I have 1 database container which is accessed by all containers? Or shall I have a separate container for each service?

For critical services, which shall have as few dependencies as possible I’m already using sqlite or a similar solution.

Also on a sidenote: I have two docker hosts, can I let the containers of 1 hypervisors use the same internal docker network?

TIA!

Ruud
mod
link
fedilink
01Y

Backup / restore gets complicated if you have multiple apps in 1 dB

No one said a single DB. You can have multiple DBs in a single container, and then use something like databacker/mysql-backup container which solves the complexity of multiple db backups for mariaDB and MySQL

Ruud
mod
link
fedilink
21Y

Yes, terminology… I mean single instance. And although you can create pg_dumps of separate databases, a true (online) backup of separate databases is difficult. Tools like pgbackrest or barman don’t support it. (I mainly focus on Postgres)

Create a post

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 posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

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

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

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

Questions? DM the mods!

  • 1 user online
  • 53 users / day
  • 89 users / week
  • 209 users / month
  • 866 users / 6 months
  • 1 subscriber
  • 1.4K Posts
  • 7.96K Comments
  • Modlog