Reputation: 1
I'm trying to define the architecture for a production sharded mongoDB server, I see in the documentation that each shard has to contain 3 replica-sets. I would like to have the sharding advantages(being able to compute distributed queries in the nodes depending on the shard key) and the replication failover functionality, but reducing the budget (and the number of servers).
The idea is to use small machines of 7GB RAM and 2 core 2GHz:
I have been searching and I found some people was installing the different replicas of the shards sharing nodes in the following schema:
Server 1: shard1, rep-shard2, arbitrer3
Server 2: shard2, rep-shard3, arbitrer1
Server 3: shard3, rep-shard1, arbitrer2
I tried this using docker and it works, however I don't know if I can have any performance issues by sharing the same node as the replica-set and the shard.
Another option is to use 4 cluster and 2 shards with the following schema which I don't like that much (1 more node, 1 less shard) but maybe would be could be better in terms of performance.
Server1: shard1,
Server2: rep-shard1 arbitrer2
Server3: shard2,
Server4: rep-shard2 arbitrer1
Upvotes: 0
Views: 114
Reputation: 14490
Replication is used for fault tolerance; sharding is used for performance (to scale out).
If you have a total of 3 servers, you should simply set up a 3-node replica set.
Your post misuses some of the terminology which makes it difficult to figure out what it is you are saying. "3 replica-sets" for example means 9 or more servers are involved.
Upvotes: 1