System Design Atlas

Property rentals and service charge statements

10 / 10Worked example

Final design

How can “the first end-to-end path ends with comprehensible settlement” be proven in the specific case?

A document-only demo would leave out contention and settlement.

Starting point From 60 seconds, property management tracks the existing command in an investigation list.

Assumptions for the example case

Fictitious design for a house, a completed annual period and a contractually specified area key. The application documents released billings and correction versions; the legal examination of individual costs remains with property management. All quantities, thresholds and operational targets are illustrative assumptions. The signed amount due equals the allocated cost share minus advance payments already accounted for. A separate immutable payment ledger records only additional positive payments received later. Outstanding balance = current amount due minus the sum of these additional payments. A positive balance is the remaining amount due, zero means settled, and a negative balance is a credit equal to its absolute value. Corrections replace the amount due, retain all payments and post only the difference from the previous amount due. They remain permitted after settlement and for credit balances. Actual positive payments are accepted and deduplicated even when they exceed the remaining amount due or arrive after settlement. Advance payments are not counted again in the additional ledger. Refunds are outside this case; a credit documents a balance and does not receivable a payout.

Check marker settlement

Runtime architecture · manage the document and receivable together

  1. 1 · Check receipts and keys
  2. 2 · Document + Claim commits
  3. 3 · Delivering the document
  4. 4 · Balance payment
Tenant portal / property management interfaceRead and approve
Payment importDeliver payments to the API

Billing system

Settlement APIRelease, access and internal payment reconciliation
Relational datastoreVersion, manifest, claim and inbox table
Document storeImmutable documents
Delivery workerCommitted delivery requests
Delivery serviceExternal transmission status
Tenant portal / property management interface → Settlement APIRead / Approve
Settlement API → Relational datastoreAtomic manifest + receivable
Settlement API → Document storeImmutable documents
Relational datastore → Delivery workerCommitted delivery request
Delivery worker → Delivery serviceSend document version
Delivery service → Settlement APIAuthenticated version proof
Settlement API → Relational datastoreInbox table commit, then confirm
Payment import → Settlement APIPayment + Reference
Settlement API → Relational datastoreInternally reconciled amount
Document output · Version and receipts Outflow of funds · Claim and payments
Concurrencyon the stock · Step 4 / 5
Document rightsat the receipt access · Step 9
Settlementon the payment import · Step 5 / 10

Approval writes the manifest and receivable atomically. Delivery and payment import follow separate, documented paths.

The topology from step 6 remains unchanged. Mark contention at the data store, document permissions at document access, and reconciliation at payment import; return links point to steps 4, 5 and 9.

Test plan with expected outcomes

Input and initial stateExpected resultReturn to an earlier step
A-39 ready for review, version=3 → Release X and correction Y each with expected=3 in order X/Y and Y/XExactly one commit on version 4; the loser gets conflict; receivable corresponds to the winner.Step 4 and 5
Release X with 2,000 cents committed → repeat X identically; then send X with 2,001 centsIdentical response and one receivable; altered repetition of conflict without writing effect.Step 4
Delivery request starts at t=0 ms → t=59,999, 60,000, 60,001 msClarification list only from 60,000 ms; no automatic delivery confirmation.Step 9
Receivable=2,000 cents, paid=1,999 cents → Payment of 1 cent with the same payment reference import twiceExactly 2,000 cents allocated; state balanced; second delivery ineffective.Step 5 and 10
Amount due 2,000, additional payments 1,000; correction to Amount due 2,100 centsPayment ledger still 1,000; remaining receivable 1,100 centsStep 5
Amount due 2,000, additional payments 2,000; correction to 2,100, then 1,500 centsFirst 100 cents remain due, then a credit of 500 cents; payments remain 2,000Step 5
Amount due 0, additional payments 0; then amount due −500 centsInitially settled without a payment import; then a credit of 500 centsSteps 2 and 5
Amount due 2,000; payment 2,500 cents; repeat the same import; further payment 100 centsInitially a credit of 500, unchanged on replay, then a credit of 600 cents; ledger total 2,600 centsStep 4 and 5

A-39 ready for review, version=3 → Release X and correction Y each with expected=3 in order X/Y and Y/X

Expected result
Exactly one commit on version 4; the loser gets conflict; receivable corresponds to the winner.
Return to an earlier step
Step 4 and 5

Release X with 2,000 cents committed → repeat X identically; then send X with 2,001 cents

Expected result
Identical response and one receivable; altered repetition of conflict without writing effect.
Return to an earlier step
Step 4

Delivery request starts at t=0 ms → t=59,999, 60,000, 60,001 ms

