One or multiple databases per Docker container

前端 未结 2 412
陌清茗
陌清茗 2021-02-05 10:24

Let\'s say I have several different containers and each one of them uses it\'s own database. What is the best practice in this case regarding performance? Run one container, say

2条回答
  •  攒了一身酷
    2021-02-05 11:13

    You'd want to use a single database server, preferably running a shell you can attach to for administration, sharing either a Unix socket, a port or both to linked containers. This means you'll have an easier time managing the database container as a service, tweaking performances, monitoring usage, backing up volumes, etc.

    Granted, there might be non-standard situations where you might want to have independent servers, for instance running servers with isolated host resources, users, databases, though I'm certain this shouldn't apply to developer environments.

提交回复
热议问题