MongoDB – Using RAID0 for Performance

mongodb

As I'm reading production notes of mongodb I found that RAID0 is not recommended:

Most MongoDB deployments should use disks backed by RAID-10.
Avoid RAID-0 with MongoDB deployments. While RAID-0 provides good write performance, it also provides limited availability and can lead to reduced performance on read operations, particularly when using Amazon’s EBS volumes.

Question 1: As to my understanding, in a distributed system failure should be considered as an ordinary state. Then why would i care about the failure of one node? (I mean in a replica set)

Question 2: Shouldn't RAID0 provide good performance for both read and write? Why does it lead to reduced performance on read operations, any special reason?

Best Answer

Question 1: The answer here is yes and no. In a replica set if your PRIMARY fails one of your SECONDARIES will take charge. If all CRUD statements have replicated from PRI to SEC when your disk crash then you are fine. But in case that some statements are not (replication lag) and your disk crash you will lose those statements. If you can handle that loss RAID 0 will work for you. Additionally on a 3-member replica set when you have one disk fault on a node you must replace it asap else you are not in a safe state.

Question 2: I don't have a clear answer to that. I think you should investigate the level of read concurrency between RAID0 and RAID10. Also don't believe that for small-medium workloads will have noticeable differences.