We are considering implementing a delayed member in our MongoDB replicaset to protect us from human error based data corruption, e.g. someone accidentally deletes some data.
How does a delayed member actually delay replication, as I see it there are two possibilities:
- the delayed member observes the primary's oplog with a filter of
ts < now - delay
- the delayed member observes the primary's oplog in real time, stores the oplog locally and replays each action as
ts >= now - delay
the reason this is vital for us is we're looking at a relatively large replication delay (24 hours). In normal operations our oplog maintains about 5 days of data, so whether (1) or (2) above is used in replication, we're fine. However, at certain times, our write workload is extremely high, in that situation our oplog will occasionally only contain < 1hr of data. In this situation (1) above will not work for us.