One Read, One Consistent Snapshot: Building Peerivo Catalog Discovery

Peerivo replaced an expiring multi-query Prisma catalog read with one bounded PostgreSQL snapshot. Tests passed; live endpoint verification remains explicit.

What broke

Peerivo’s product catalog discovery path used a multi-query Prisma repeatable-read transaction with a 5,000 ms timeout. Production reads could take about 6.5–7 seconds, which caused Prisma P2028 and could interrupt sitemap and catalog-manifest generation.

What changed

The fix replaces that sequence with one bounded read-only SQL SELECT. PostgreSQL gives the statement a consistent MVCC snapshot, so discovery no longer depends on a longer interactive transaction. Ordering, public-only filtering, fingerprints and IndexNow hooks remain part of the existing release path.

What we verified

The engineering handoff reports 161 unit tests passed, 18 native IndexNow tests, typecheck and build passed. A synthetic 150,000-product fixture produced 150,012 pages in eight sitemap parts. A read-only production EXPLAIN ANALYZE observed 30,015 product records and 13,242 owner records and about 417 ms for the query used.

These are test and database observations, not claims that every record is public or indexed.

What is still pending

The production deployment is READY. The remaining proof is repeated unauthenticated live HTTP 200 read-back for sitemap.xml and the catalog manifest, plus confirmation of release SHA, public counts and stable fingerprints. A deployed patch is not the same thing as a verified outcome.

Why this matters

A sitemap is part of the discovery contract between a changing product database, the website and search engines. The useful fix was not “raise the timeout”; it was to make the read atomic, scoped, consistent, privacy-preserving and measurable.

Catalog: https://peerivo.net/products/catalog

Peerivo Catalog Discovery: One Consistent PostgreSQL Snapshot — Peerivo