Resilience considerations when a secondary has extra indexes

The lecture on adding indexes to a secondary node doesn’t mention any resilience considerations. It occurs to me that because this secondary node is prevented from becoming a primary node, in a 3-node replica set this leaves us with only one secondary to step up to be primary if the primary needs to step down. Also, replication of writes to the secondary with extra index is going to be slower than replication to the other secondary, so all else being equal, it’ll always be the other secondary which responds first when writing with a majority write concern, which could increase the overall latency of writes to the replica set.

With this in mind, would it be advisable to have more than 3 nodes in the replica set when one of the secondaries has these extra indexes, or would this be an unnecessary expense with little benefit?

1 Like


Considerations like that are exactly what a DBA needs to take into account when proposing something like secondary-only indexes. However, each case will need to be considered separately, and the decisions will have to be made based on local conditions, And, in any case, these are not issues for this Forum. I’d suggest that you post questions like this on the MongoDB public forums or on Stack Overflow. Good luck.

Thanks David :slight_smile:

Yes, I guess this question is probably out of scope for this course, but it’s nice to know that I’m asking the right questions :slight_smile:

Maybe the answers are in the M103 administration course… I live in hope… M103… bring it on!