docker多个mysql实例_用于mysql的多个docker容器或具有多个数据库的一个实例

bd96500e110b49cbb3cd949968f18be7.png

I have a question regarding best practices using docker containers.

I need one database for each application I develop. Now my question is whether I should use one mysql docker instance with multiple databases inside or should I create one instance for each database. The disadvantage I see with creating one instance per database is that I can't have a user which has access to all database. I know this is a pro for security reasons but when I try to backup from a client than I need to go in every instance for backup up. And isn't multiple instance using to much overhead of resources (although mysql may be using less resource, but using e.x. mssql instance which is quit bigger may cause resource problems later)

My question is what is the common way to do it with docker and what are the pros and contras?

解决方案

Docker is especially suited to the deployment of microservices. The following links discuss two strategies with regard to the use of databases:

I personally favour the use of a single database per service and extend that to the deployment of separate instances of a database server. This ensures services are loosely coupled, should one service suffer a DB outage, it won't impact another.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值