Deploy mongoDB on Multi-AZ in MongoDB Atlas

Hello,

I need to prepare a technical plan to deploy mongoDB cluster on multi-AZ in mongoDB Atlas and how I can perform a stress test for it, e.g. :

  1. 3 nodes = X read transactions/s and Y write transactions/s
  2. 5 nodes = X read transactions/s and Y write transactions/s

Appreciate your support.

Hi @Haytham_Mostafa,

Write operations always happen on the Primary first (then replicated to the secondaries). So 3 or 50 nodes => Same number of write transactions / sec.
Reads could technically scale up if you add more nodes, if you start reading from secondaries (and accept eventual consistency, $nearest, etc), but it’s not a good idea.

Replica Set are for High Availability, not for scaling. If you rely on your 3 nodes to provide 30K reads / seconds, if one node fails, sending suddenly 15K reads / secs (instead of 10K) to the 2 remaining nodes might just DDOS them (domino effect).

Your first lever to get more reads & writes is vertical scaling: migrate from M10 to M30 in Atlas for example.
The second and most efficient lever to get real scaling on both reads and writes is Sharding: multiply the number of replica sets to make them work as a team in parallel.

That being said, by default, Atlas deploys 3 node replica sets.
If you want more nodes though, you can activate the Multi-Cloud, Multi-Region & Workload isolation option and increase the number of nodes in the region.

But please, remember that this is not scaling up. It’s just adding more resilience to your cluster.

Sharding (==scaling up) is this way:

Cheers,
Maxime.

2 Likes

Thanks a lot for these valuable info.

1 Like