Choose the Right Application Architecture

Monolith, modular monolith or microservices: what each really costs, how to draw service boundaries, when microservices are justified, and a gradual path for Apex.

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

The concept The question is asked too early

Should we use a monolith or microservices? is usually asked before anyone understands the boundaries, the teams, the workload, release needs or operational skills. Understand those first.

Three architectures as three buildings. Monolith, a single house: payment, settlement, matching, exceptions and audit in one space with tangled red connections; simple to run, easy to tangle. Modular monolith, an apartment building: separate flats for payment, settlement, matching and exceptions, each with its own data and rules behind a clear door; still one building and one deployment. Microservices, a village: separate houses linked by dashed roads for network calls and events, with more to run.
House, apartment building, village. Microservices do not remove complexity; they move it into the distributed system.

Side by side What each architecture costs

FactorMonolithModular monolithMicroservices
DeploymentOne applicationOne applicationMany services
Internal boundariesCan be weakExplicit modulesService boundaries
Independent scalingLimitedLimitedPossible
Distributed-system complexityLowerLowerHigher
Operational overheadLowerLower to mediumHigher
Independent releaseLimitedLimitedPossible
Team ownershipSharedBy moduleBy service

Boundaries Draw boundaries around business capabilities

A good boundary follows a business capability with a clear owner. Payment ingestion receives and validates payment information. Reconciliation matches payments and settlements under approved rules. Exception management tracks investigation and resolution. Never create a service for every table or every small method.

Introduce microservices when evidence showsAvoid them merely because
Capabilities need independent deploymentThe company is growing
Workloads scale very differentlyThe application is old
Teams need independent ownershipThe customer asked for modern architecture
Deployment coupling causes measured delivery problemsA conference recommended it
Failure isolation has business value, and the organization can run distributed systemsSomeone wants to use Kubernetes

Apply it A gradual path for Apex

This is a hypothetical scenario, not the Module 04 findings. Suppose a deeper investigation found matching rules buried in a large legacy application, frequent changes to exception handling, payment ingestion with different scaling needs, and a team with little experience running distributed services. None of these has been confirmed at Apex yet. If they were, a sensible path would be:

A staircase of five steps for Apex instead of one redesign: 1 fix transaction integrity controls; 2 separate business modules inside the application; 3 extract payment ingestion only if scaling or ownership justifies it; 4 keep reconciliation rules in one owned capability; 5 add services only when measured needs support them. Rule for every step: prove its value with measured results before taking the next one.
Evolve in steps, not leaps. Each step is useful on its own and must earn the next.

Practice Justify, or not, a service

Practical exercise

Should exception management be its own service?

Exception handling changes every two weeks at Apex, while matching rules change twice a year.

  1. Write the argument for a separate service.
  2. Write the argument for a module inside the existing application.
  3. Name the evidence that would decide it.
Show a sample answer
  • For a service: it changes far more often, so independent releases would stop it waiting on the slow-moving matching code.
  • For a module: the team has little distributed experience, and a clean module with its own tests can also be released safely.
  • Deciding evidence: whether releases of the whole application are actually blocked or risky today, and whether the team can run another deployment with monitoring.

3 questions

Check your understanding

1. What complexity do microservices add?
2. What is a modular monolith?
3. Which is a good reason to extract a service?
Answer every question to submit.

What you can do now

  • Compare monolith, modular monolith and microservices honestly.
  • Draw boundaries around business capabilities.
  • Recognize good and bad reasons for microservices.
  • Plan a gradual architecture evolution.