The concept From capabilities to components
A component is a logical part of the system responsible for one defined capability. Payment ingestion receives and validates external information; transaction matching compares normalized records. They are different jobs. Putting every job into one large component makes the system hard to understand, test and change. Creating many tiny services brings network calls, deployments and debugging pain. The goal is not maximum decomposition. The goal is clear ownership.
The Apex design Eight logical components
| Component | Responsibilities | Must not |
|---|---|---|
| A. API and integration gateway | Receive authenticated requests, validate their structure, apply rate limits, identify the integration and route it | Contain reconciliation rules |
| B. Payment ingestion | Receive provider notifications, check required fields, verify signatures where supported, detect duplicates, store accepted records, publish events | Decide whether a payment is reconciled |
| C. Settlement ingestion | Receive settlement files or API records, validate file structure, track file processing, detect repeated files and records, record rejections | Change settlement data |
| D. Normalization | Convert provider formats to one internal shape, standardize currency and timestamps, normalize references, keep the original, record validation failures | Overwrite the source data |
| E. Reconciliation engine | Find candidate records, apply deterministic matching rules, set match status, flag unmatched and ambiguous records, keep the evidence | Force an ambiguous match |
| F. Exception management | Create cases, assign them to authorized users, track progress, capture resolution decisions, enforce approvals | Let one person approve their own change |
| G. Audit and reporting | Keep the audit history, expose transaction status, produce reconciliation summaries and reports | Allow edits to audit records |
| H. Notification and workflow | Alert users about important exceptions, coordinate long-running steps, track retries and workflow state | Lose an alert when delivery fails |
Make ownership explicit The responsibility matrix
| Capability | Primary owner | Important dependency |
|---|---|---|
| Payment ingestion | Payment ingestion | Integration gateway |
| Settlement ingestion | Settlement ingestion | File or API source |
| Normalization | Normalization | Ingestion records |
| Matching | Reconciliation engine | Normalized records |
| Exception creation | Exception management | Matching result |
| Approval | Exception management | Identity and policy |
| Audit history | Audit capability | All state-changing operations |
| Reporting | Reporting capability | Reconciliation data |
The matrix does not mean each row becomes a separate deployment. It defines responsibility first.
Between the parts Component contracts
Every component exposes a clear contract. Payment ingestion receives a notification and returns accepted or rejected. The reconciliation engine receives normalized records and produces matching outcomes. Exception management receives an unresolved result and creates a case. Each contract states:
- Input and output: what goes in and what comes back.
- Validation rules: what makes an input acceptable.
- Failure behavior: what happens when something goes wrong.
- Data ownership: which records this component may change.
- Expected timing: immediate, within minutes, or by a deadline.
A common trap Avoid the accidental distributed monolith
Suppose you create eight microservices and each calls three others synchronously. One transaction now depends on many network calls, and if one service is down the whole workflow stops. You have distributed deployment without real independence. Draw boundaries from business capability, data ownership, change frequency, operational independence, scaling needs and failure isolation instead.
Practice Decompose the platform
Practical exercise
Exercise 02: the logical component architecture
Take the Apex capabilities from Lesson 01 and turn them into components.
- Draw a component diagram.
- Write a responsibility matrix.
- Write the inputs and outputs of each component.
- List the components that should share a deployment at first.
- List the components that may need independent scaling later, and why.
Show sample answers
- Share a deployment at first: all eight, as modules of one application with clear internal interfaces.
- May scale independently later: payment ingestion, if provider bursts or retries need isolation from matching; the reconciliation engine, if matching runs grow with volume.
- Normalization inputs and outputs: in, an accepted source record; out, a normalized record plus validation failures; never changes the source record.
3 questions
Check your understanding
What you can do now
- Turn capabilities into components with one clear job each.
- Write a responsibility matrix and component contracts.
- Explain why a modular monolith can be the right start.
- Recognize and avoid a distributed monolith.
← Lesson 01: From Business Requirements to System Boundaries