System Design Atlas

Property rentals and service charge statements

06 / 10Worked example

The overall architecture

How can “The shipment runs behind the approval commit” be proven in the specific case?

Delivery services can be slow while local releases continue to run.

Starting point Version the amounts due; preserve additional payments with stable references in one continuous ledger.

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.

Guide document and receivable together

Runtime architecture · manage the document and receivable together

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

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

API and inventory within system boundary, document storage next to it; delivery worker via external border to delivery service; payment import as own receipt.

Responsibilities within the application

Billing API open · Professional cooperation

Process framework · Billing API

LeasesTracks areas and validity
Cost allocationassigns supporting documents and keys
Statement approvalFreezes manifest and receivable atomically
Access to documentsProvides approved versions
Payment reconciliationAllocate payments and differences
Mietverhältnisse → KostenverteilungArea + period
Kostenverteilung → AbrechnungsfreigabeVerified manifest
Abrechnungsfreigabe → BelegzugangReleased version
Abrechnungsfreigabe → ZahlungsabgleichReceivable

Only the billing release writes document manifest and claim together; the remaining modules work on local contracts.

Internal modules: Tenancies track dwelling areas and validity periods. Cost allocation assigns supporting documents and allocation keys to a period. Statement approval freezes the calculation state and receivable atomically. Document access provides approved document versions. Payment reconciliation links payments to receivables and resolves differences. The overall architecture assigns these responsibilities to runtime processes and storage.

Runtime components and authoritative data

Runtime boundary
Tenant portal and property management interface → Billing API → relational data store. API → document store for immutable documents. A delivery worker reads committed delivery requests and sends them → external delivery service; its evidence → inbox → data store. Payment import → payment reconciliation → data store. Documents and monetary balance remain separate outputs.
Module responsibilities
Tenancies: Tracks dwelling areas and validity periods.; Cost allocation: Assigns receipts and allocation keys to a period.; Statement approval: Freezes calculation status and receivable atomically.; Access to receipts: Provides approved document versions.; Payment reconciliation: Connects payment and receivable with differences.

Delivery follows the approval commit.

Delivery follows the approval commit.

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

Delivery services can be slow while local releases continue to run.

The API is responsible for the shared local decision; the worker handles transport and reconciliation. The document store holds immutable files, while the relational data store connects permissions, the manifest, and the receivable.

Alternative considered
External shipping within a database lock blocks further processing.
Trade-off
Delivery status and approval status may be temporarily separated.
Reassess
A separate document inventory is scaled independently only when load measurements justify it.

Try it yourself

Sketch the path of a release up to the delivery service. Mark the common commit and assign document storage, relational data store and worker to their responsibilities.

A hint for your attempt

Track the released billing up to the documented result; observe the boundary to the external system.

Compare with a possible solution
Local Commit
The API writes document manifest, amount due and delivery request together in the relational data store. The document store holds the immutable document bytes; their hash connects them to the manifest.
External service
The worker only reads committed delivery requests and transmits them to the external delivery service. Its proof is permanently assigned to the correct document status; a shipping error does not change the amount due.

Apply to your project

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

Step 7: How can “A lost response does not generate a second receivable” be proven in the specific case?