Problem
A subscription product bills per seat. A seat's lifecycle (assignment, removal, permission changes, contract terms, edge-case adjustments) spans several systems with different schemas. One invoice line can hide a long chain of events. Small discrepancies come from subtle interactions between product events and billing logic. Support, order-management and enterprise teams must explain invoices to customers, and billing engineers need exact charge histories to debug. A major pricing and billing re-architecture also needed verification in development and production, because wrong bills hurt customers' trust.
Example from the article: Figma's Billing team supported the billing model refresh (changes effective March 11, 2025) with SQL consistency checkers and an Invoice Seat Report.
Solution in brief
Turn business rules into SQL invariants that compare the expected state with the data in every source of truth on a fixed schedule. Violations go as structured alerts, with the offending rows, to the owning engineering team. When the same reconstruction logic is needed repeatedly, package it as a small internal data application.
Questions this case answers
- How to verify the correctness of a stateful business workflow whose state is spread across several systems of record
- How to make the history behind a computed business figure explainable to non-technical teams and engineers
- How to verify that complex billing logic produces correct charges when state lives in several systems with different schemas?
- How to catch race conditions, edge cases and logging gaps in a stateful workflow before and after a major re-architecture?
Tools and methods
- Consistency checkers — SQL invariant tests run on a pre-defined cadence against product logs, billing state, payment processing and CRM data
- Invoice Seat Report — internal data application that rebuilds the story behind each seat charge in plain language
- Alert routing — structured alert with exact rows and metadata sent to the relevant engineering team
Google or a one-time email code. No password.