<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/on-rebuilding-read-models-dead-letter-queues-and-why-letting-go-is-sometimes-the-answer-ytt74jgv4" -->

---
title: On rebuilding read models, Dead-Letter Queues and Why...
description: A deep dive into a race condition discovered in event-driven read model rebuilding with PostgreSQL. The author walks through three failed attempts to prevent...
canonical: https://daily.dev/posts/on-rebuilding-read-models-dead-letter-queues-and-why-letting-go-is-sometimes-the-answer-ytt74jgv4
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: On rebuilding read models, Dead-Letter Queues and Why Letting Go is Sometimes the Answer | daily.dev
og:description: A deep dive into a race condition discovered in event-driven read model rebuilding with PostgreSQL. The author walks through three failed attempts to prevent...
og:url: https://daily.dev/posts/on-rebuilding-read-models-dead-letter-queues-and-why-letting-go-is-sometimes-the-answer-ytt74jgv4
og:image: https://api.daily.dev/og/posts/ytt74JGV4.png
og:image:alt: On rebuilding read models, Dead-Letter Queues and Why Letting Go is Sometimes the Answer
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# On rebuilding read models, Dead-Letter Queues and Why Letting Go is Sometimes the Answer

**[Event-Driven by Oskar Dudycz](https://daily.dev/sources/event-driven-io)** · 18 min read · 0 upvotes · 0 comments

## Summary

A deep dive into a race condition discovered in event-driven read model rebuilding with PostgreSQL. The author walks through three failed attempts to prevent events from being skipped during inline projection rebuilds (waiting for in-flight transactions, using transaction ID boundaries, and locking appends), explaining why each fails due to PostgreSQL's transaction visibility rules. The solution reframes the problem: instead of preventing skips, record them as system messages in the same transaction, then drain and process them after the rebuild completes. This is essentially a Dead Letter Queue pattern applied to projection rebuilding. The broader lesson is that distributed systems have fundamental constraints that can't always be engineered around — accepting failures and making them visible and recoverable is often stronger than complex coordination machinery.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://event-driven.io/en/rebuilding_read_models_skipping_events>

## Similar posts on daily.dev

- [On rebuilding read models, Dead-Letter Queues and Why Letting Go is Sometimes the Answer](https://daily.dev/posts/on-rebuilding-read-models-dead-letter-queues-and-why-letting-go-is-sometimes-the-answer-9srxnccwt) · Architecture Weekly · 4 upvotes · 0 comments
- [Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems](https://daily.dev/posts/using-postgresql-as-a-dead-letter-queue-for-event-driven-systems-ekm9n1imv) · Hacker News · 0 upvotes · 0 comments
- [Rebuilding Event-Driven Read Models in a safe and resilient way](https://daily.dev/posts/rebuilding-event-driven-read-models-in-a-safe-and-resilient-way-v2gd5xsp0) · Architecture Weekly · 16 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#postgresql](https://daily.dev/tags/postgresql), [#distributed-systems](https://daily.dev/tags/distributed-systems)

[View this post on daily.dev](https://daily.dev/posts/on-rebuilding-read-models-dead-letter-queues-and-why-letting-go-is-sometimes-the-answer-ytt74jgv4)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"On rebuilding read models, Dead-Letter Queues and Why Letting Go is Sometimes the Answer","url":"https://daily.dev/posts/on-rebuilding-read-models-dead-letter-queues-and-why-letting-go-is-sometimes-the-answer-ytt74jgv4","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/on-rebuilding-read-models-dead-letter-queues-and-why-letting-go-is-sometimes-the-answer-ytt74jgv4"},"datePublished":"2026-06-17T11:26:18.771Z","dateModified":"2026-06-17T11:34:37.614Z","description":"A deep dive into a race condition discovered in event-driven read model rebuilding with PostgreSQL. The author walks through three failed attempts to prevent...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4054a3bf4a3a29640652333f224b84e8?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4054a3bf4a3a29640652333f224b84e8?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Event-Driven by Oskar Dudycz","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Event-Driven by Oskar Dudycz","logo":"https://media.daily.dev/image/upload/s--unDKCFQ0--/f_auto,q_auto/v1781695550/logos/event-driven-io?_a=BAMAMiWQ0","url":"https://daily.dev/sources/event-driven-io"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/on-rebuilding-read-models-dead-letter-queues-and-why-letting-go-is-sometimes-the-answer-ytt74jgv4","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,postgresql,distributed-systems","timeRequired":"PT18M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Event-Driven by Oskar Dudycz","item":"https://daily.dev/sources/event-driven-io"},{"@type":"ListItem","position":3,"name":"On rebuilding read models, Dead-Letter Queues and Why Letting Go is Sometimes the Answer"}]}
```

