Account model vs coin model
In the account model, each payment updates one balance row, so all payments for one merchant wait in line. In the coin model, each payment adds its own output, and writes do not conflict. At 4,000 payments/s to one merchant, the account model fails 79 percent. The coin model gives p99 26 ms.
Account model · writes that wait for one row: 1,500 more each second
Coin model · writes that wait for one row: 0 more each second
Case 1
Card payments settle into one merchant at 4,000 payments/s. p99 must stay below 100 ms. The merchant reads its balance 20 times/s and needs a value at most 5 s old.
| Measure | Goal | Account model, one balance row | Coin model, one output per payment |
|---|---|---|---|
| p99 latency (Payments) | under 100 ms | 10.1 s Fail | 26 ms Pass |
| Error rate (Payments) | under 0.1% | 79% Fail | 0% Pass |
| Data age | under 5 s | 0 ms Pass | 1 s Pass |
| Monthly cost | 16 USD/mo | 16 USD/mo |