Event-driven read models can be rebuilt safely using a hybrid approach combining PostgreSQL advisory locks with persistent status tracking. Inline projections use shared locks for concurrent processing, while async rebuilds acquire exclusive locks to prevent conflicts. Advisory locks handle fast-path coordination and prevent

18m read timeFrom architecture-weekly.com
Post cover image
Table of contents
Add new vs update existing.In place update, blue/green rebuild and backfilling dataConcurrency issues while (re)building read modelsDistributed Locking and PostgreSQL advisory locksWhy advisory locks alone aren’t enoughThe hybrid-locking approachThe scenarios walkthroughTLDR

Sort: