Microservices with shared database? using multiple ORM's?

后端 未结 2 1790
梦谈多话
梦谈多话 2020-11-27 16:10

I\'m learning about microservices and I\'m gonna build a project with a microservices architecture.

The thing is, one of my team mates want to use one database for a

2条回答
  •  星月不相逢
    2020-11-27 16:52

    You are not likely to benefit from a Microservices architecture if all the services share the same database tables. This is because you are effectively tightly coupling the services. If a database table changes all the services will have to change.

    You have to understand that the whole reason for a Microservices architecture is to reduce dependencies between development teams and allow them to move ahead independently with fast releases.

    Here is a quote from Werner Vogels, the Amazon CTO (Amazon pioneered a lot of the Microservices style architecture):

    For us service orientation means encapsulating the data with the business logic that operates on the data, with the only access through a published service interface. No direct database access is allowed from outside the service, and there’s no data sharing among the services.

    For more information read this and this.

提交回复
热议问题