Application architecture · Modernisation lab
Order Processing
Modernisation.
Establishing how a synchronous order API responds to a slow dependency, then evaluating an event-driven alternative against the measured baseline.
Status: Synchronous baseline complete. Event-driven implementation pending.
01 · Problem
Dependency delays affect the caller.
This lab investigates an order-processing flow in which email processing remains on the synchronous request path. The baseline varies simulated email delay and measures the API response time experienced by the client.
02 · Requirements and decisions
Measure before changing the design.
- Record the existing behaviour before modernisation.
- Measure the effect of simulated email latency on API responses.
- Preserve the baseline for comparison with an asynchronous design.
- Record trade-offs and test limitations alongside the results.
The baseline retains synchronous processing so the effect of dependency delay can be observed directly. An asynchronous alternative will be evaluated in a later phase.
Business acceptance targets and detailed architecture diagrams will be added as the project develops.
03 · Implementation and testing
A controlled local baseline.
- Node.js/Express API running locally on a PC.
- Requests sent sequentially from Postman.
- 30 requests: five at each of six simulated email delays.
- Response time and HTTP status recorded in CSV.
- Aggregate results retained in a JSON summary.
These tests examine response latency with one request at a time. They do not measure concurrent-load capacity.
04 · Measured outcomes
Response time tracks email delay.
| Simulated email delay | Average API response time |
|---|---|
| 100 ms | 934 ms |
| 300 ms | 1,124 ms |
| 500 ms | 1,323 ms |
| 1,000 ms | 1,828 ms |
| 2,000 ms | 2,829 ms |
| 5,000 ms | 5,823 ms |
All 30 requests returned HTTP 200. Across this test mix, average response time was 2,310 ms and the maximum was 5,828 ms. Displayed averages are rounded to the nearest millisecond.
Increasing simulated email delay from 100 ms to 5,000 ms increased average API response time by approximately 4,888 ms. This is consistent with email processing remaining on the synchronous request path.
HTTP 200 confirms the recorded API status; it does not independently verify email delivery or order correctness.
05 · Lessons and next steps
Evaluate decoupling against this baseline.
The results provide a reason to investigate moving email work out of the request path. The next phase will evaluate an Amazon SQS-based design.
The comparison must distinguish API acknowledgement latency from end-to-end processing time. It must also examine failure handling, retries, duplicate processing and operational visibility.
Limitations
- Small sample: five observations per delay setting.
- Local execution with simulated email latency.
- No concurrent-load or failure-recovery evidence in this dataset.
- No asynchronous performance improvement has yet been measured.