CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
  • Week 1
    • 1.The Game Called the SAP Exam: Hands-On Techniques for Decomposing Scenarios
    • 2.IAM, STS, and Federation: Splitting the Word "Permission" into Six Layers
    • 3.The Anatomy of a VPC: What Route Tables Really Decide
    • 4.Four Compute Pillars in Depth: Revisiting Nitro, EBS, ELB, and Auto Scaling Through a Pro Lens
    • 5.Week 1 Integration: When IAM, VPC, and EC2 Meet in a Single Scenario
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
  • Week 13
    • 1.Well-Architected Framework Overview — The Origins of 6 Pillars, Internal Operations of WA Tool, and Design Philosophy of Lens
    • 2.Operational Excellence & Security Pillars Deep Dive — GitOps Roots, Shared Responsibility Model Boundaries, Three Types of Traceability Internals
    • 3.Reliability & Performance Efficiency Pillars Deep Dive — CAP Theorem, Idempotency and Retry Mathematics, HPC Networking Physics
    • 4.Cost & Sustainability Pillars Deep Dive — Unit Economics, Regulatory Roots of Carbon Accounting, Trade-Offs Between Two Pillars
    • 5.Well-Architected Comprehensive Review: Distilling Six Pillars Into One Scenario
  • Week 14
  • Week 15
  • Week 16
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← SAP-C02/Week 13/Day 3

Based on the SAP-C02 exam guide·Report an error

SAP-C02· ProWeek 13 · Day 3~35 min read

Day 3 - Reliability & Performance Efficiency Pillars Deep Dive — CAP Theorem, Idempotency and Retry Mathematics, HPC Networking Physics

There is one unavoidable truth in distributed systems: Networks always break, nodes always die, and messages always get duplicated or disappear. Reliability (Stability) is the pillar that doesn't deny this truth but accepts and designs for it. Performance Efficiency is the pillar of processing faster and more efficiently with the same resources. The two pillars frequently conflict — sync replication across all regions for strong consistency improves reliability but degrades latency (performance). A pro architect's job is deciding where to cut this trade-off.

In SAP-C02, these two pillars appear with keywords like "RTO 5 minutes, RPO 1 minute," "ultra-low inter-node latency HPC," "message inflow faster than consumer," "global caching." Today we decompose distributed systems theory from the roots: CAP theorem and PACELC, the mathematics of idempotency and retries, principles of caching layers, and the physics of HPC networking.

Reliability — Design Assuming Failures

The five design principles of Reliability stem from one assumption: "failures happen." Auto-recovery, test recovery procedures, horizontal scaling, capacity measurement via monitoring (not guessing), automate changes. The key is the third and second principles. Horizontal scale-out (scale-out) eliminates single points of failure, and testing recovery procedures acknowledges the difference between "backup exists" and "recovery actually works."

PatternToolWhen Applied
Multi-AZALB, RDS Multi-AZ, EFS, DynamoDBGuard against single-AZ failure (sync replication)
Multi-RegionAurora Global, DynamoDB Global Table, Route 53, S3 CRRGuard against region failure, low RTO/RPO
Auto ScalingASG, Application Auto Scaling, KarpenterAdapt to load changes
Health CheckRoute 53, ELB, app-levelAuto-exclude unhealthy nodes
Retry + Backoff + JitterBuilt into SDKsAbsorb transient failures
Queuing + DecouplingSQS, SNS, KinesisDecouple components, buffer
Backup + DRAWS Backup, MGN, DRSRecover data and systems
Chaos TestingFISVerify recovery procedures

💡 Related Theory: Behind Multi-AZ vs Multi-Region choice lies CAP Theorem (Brewer, 2000). CAP states: "When network partitioning occurs, you can only choose between Consistency and Availability." RDS Multi-AZ uses sync replication for strong consistency (CP)—the standby is always current, but if one AZ is cut off, there's brief unavailability during failover. DynamoDB Global Table chooses availability (AP)—all regions accept writes, but tolerates temporary inconsistency via last-writer-wins. In exams, "all regions write simultaneously + always available" is an AP (DynamoDB Global) signal; "always latest data guaranteed" is a CP (sync replication) signal.

