Explores a race condition in event-driven read model rebuilding where events can be skipped during the transition from rebuilding to active status. After examining multiple failed coordination approaches (waiting for transactions, transaction ID boundaries, exclusive locking), the author proposes a Dead Letter Queue pattern: recording skipped events in a system messages table during the same transaction, then draining them after rebuild completion. The solution accepts that some failures are unavoidable in distributed systems and focuses on making them visible and recoverable rather than preventing them entirely.
Table of contents
Everyone has a plan until they get punched in the mouthThe Rabbit Hole of “Fixes”Stop Fighting, Start TrackingThe Final FlowThe Dead Letter Queue PatternThe Broader LessonSort: