The overall architecture
How do the building blocks work together on a booking?
We track a booking through the building blocks and then zoom into the rental API. The database maintains the binding state; a worker processes permanently stored follow-up orders in the background.
Starting point From Step 5: States, Transaction and Outbox keep R-17 locally consistent; external calls start only after commit.
Assumptions for the example case
Example design: an operator, specifically assigned vehicles, planned periods and a region. Figures are illustrative design assumptions, not company data.
Track R-17 through architecture
The rental API checks K-17 and stores the hold for R-17 together with the payment order in SQL. Only the commit makes both entries binding.
Local transaction ends hereThe emphasis follows the technical transitions: local data first becomes binding, then the worker continues to work, then the API reads the verified output.
Divide the rental API into technical components
Rental API
Domain modules with joint release
- Booking and use Permission
- Request the valid authorization via the module interface.
- Utilisation Settlement
- Passes confirmed usage times for completion.
SQL Relational Database
A commit confirms the business change and its subsequent order together.
Save results
The worker runs outside the rental API and calls providers for verification, payment, vehicle access and shipping. API and Worker are part of the backend; the domain modules use common rules and are published together.
Mapping domain responsibilities to runtime components
Further reading
| Overview of the subsystem | Technical implementation |
|---|---|
| Availability and Booking | Same-named domain module in the rental API; the SQL database stores the binding occupancy. |
| Identity verification | The Eligibility & Verification Status module manages validity and proofs. The worker connects the testing provider via an adapter. |
| Payment and settlement | Similar domain module for costs and payment status; the worker executes payment orders via a provider adapter. |
| Vehicle access | The Usage & Vehicle Access module checks the process and requests authorizations. The worker takes over the call of the access provider. |
| Notifications | Domain modules store notification jobs after state changes. The worker passes them to the notification adapter. |
Availability and Booking
- Technical implementation
- Same-named domain module in the rental API; the SQL database stores the binding occupancy.
Identity verification
- Technical implementation
- The Eligibility & Verification Status module manages validity and proofs. The worker connects the testing provider via an adapter.
Payment and settlement
- Technical implementation
- Similar domain module for costs and payment status; the worker executes payment orders via a provider adapter.
Vehicle access
- Technical implementation
- The Usage & Vehicle Access module checks the process and requests authorizations. The worker takes over the call of the access provider.
Notifications
- Technical implementation
- Domain modules store notification jobs after state changes. The worker passes them to the notification adapter.
Each domain module is responsible for its rules and data. Other modules use its agreed interface. The HTTP input accepts requests and translates results into API responses; the domain decisions remain in the responsible modules.
Connect booking changes and follow-up orders reliably
Further reading
- Run domain modules within a modular monolith
- Booking, authorization, use and billing remain separate responsibilities within the same application. They are jointly developed and published. The module boundaries facilitate changes, while calls within the API do not require an additional network connection. The worker uses the same business rules for processing in the background.
- Secure change and follow-up order in the transactional outbox
- A new hold and the subsequent payment release order are stored in the same SQL transaction. This commonly stored order table is the transactional outbox. A commit confirms both entries; a rollback discards both. Thus, after a process failure, it remains visible which subsequent orders still have to be executed.
- Execute stored orders outside of the API
- The worker reads confirmed outbox entries and calls external providers via adapters. It stores results and performs a comparison in the case of unclear outputs. A failure after the provider call can lead to a repetition; stable order keys and idempotency therefore protect against dual effects. Webhooks reach the responsible modules via the HTTP input of the rental API.
- Start with order table and worker
- This design uses the outbox principle for permanently stored follow-up orders and executes them directly via a worker. An additional communications broker is checked if a corresponding load or distribution requirement is met. In the classic outbox pattern, a forwarding process takes over the transfer to such an intermediary.
Terms in this step
- Modular monolith
- A jointly published application with clearly defined domain modules. In the rental API, booking, authorization, use and billing each assume their own rules and data.
- Transactional Outbox
- A domain change and its follow-up job are stored in a database transaction. Here, a worker reads the confirmed orders; their execution must safely handle repetitions.
Try it yourself
Assign these tasks: check authorization, permanently store R-17 and follow-up order, call the payment provider. Who continues the process after an API crash?
A hint for your attempt
Differentiate request processing, binding datastore and background work.
Compare with a possible solution
- Rental API
- It checks requests, authorizations and business rules and initiates the local transaction.
- SQL database
- It stores R-17 and follow-up orders together and protects the occupancy rule for competitors.
- Worker
- The worker reads the committed follow-up job and calls the provider with A-17. So the work remains findable after an API crash.
Apply to your project
Transfer the assignment to your own system and mark which module takes the next safe step in the event of a process failure.