Skip to main content

What is replication lag and why does it occur?

Mid MongoDB
Quick Answer Replication lag is the delay between a write on the primary and its application on a secondary. Caused by: secondary hardware being slower, heavy write load, network latency, large write operations. Monitor with rs.printSecondaryReplicationInfo(). High lag means secondaries are stale - reads from them return old data and they're slower to take over if primary fails.

Answer

Lag occurs when secondaries apply changes slower than primary. Causes include heavy writes and slow hardware.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice