0
votes

I have an application in mind that would be built using node, mongodb + other db, kubernetes , RabbitMQ, docker and react as a front end. The application will be built in a microservice architecture. We all know that for a monolith app all you need is one DB (MongoDB, MySQL etc etc) but for a micro one you can have multiple databases. My question would be, do I need to buy multiple, separate databases and connect each service to them ? or how does it work in a micro-services design. At the moment a I have a sample microservices app that is running on my local machine using docker and its connected to multiple databases or database/service. I am just to trying to get an idea on how does this work with companies like DigitalOcean or AWS.

Any input on this would be great.

I am just trying to figure out how this going to work when it comes to production later so that I am ware of cost and deployments. I have done some research on Digital ocean, AWS etc etc but I still can figure out how do they work.

thanks in advance.

1

1 Answers

0
votes

You don't need having multiple instances of DBMS running. You can easily use one VM with one MongoDB running on it.

When you scale you might want to have separate machines running DB instances for your services, but at start you may just separate it logically to ensure you do not communicate between services using DB.

Chris Richardson on his microservices.io website says:

There are a few different ways to keep a service’s
persistent data private. You do not need to 
provision a database server for each service. 
For example, if you are using a relational database 
then the options are:

- Private-tables-per-service – each service owns a
set of tables that must only be accessed by that
service

- Schema-per-service – each service has a database
schema that’s private to that service

- Database-server-per-service – each service has
it’s own database server.

Source: https://microservices.io/patterns/data/database-per-service.html