Practical System Design

Book labs · Lesson 2 of 2 · 15 min

Chapter 3, a late charge.

The provider answers after the client has stopped

1 of 3

The client stopped waiting

The provider may still settle the charge. The timeout is not the provider’s outcome.

t = 0.00s · seed 3

checkoutchargenew idoffnotify

Client

Waiting to send

Checkout

Each try is a new charge

Provider

Next charge 400 ms

Operation

No shared identity

Outbox

Off

Notify

0 lost

payment-authorizations

  1. client_timeout_ms = provider_ms =
  2. POST /v1/orders/4471/payment-authorizations
  3. Idempotency-Key: checkout-4471-attempt-1
  4. reuse_operation_id =
  5. CREATE UNIQUE INDEX one_active_authorization_per_order
  6. ON payment_operations (order_id)
  7. WHERE operation_type = 'authorize'
  8. outbox_with_charge =
  1. This attemptThe retry is a new operation id.
  2. LedgerUnique 0. Duplicate 0. Unresolved 0.
  3. NotificationWritten with the charge, or still waiting on it.

Live metrics

The next checkout has not been sent.

Checkouts sent
0
Unique charges
0
Duplicate charges
0
Unresolved
0
Lost notifications
0
Clean streak
0

Ledger

Recent checkouts. The totals above are the whole run, and the challenge scores the clean streak.

Recent checkouts from this run
CheckoutOperationChargesClientNotification
No checkout has been sent.

1 of 5

The client timeout left the outcome unknown. The provider still settled the first charge.

Which call made playback slow