canton-pqs
Canton PQS (Participant Query Store)
Overview
PQS subscribes to a validator's transaction stream and projects contract data into a PostgreSQL database. Your backend then queries ledger state with standard SQL instead of walking the ACS over the Ledger API. It's the scalable read path for anything beyond simple per-contract lookups.
When to use PQS
Reach for PQS when you need:
- Filtered queries across many contracts (e.g. "all licenses expiring this month")
- Aggregations and reporting
- Full-text search or complex joins
- A read path that doesn't load the Ledger API (offload reads from the participant)
For a single known contract or a simple subscription, the Ledger API / ACS is enough — PQS shines at query complexity and volume.
How it stays in sync
PQS keeps its tables synchronized with the ledger: as contracts are created and archived, it inserts/updates the corresponding rows. Your SQL always reflects current ledger state (with a small propagation delay). Because it follows the same per-party transaction stream, it only ever contains contracts your party is a stakeholder of — privacy is preserved.