Component Decomposition and Responsibilities

Turning capabilities into logical components with clear ownership, a responsibility matrix, component contracts, and how to avoid building a distributed monolith.

  • Intermediate to advanced
  • About 15 minutes
  • Includes an exercise and a knowledge check

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.

On the left, a photo of a professional restaurant kitchen with chefs at separate stations under hanging lamps. On the right, each kitchen station is matched with a platform component. The ticket rail takes orders in and checks them: gateway and ingestion. The prep station cuts everything to one size: normalization. The cooking line turns ingredients into dishes: the reconciliation engine. The pass, where a chef checks every plate and sends problems back: exception management. The order book of what went out, when and by whom: audit and reporting. Separate stations, one kitchen.
A kitchen splits the work by responsibility, not by building. Clear ownership comes before any deployment decision.

The Apex design Eight logical components

ComponentResponsibilitiesMust not
A. API and integration gatewayReceive authenticated requests, validate their structure, apply rate limits, identify the integration and route itContain reconciliation rules
B. Payment ingestionReceive provider notifications, check required fields, verify signatures where supported, detect duplicates, store accepted records, publish eventsDecide whether a payment is reconciled
C. Settlement ingestionReceive settlement files or API records, validate file structure, track file processing, detect repeated files and records, record rejectionsChange settlement data
D. NormalizationConvert provider formats to one internal shape, standardize currency and timestamps, normalize references, keep the original, record validation failuresOverwrite the source data
E. Reconciliation engineFind candidate records, apply deterministic matching rules, set match status, flag unmatched and ambiguous records, keep the evidenceForce an ambiguous match
F. Exception managementCreate cases, assign them to authorized users, track progress, capture resolution decisions, enforce approvalsLet one person approve their own change
G. Audit and reportingKeep the audit history, expose transaction status, produce reconciliation summaries and reportsAllow edits to audit records
H. Notification and workflowAlert users about important exceptions, coordinate long-running steps, track retries and workflow stateLose an alert when delivery fails
The eight Apex components inside one dashed box labeled one deployment to start, a modular monolith. A, the API and integration gateway, routes to B, payment ingestion, and C, settlement ingestion; both feed D, normalization, then E, the reconciliation engine, then F, exception management. G, audit and reporting, records every state change; H, notification and workflow, handles long steps and alerts. Tags: B and C may separate later for bursty traffic or isolation; E may scale on its own later. Below, a distributed monolith, eight services each calling three others synchronously so one outage stops everything, compared with boundaries that earn their place: business capability, data ownership, change frequency, operational independence, scaling requirements and failure isolation.
Eight responsibilities can share one deployment. Split one out only when its scaling or isolation needs really differ.

Make ownership explicit The responsibility matrix

CapabilityPrimary ownerImportant dependency
Payment ingestionPayment ingestionIntegration gateway
Settlement ingestionSettlement ingestionFile or API source
NormalizationNormalizationIngestion records
MatchingReconciliation engineNormalized records
Exception creationException managementMatching result
ApprovalException managementIdentity and policy
Audit historyAudit capabilityAll state-changing operations
ReportingReporting capabilityReconciliation 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.

  1. Draw a component diagram.
  2. Write a responsibility matrix.
  3. Write the inputs and outputs of each component.
  4. List the components that should share a deployment at first.
  5. 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

1. Should every logical component become an independent microservice?
2. What is a distributed monolith?
3. Which component should contain the matching rules?
Answer every question to submit.

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.