Expected result
Clarification list only from 60,000 ms; no automatic delivery confirmation.
Return to an earlier step
Step 9

Receivable=2,000 cents, paid=1,999 cents → Payment of 1 cent with the same payment reference import twice

Expected result
Exactly 2,000 cents allocated; state balanced; second delivery ineffective.
Return to an earlier step
Step 5 and 10

Amount due 2,000, additional payments 1,000; correction to Amount due 2,100 cents

Expected result
Payment ledger still 1,000; remaining receivable 1,100 cents
Return to an earlier step
Step 5

Amount due 2,000, additional payments 2,000; correction to 2,100, then 1,500 cents

Expected result
First 100 cents remain due, then a credit of 500 cents; payments remain 2,000
Return to an earlier step
Step 5

Amount due 0, additional payments 0; then amount due −500 cents

Expected result
Initially settled without a payment import; then a credit of 500 cents
Return to an earlier step
Steps 2 and 5

Amount due 2,000; payment 2,500 cents; repeat the same import; further payment 100 cents

Expected result
Initially a credit of 500, unchanged on replay, then a credit of 600 cents; ledger total 2,600 cents
Return to an earlier step
Step 4 and 5

End-to-end test and unresolved agreements

First end-to-end path
Calculate A-39, test release against parallel correction, lose response, repeat identically, deliver document and balance 2,000 cents in two payments.
Clarify before real use
Before real use, domain specialists must check which costs may be allocated, deadlines, document-inspection rights, retention and correction procedures for the jurisdiction and contract. This example does not perform an operational legal review.

The first end-to-end test ends with traceable reconciliation.

The first end-to-end test ends with traceable reconciliation.

Test approval, response loss, delivery and partial payments together.

A document-only demo would leave out contention and settlement.

Concurrency testing belongs to API and data store and leads back to step 5 in case of errors; exactly one version wins. Double payment import belongs to the reconciliation and leads back to step 4; one cent acts once and reaches the settlement.

Alternative considered
A portal showing an example amount does not demonstrate an immutable receivable.
Trade-off
The first end-to-end path requires simulated external feedback.
Reassess
Extend to further allocation keys after the counterexample tests pass.

Try it yourself

Assign each of three checks to its responsible component and the design step to revisit: competing approvals, correction after settlement, and delivery without evidence. State each expected outcome.

A hint for your attempt

Track the released settlement up to the proven result; note the return to the causing decision.

Compare with a possible solution
Release and correction
The API and relational data store allow exactly one winner for the same version; failures return to step 5. A correction after settlement retains all payments: an amount due of 2,100 against payments of 2,000 leaves 100 due; an amount due of 1,500 creates a credit of 500. Failures also return to step 5.
Notification
The worker and property management investigation list keep delivery open until evidence for the correct document version arrives. The timer opens an investigation at 60 seconds without receivableing delivery success; failures return to step 4 or 9.

Apply to your project

What decision do you need in your project for the first complete end-to-end path?

Transfer the decisions and their counterexamples to the editable design template.

Start your own design

Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.

Download design template (.md)
Compare the ten tasks with the example case
  1. Purpose and boundary

    Which corresponding decision do you need in your project for the limit of the commitment?

    In the example: Approval binds the evidence manifest, allocation keys and receivable to one shared version.

  2. Requirements

    Which corresponding decision do you need in your project for a permanently applicable domain rule?

    In the example: Integer amounts in cents and a fixed remainder-allocation rule preserve equal totals.

  3. Scale estimates

    What decision do you need in your project for the strongest local contention?

    In the example: Test peak load separately from two competing approvals of the same statement.

  4. Interfaces

    What decision do you need in your project for a repeated assignment?

    In the example: Store the command key and normalised input hash with the result.

  5. Data and states

    Which corresponding decision do you need in your project for an documented final state?

    In the example: Version the amounts due; preserve additional payments with stable references in one continuous ledger.

  6. Overall architecture

    What decision do you need in your project for leading and derived data?

    In the example: A delivery worker processes durably stored commands outside the approval transaction.

  7. Critical flow

    What decision do you need in your project for a crash after commit?

    In the example: The repeated call reads the stored approval result.

  8. Bottlenecks and trade-offs

    What decision do you need in your project for a measurable scaling limit?

    In the example: The application calculates in advance and checks the manifest hash and version at commit time.

  9. Operations and security

    Which corresponding decision do you need in your project for the role with final responsibility?

    In the example: From 60 seconds, property management tracks the existing command in an investigation list.

  10. Final design

    What decision do you need in your project for the first complete end-to-end path?

    In the example: Test approval, response loss, delivery and partial payments together.