Usage Metering & Billing Pipeline · View 07 of 22 · Structure
Decisions
- Planes rather than microservices: the division is by what each group is allowed to be wrong about. The Record plane may never lose; the Metering plane may be rebuilt; the Money plane may be recomputed.
- Managed Flink carries the aggregation because event-time windows, watermarks and exactly-once checkpointing are the hard part and are not worth rebuilding; the checkpoint store is explicit on the diagram because recovery depends on it.
- Aurora PostgreSQL holds the financial ledger and DynamoDB the aggregates: the money side wants transactions and constraints, the metering side wants write throughput and a partition key.
Assumptions
- Dedup index at 250,000 events/s with a 7-day TTL is affordable on DynamoDB with on-demand capacity (stated assumption, and the most likely cost surprise in the design).
- Entitlement reads hit a DAX cache at better than 95%, which is what makes the 10 ms p99 reachable (stated assumption).
Omitted
- VPC endpoints, NAT, subnet layout and per-plane IAM roles — present in views 16 and 20.
- Two intra-plane edges were cut rather than routed around: Ingest API to stream, and rating to invoice ledger. Both are visible in views 09 and 13.