I
I
IDDH2017-10-13 15:26:36
JavaScript
IDDH, 2017-10-13 15:26:36

NodeJS && MongoDB. How to run on multiple servers so that mongo is not a bottleneck?

Good afternoon!
There is a project written using NodeJS and MongoDB.
We want to run it on multiple servers. But there were questions on mongodb.
If you use one database for all servers, we think there will be a load and the database simply will not keep requests from all servers.
If you use your own database for each server, then how to distribute data among the rest?
In the case of replication, how to determine that the data has already appeared on the slaves and we can send the user to the replica?
Tell me how to do it more competently here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mamont80, 2017-10-19
@mamont80

the database simply will not keep requests

Well, this is MongoDB, in which sharding and replicas are out of the box. There will be a load - you will think.
It is certainly more reliable to have different databases, but then think for yourself what kind of application and whether it is possible to do this. And I would not advise you to flog a fever until a real need arises.
Again, this is up to MongoDB itself.
Competently is to start the project and solve problems as they come. If you are not running a Super Killer Project, then the load will increase very gradually. There will be time to tweak and optimize.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question