Commit 8dd87532 authored by joubran.mansour's avatar joubran.mansour

docs: rewrite README

parent 49b26767
# Fault-Tolerant Distributed Banking Transaction
## Problem
An Order Service (client) sends an HTTP request to a Billing Service (server)
to debit an amount from a user's account. The connection may drop, or the server
may crash before replying, or right after committing the debit but before the
client receives the response.
## Goal
Guarantee effectively-once execution: a transaction must never be lost and
never applied twice.
## Stakeholder requirements
1. At-least-once delivery: client retries with timeout + exponential backoff.
2. Artificial idempotency: each new transaction carries a monotonically
increasing sequence key, plus a boolean `retry_is` flag. Retries reuse the same key.
3. Atomicity: the server checks `key_sequence_last` for the account and, in ONE
atomic transaction, debits the balance and updates `key_sequence_last`.
If the key equals the last executed key, skip the debit and return the success ack.
4. Fault injector (configurable) for 4 scenarios:
(a) request never arrives
(b) server crashes before executing
(c) executed + persisted, but response fails to reach the client
(d) server responds after the client timeout
5. Automated tests for happy path AND all four failure scenarios.
## Process constraint
Spec-Driven Development: constitution -> spec -> plan -> tasks -> implement.
No source code may be written before the spec and plan exist.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment