Demo 3.15: Ledger Consistency & Integrity Verification
Functional Objective: Verifies that the primary distributed ledger (TigerBeetle) and the localized Postgres General Ledger projection maintain exact parity and eventual consistency, ensuring zero data loss even during network partitions or catastrophic worker crashes.
๐ฅ Video Walkthrough & Feature Tour
Section titled โ๐ฅ Video Walkthrough & Feature TourโLedger Integrity, Chaos Monkey & Zero Data Loss
Demonstrates a system chaos test where the outbox relay worker is terminated mid-transaction. Proves that the system enters a partition state securely, and instantly reconciles the Postgres read-model with the immutable TigerBeetle write-model once the worker recovers.
๐ Core Functional Capabilities
Section titled โ๐ Core Functional Capabilitiesโ- Immutable Ledger Verification: Dual-write verification ensuring the high-performance
book_keeper.ledger_transferstable in TigerBeetle matches the relationalfinancialglentryprojection in PostgreSQL. (Note: Immutability and ledger integrity guarantees are currently provided natively by TigerBeetle. The PostgreSQL projection acts purely as a read-model without row-level cryptographic signing, althoughMeta.dual_signhash-chaining is planned for a future release). - Worker Crash Resilience (Chaos Testing): Simulated partition scenarios where the JetStream Outbox worker (
SIGKILL) is crashed during a live Journal Entry submission. - Eventual Consistency & Auto-Recovery: Once the background worker is restored, pending transactions in the Outbox are instantly replicated to the Postgres read-model without any lost updates or duplicate transactions.
- Document Lifecycle Management: Cryptographically secure document submission with strict double-entry ledger validation.
- Voucher Isolation: UUID-based ledger isolation per test run to prevent data pollution on shared enterprise databases.
๐๏ธ Technical Architecture & DocType Mapping
Section titled โ๐๏ธ Technical Architecture & DocType MappingโIn Business M and Framework M, this domain is powered by native, metadata-driven DocTypes, async controllers, and distributed ledger adapters:
Active Business M DocTypes
Section titled โActive Business M DocTypesโJournalEntry, FinancialGLEntry, Company, Account
graph LR
User["Stakeholder Portal / Desk"] --> Gateway["API Gateway"]
Gateway --> Controller["Journal Entry Controller"]
Controller --> TB[("TigerBeetle Immutable Ledger (Write)")]
Controller --> Outbox["JetStream Outbox Queue"]
Outbox -. "Crashes / Recovers" .-> Worker["Outbox Relay Worker"]
Worker --> DB[("PostgreSQL GL Projection (Read)")]
๐งช Verifiable Test Script (Human Review Flow)
Section titled โ๐งช Verifiable Test Script (Human Review Flow)โFollow these steps in the running Business M instance to replicate the live PoC demonstration:
- Perform Baseline Transaction: Create and submit a baseline Journal Entry. Verify that TigerBeetle and Postgres balances match exactly.
- โ Action: Submit Document
- Simulate Outbox Partition: Terminate the Finance outbox background worker (
SIGKILL) to simulate a catastrophic failure. - Process Offline Transaction: Submit a new Journal Entry. The transaction writes instantly to TigerBeetle (sync mode) but is queued in the Outbox for Postgres projection.
- โ Action: Submit Document
- Verify Imbalance: Check the ledgers. TigerBeetle reflects the updated balance immediately, while Postgres retains the delayed read-state.
- Restore & Recover: Restart the background worker. Verify that the Outbox drains instantly and both databases match perfectly, proving Zero Audit Trail Loss.