🔍 Deeper Dive: CAP is incomplete because it says nothing about "when there's no partition." PACELC Theorem (Abadi, 2012) supplements it: "Partition means choose A or C, Else choose between Latency and Consistency." Even in normal operation, strong consistency requires tolerating latency via sync replication. Aurora Global Database advertises "sub-1-second RPO + sub-1-minute recovery" but uses async replication—this is the EL trade-off of PACELC. Syncing all regions would spike latency, so it accepts async replication to reduce latency instead, tolerating a sub-1-second data loss window. In exams, when RPO is "sub-1-second, not 0," you recognize async replication (Aurora Global).

📚 Case Study: The February 2017 AWS S3 us-east-1 massive outage started when an engineer mistyped a command during debugging, shutting down more servers than intended. Countless services depending on S3 (even AWS's own status dashboard) went down simultaneously. Two lessons emerged: (1) Architecture depending solely on us-east-1 collapses entirely on that region's failure (Multi-Region necessity), (2) if operational tools are bound to a single region, you can't respond during an outage (control plane independence). Afterward, many organizations redesigned critical workloads to Multi-Region and status dashboards to region-independent architectures.

📚 Case Study: During the October 2012 AWS EBS us-east-1 outage, Netflix was barely affected—notable because it had built a chaos engineering culture that same year. The secret: Chaos Monkey randomly killed instances to eliminate single points of failure, and deployed workloads stateless across multiple AZs so one AZ or component dying was auto-bypassed. Lesson: Reliability isn't ensured by responding after failures—it's ensured by regularly injecting failures to validate beforehand. AWS absorbed this philosophy into FIS (Fault Injection Simulator). "Backup exists" differs from "recovery actually works"—this is Reliability's essence.

💡 Related Theory: The four DR strategies are a spectrum of RTO/RPO and cost trade-offs — Backup/Restore (RTO hours, lowest cost) → Pilot Light (minimal active resources) → Warm Standby (scaled-down always-active) → Multi-Site Active-Active (full redundancy, RTO ~0, highest cost). Shorter RTO/RPO means more always-on resources, raising costs. In exams, "RTO in minutes" signals Warm Standby or better; "RTO hours + lowest cost" signals Backup/Restore. This spectrum is a key collision point between Reliability and Cost pillars.

Idempotency and Retry — The Mathematics of Stability

Retry is basic to Reliability, but done wrong, it amplifies failures. Two concepts must be precise.

Idempotency: Executing the same request multiple times produces the same result as executing once. When a network timeout leaves "was the request processed?" unknown, safe retry requires idempotent operations. Non-idempotent operations like payments add an idempotency key—the server filters duplicates. SQS FIFO's message deduplication ID and Lambda's idempotent processing follow the same idea.

Exponential Backoff with Jitter: When all clients retry simultaneously on failure, a retry storm can collapse the server right before recovery (thundering herd). Backoff increases retry intervals exponentially (1s→2s→4s→8s) to spread load. Jitter adds randomness so clients don't spike simultaneously.

💡 Related Theory: Jitter's effect is explained by probability. Without jitter, backoff alone synchronizes all clients' retry times—causing load spikes at 1s, 2s, 4s moments. Adding jitter distributes retry times uniformly across [0, backoff] interval, flattening load over time. AWS Architecture Blog's "Exponential Backoff And Jitter" showed via simulation that full jitter (random(0, base*2^n)) minimizes both retry count and server load. This is why AWS SDK defaults include jitter. In exams, "simultaneous retry overload" points toward backoff + jitter.

⚠️ Pitfall: In a "messages arrive faster than consumer can process" scenario, choosing sync calls (direct Lambda invocation, etc.) is wrong. Producer-consumer speed mismatch must use queue (SQS) buffering to absorb backpressure—the consumer polls at its own pace, and failed messages route to DLQ (Dead Letter Queue) for isolation, not blocking normal flow. Direct SNS fan-out or sync calls lose messages or timeout if the consumer can't keep up. In exams, "absorb inflow surge and decouple" is SQS + DLQ.

Performance Efficiency — Choosing the Right Service

Performance's five principles are "democratize latest tech (managed), global reach, serverless first, experiment and measure, empathy-driven design." In practice, it boils down to choosing services in four domains—Compute, Storage, Database, Network—that match the workload.

Compute: EC2 (Graviton, Spot, Auto Scaling), Fargate, Lambda. Placement strategies — Cluster (low latency), Spread (isolation), Partition (large-scale distributed). Storage: gp3, io2 (block); st1, sc1 (throughput, cold); Instance Store (NVMe ultra-low-latency ephemeral); FSx (Lustre, Windows, NetApp ONTAP, OpenZFS). Database: Relational (RDS, Aurora), Key-Value (DynamoDB), Document (DocumentDB), Graph (Neptune), Time-series (Timestream), Ledger (QLDB), Wide-column (Keyspaces) + caching (ElastiCache, DAX, MemoryDB). Network: CloudFront, Global Accelerator, Enhanced Networking (ENA, EFA), Cluster Placement Group.

Caching Layer — Reducing Latency and Cost Simultaneously

Client → CloudFront(edge) → API GW Cache → ElastiCache/DAX(app) → DB(source)

Each layer keeps frequently-used data in faster, cheaper storage, reducing requests reaching the slow, expensive source (DB). This is caching's essence — layering via locality principle.

💡 Related Theory: Caching mirrors memory hierarchy and principle of locality from computer architecture into distributed systems. Just as CPU L1/L2/L3 cache → RAM → disk tiers ("closer = faster and smaller and more expensive"), CloudFront → ElastiCache → DB follows the same structure. Cache efficiency depends on temporal locality (recently-used data used again) and spatial locality (nearby data used together). Cache strategies (write-through, write-back, cache-aside) and invalidation are identical to OS and DB cache theory. The joke "cache invalidation is one of two hardest problems in CS" applies to distributed caching too—DAX and ElastiCache TTL/invalidation design is key to consistency.

🎯 Scenario: "A read-heavy app reads the same DynamoDB item tens of thousands of times per second, hitting both cost and latency. Want microsecond response with minimal code changes. What to add?" — Answer: DAX (DynamoDB Accelerator). DAX is in-memory cache purpose-built for DynamoDB with API compatibility to DynamoDB—nearly zero code changes, plus microsecond response and reduced read costs on cache hits. ElastiCache (Redis/Memcached) is general-purpose but requires hand-written cache-aside logic. "DynamoDB-specific + minimal code change + microseconds" is DAX's direct answer.

HPC Networking — Where Physics Dominates

HPC (high-performance computing) and distributed ML training exchange gradients every step across hundreds of nodes, so inter-node communication latency governs overall performance. Here, the physics of light speed and network stack overhead determines design.

  • Cluster Placement Group: Physically pack instances in the same AZ and same rack to minimize inter-node latency and maximize bandwidth. Trade-off: lower availability (single-rack failure kills all—acceptable for HPC since jobs restart).
  • EFA (Elastic Fabric Adapter): OS-bypass lets users access NIC directly from user space, providing RDMA-level ultra-low latency for HPC communication libraries like MPI and NCCL.
  • FSx for Lustre: Parallel filesystem with hundreds of GB/s throughput, integrated with S3 to supply large datasets at speed.

🔍 Deeper Dive: Why is EFA's "OS-bypass" decisive? Regular TCP/IP communication incurs kernel mode switches, copying, and interrupts per packet—microsecond overhead accumulates. In distributed learning with hundreds of nodes communicating every step, this overhead idles GPUs. EFA uses SRD (Scalable Reliable Datagram) protocol, bypasses the kernel, and lets user space communicate directly with NIC—reducing latency by orders of magnitude. This is why Cluster PG (physical packing) + EFA (stack bypass) + Lustre (data supply) is the standard triple for HPC and large-scale ML training. In exams, "inter-node ultra-low latency + MPI/distributed learning" signals this combination.

Summary

Reliability assumes failures occur and expands from Multi-AZ (CP, sync) to Multi-Region (AP, async), makes retries safe via idempotency and exponential backoff with jitter, and validates recovery procedures with FIS. Performance Efficiency chooses services in four domains (Compute, Storage, Database, Network) matching the workload, reduces latency and cost simultaneously through caching (CloudFront, ElastiCache, DAX) using memory hierarchy principles, and HPC breaks physical limits with Cluster PG + EFA + Lustre.

SAP exam frequent mappings: (1) "RTO/RPO in minutes + global" → Aurora Global (async, sub-1-second RPO), DynamoDB Global Table, (2) "all regions write + always available" → DynamoDB Global (AP), (3) "inter-node ultra-low latency HPC/distributed learning" → Cluster PG + EFA + FSx Lustre, (4) "DynamoDB-specific microsecond cache + minimal code change" → DAX, (5) "absorb inflow surge and decouple" → SQS + DLQ, (6) "regularly validate recovery procedures" → FIS, (7) "simultaneous retry storm" → exponential backoff + jitter, (8) "ARM cost/performance/power" → Graviton. Next day dives into Cost and Sustainability pillars through unit economics and carbon accounting.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

A global service reads and writes simultaneously in multiple Regions, and even if one Region fails, other Regions must continue to accept writes without interruption. Temporary data inconsistency is acceptable to the business. What is the most appropriate database?

Question 2

A distributed ML training job exchanges gradients across hundreds of nodes at every step, and inter-node communication latency determines training speed. Communication performance takes priority over availability. What is the most appropriate configuration?

Question 3

A read-intensive application reads the same items from DynamoDB tens of thousands of times per second, resulting in high latency and cost. You want microsecond responses while minimizing application code changes. What is the most appropriate solution?

Question 4

In a mobile backend, when recovering from a failure, many clients retry at the same time, and the server repeatedly collapses again just before recovering. What is the most appropriate response?

Question 5

In a system, producers push messages faster than consumers can process them, causing message loss and timeouts. You want messages that fail processing to be isolated and reprocessed separately without blocking the normal flow. What is the most appropriate design?

Question 6

A team adopted Aurora Global Database, and the documentation states that the RPO is "not 0 but under 1 second." What best explains this RPO characteristic?

PreviousOperational Excellence & Security Pillars Deep Dive — GitOps Roots, Shared Responsibility Model Boundaries, Three Types of Traceability InternalsWeek 13 · Day 2Next Cost & Sustainability Pillars Deep Dive — Unit Economics, Regulatory Roots of Carbon Accounting, Trade-Offs Between Two PillarsWeek 13 · Day 4

Official references

  • SAP-C02 official exam page(opens in a new tab)
  • Amazon DynamoDB documentation(opens in a new tab)
  • Amazon RDS · Aurora documentation(opens in a new tab)
  • Amazon SQS documentation(opens in a new tab)
  • Amazon ElastiCache documentation(opens in a new tab)
  • Amazon FSx documentation(opens in a new tab)

On this page

  • Reliability — Design Assuming Failures
  • Idempotency and Retry — The Mathematics of Stability
  • Performance Efficiency — Choosing the Right Service
  • Caching Layer — Reducing Latency and Cost Simultaneously
  • HPC Networking — Where Physics Dominates
  • Summary
  • Practice Questions