Database Design for Microservice Architecture

I plan to use the Microservices architecture to implement our website. I wanted to know whether to use databases between services correctly or if it was desirable to have a separate database for each service. In this regard, can I consider the possibility of using one common database for all services or violate the very essence of Microservice architecture?

+3
source share
2 answers

Microservices offers a denouement . You must split the application into independent domains. Each domain can have a database. If other MSs require access to data belonging to some other microservices, they must communicate over the network.

If you feel that there are too many dependent services and there would be too many network calls, then you can define the domain by combining the dependent services.

For example, suppose I have an online test testing service in which a company manager can publish tests, and he can view the results of all employees in his department.

My Microservices for this scenario will be:

Initial design

  • User Service: for login and user information.
  • Testing Service: A service for evaluating tests.
  • :
  • : CRUD
  • : CRUD

, , , , /API, . .

  • : .
  • :
  • : , , .

. mongoDB NoSql DB, .

, .

+8

, : (. 25).

, . , microservice1 table1_1 table_1_2 microservice2 table2_1 table2_2. , . .

+7

Source: https://habr.com/ru/post/1016765/


All Articles