What is the difference between a cluster and a replica set in mongodb atlas?
Asked Answered
A

1

12

I'm taking the Mongodb University M103 course and over there they gave a brief overview of what a cluster and a replica set is. From my understanding a cluster is a set of servers or nodes. While a replica set is a set of servers or nodes all of which has replication mechanism built into each of them for downtime access and faster read operation.

From that it seems that replica set is a specific type of cluster, but my confusion arises from MongoDB Atlas. In mongoDB atlas one has to create a cluster, is that a replica set as well?

Are those terms interchangeable in all scenarios?

Anthropogeography answered 7/5, 2020 at 11:7 Comment(1)
If that cluster has replication enabled, then yes, there will be a replica set in it.Luxurious
F
16

Replica Set

In MongoDB, a replicaset is a concept that depicts a set of MongoDB server working in providing redundancy (all the servers in the replica set have the same data) and high availability (if a server goes down, the remaining servers can still fulfil requests). When you create a replicaset, you need a minimum of 3 servers. There will always be a primary (read and write) and the remaining are called secondaries (for reading only).

MongoDB Atlas Cluster

Atlas is a DaaS, meaning a database a service company. They remove the burdain of maintaining, scaling and monitoring MongoDB servers on premise, so that you can focus on your applications.

An Atlas MongoDB cluster is a set of configuration you give to Atlas so it can setup the MongoDB servers for you. Hence, a MongoDB ReplicaSet is a feature subset in Atlas.

For example, while creating an Atlas Cluster, they will ask you whether you want a replicaset, sharded cluster, etc. Also, in which cloud provider you want to deploy. Your backup policy, the specs of your MongoDB hardware and more...

The keyword here is configuration. At the end of the day, you will have your MongoDB servers (replicaset or not) up and ready.

Summary

MongoDB Cluster

A specific configuration set of MongoDB servers to provide specific features. i.e. replicaset and sharding.

MongoDB Replicaset

A MongoDB cluster setup to provide redundancy and high availability with 3 or more odd number of servers (3, 5, 7, etc.)

MongoDB Atlas Cluster

High level MongoDB cluster configuration that allows you to set a replicaset or other type of MongoDB cluster with its location and performance range.

I would suggest you to play with their web console. You will definitely see the difference.

Floreneflorentia answered 7/5, 2020 at 15:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.