What is a cluster in MongoDB?

I'm someone new to mongoDB and have absolutely no knowledge of databases, so I would like to know what a cluster is in MongoDB, and what is the connection point to one in MongoDB? Do we need to connect to one or can we just connect to a local host?

+5
source share
2 answers

The mongodb cluster is the word commonly used for the sharded cluster in mongodb. The main objectives of the fragmentation mongodba are:

  • Scaling reads and writes multiple nodes
  • Each node does not process all the data, so you can split the data among all the nodes of the shard. Each node is a member of a shard (which is a replicator, see below for an explanation), and data is shared across all shards.

This is a representation of a copied mongodb cluster from an official doc .

mongodb sharded cluster

If you start with mongodb, I do not recommend you cheat your data . Shards are harder to maintain and process than a replicaset. You should take a look at the basic replicas. It is fault tolerant and sufficient for simple needs.

Replicas Ideas:

  • Each information is reprinted on each node.
  • Only one node accepts entries

Replication view from official doc

enter image description here

For simple applications, there is no problem getting your mongodb cluster on the same host as your application . You can even use them on the same member replicator, but you will no longer refuse rejections.

+5
source

It will be more clear if you create a cluster in the Mongo cloud website . Try the free version. You can see live server monitoring. enter image description here

0
source

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


All Articles