bluetape4k workshop
SaaS Usage Billing · Interactive Architecture
Turn Usage Events into Correctable Invoices
Compare how a ledger baseline, Event Sourcing, and five microservices preserve the same billing invariants while changing data authority and recovery cost.
Ledger baseline
One PostgreSQL authority preserves deduplication, occurrence-time pricing, resumable closing, an immutable ledger, and invoices.
Scenario to verify
Invariants that survive each architecture choice
SOURCE_EVENT_DEDUPSource-event deduplicationA business fact is stored once regardless of retry count.
OCCURRED_AT_PRICEOccurrence-time pricingSelect the price interval at usage time, not billing time.
IMMUTABLE_FINANCIAL_FACTImmutable finalized moneyCorrect finalized amounts with linked records instead of mutation.
RESTART_SAFE_RESULTRestart-safe outcomeResuming from a checkpoint must converge on the same final result.
LINKED_CORRECTIONLinked correctionLate or incorrect results point back to their original record.