I'm designing a system that will have a lot of data, which can be in JSON format easily. The system will do a lot of reading, a lot of writing but very little updating. ACID and relational type joins are not super important, but HA and scalability are.

From reading MondoDB it seems that MongoDB uses a master-slave replication system where all nodes have all the data and writes can only be accomplished on the master. If I use sharding, it seems I get scalability but lose out on HA.

It occurs to me that I may be able to have two or more shards, each of which is a replicant, but I have not found that configuration in the docs and it seems this would be complex.

My questions are:

1 - Can I have HA and horizontal scalability?

2 - Is the single server write requirement a performance bottleneck?

Thanks very much.

  • What consistency guarantees do you require? Mongo runs faster in certain modes, but will lose committed data when the cluster partitions. jepsen.io/analyses/mongodb-3-6-4 – John Mahowald Feb 4 at 20:13
  • It's a good question, the truth is I don't know yet with certainty. In most cases, data written will not have to be read again quickly from any node, but there is an edge case where it might have to be. Even in that case, there can be a few seconds of delay until the slaves catch up. – Jim Archer Feb 4 at 20:16
  • You need to define the consistency required for your application. Including whether any of these is bad: not observing writes immediately, losing data on crash (potentially in only one shard), different threads reading different values. This defines how fast your configuration can be and still be safe. – John Mahowald Feb 4 at 21:07
  • Okay I can work on that, in my application design. But really, I'm wondering if MongoDB can be both scaleable and HA like Cassandra can. I like Cassandra's topology, but I like MongoDB's client interface. I can certainly build a MongoDB master-slave replication set, but my concern is that each server would need to scale vertically. I'm trying to figure out if I can avoid that. – Jim Archer Feb 4 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.