Volume 7 · Chapter 11 — Microservices and System Design
Choosing Compute and Integration Patterns
11.1 Introduction
A large part of the architect exams is choosing the right building block for a requirement - which compute model, which integration style, which decoupling mechanism. This chapter consolidates the decision frameworks that recur across the series into explicit guidance, because the exam is fundamentally a series of “which service fits this scenario?” judgments.
11.2 Choosing a Compute Model
The compute decision follows the workload’s characteristics.**Lambda (serverless)**for event-driven, spiky, or intermittent work where you want zero idle cost and no servers - but not for long-running (>15 min) or steady ultra-high-throughput/latency-critical paths sensitive to cold starts.**Fargate (serverless containers)**for containerized workloads without managing servers - the default for microservices when you want containers without node management.ECS/EKS on EC2when you need host control, specific instance types (GPU), or cost efficiency at large scale.EC2directly when you need full OS control or to run software that expects a VM.Batchfor large batch jobs;Beanstalk/App Runnerfor simple managed app/web deployment. The exam mapping: event-driven → Lambda; containers without ops → Fargate; container control/scale → ECS/EKS on EC2; OS control → EC2; batch → Batch.
flowchart TD
Q{Workload?} -->|Event-driven, spiky, scale-to-zero| L[Lambda]
Q -->|Containers, no server mgmt| F[Fargate]
Q -->|Containers, host control/scale| E[ECS/EKS on EC2]
Q -->|OS control / legacy VM| EC2[EC2]
Q -->|Large batch jobs| B[Batch]
Q -->|Simple managed web app| BA[Beanstalk / App Runner] 11.3 Choosing an Integration Style
How components communicate is a design decision.Synchronous(API Gateway/ALB → compute) when the caller needs an immediate response - but it couples availability, so protect it with resilience patterns.**Asynchronous via a queue (SQS)**when you want to decouple, load-level bursts, and process work reliably by one consumer - the default for offloading work from the request path.**Pub/sub (SNS/EventBridge)**when one event must reach many consumers (fan-out) or you need content-based routing and integration.**Streaming (Kinesis)**for continuous, ordered, multi-consumer, replayable data.**Orchestration (Step Functions)**for complex multi-step workflows with error handling. The exam pattern: pick the integration by whether you need an immediate response, decoupling/load-leveling, fan-out, continuous streaming, or workflow orchestration.
11.4 Decoupling for Scale and Resilience
A recurring exam theme isdecouplingto improve scalability and resilience. Inserting a queue between tiers means a burst is absorbed and a slow or failed downstream doesn’t back-pressure or fail the upstream - components scale and fail independently. Using a load balancer decouples clients from specific instances. Using events decouples producers from consumers. The design instinct the exam rewards: identify tight synchronous coupling that limits scale or propagates failure, and decouple it with a queue, a load balancer, or events - so components are independent, bursts are absorbed, and failures are contained. This is the “how would you make this more scalable/resilient?” answer.
11.5 Matching Databases and Storage (Recap)
Completing the decision toolkit, recall the data choices: relational (RDS/Aurora) for complex queries and ACID; DynamoDB for key-value at massive scale; S3 for objects/data lake; ElastiCache/DAX for caching; Redshift for analytics; and the purpose-built engines (Neptune, Timestream, QLDB) for graph/time-series/ledger. Match each workload’s data model and access pattern to the right store rather than forcing one database. Combined with the compute and integration frameworks, this gives a complete method: for any requirement, choose the compute model, the integration style, the decoupling mechanism, and the data store that fit - which is exactly the reasoning the architect exams assess scenario by scenario.
11.6 Banking Production Scenario
A bank applies these frameworks per workload. Event-driven document processing runs on Lambda; the microservice core runs on Fargate; a GPU risk model runs on ECS on EC2; and overnight jobs run on Batch. Customer-facing reads are synchronous through API Gateway, but payment side-effects are decoupled via SQS (load-leveling) and SNS fan-out, with Step Functions orchestrating the multi-step saga and Kinesis streaming the transaction feed for fraud analytics. Tight synchronous couplings that limited scale were replaced with queues and events so tiers scale and fail independently. Data maps to Aurora (ledger), DynamoDB (sessions), S3 (documents), Redshift (analytics), and QLDB (audit). This deliberate, per-requirement selection across compute, integration, and data is precisely the professional-level design judgment the certification measures.
11.7 Chapter Revision Notes
- Compute: Lambda (event-driven/spiky), Fargate (containers, no ops), ECS/EKS on EC2 (host control/scale), EC2 (OS control), Batch (jobs), Beanstalk/App Runner (simple managed).
- Integration: synchronous (immediate response, protect with resilience), SQS (decouple/load-level/one consumer), SNS/EventBridge (fan-out/routing), Kinesis (streaming), Step Functions (orchestration).
- Decouple tight synchronous coupling with queues, load balancers, or events so components scale and fail independently and bursts are absorbed.
- Data: RDS/Aurora (relational/ACID), DynamoDB (key-value scale), S3 (objects), ElastiCache/DAX (cache), Redshift (analytics), purpose-built (graph/time-series/ledger).
- Method: for each requirement choose compute model + integration style + decoupling + data store that fit - the core of architect exam reasoning.