inflearn logo

Practical Guide to Preventing Failure Propagation in MSA — Timeouts, Circuit Breakers, Retries, Sidecars, and Backpressure

I reproduce locally with Docker how the entire system collapses into 503s just because a single service slows down, then fix it by measuring timeouts, circuit breakers, retries, connection pools, and sidecar limits under the same load before and after. 44 lessons; all figures are actual run results.

1 learners are taking this course

Level Intermediate

Course period Unlimited

Microservices
Microservices
Spring Boot
Spring Boot
circuit-breaker
circuit-breaker
Envoy
Envoy
k6
k6
Microservices
Microservices
Spring Boot
Spring Boot
circuit-breaker
circuit-breaker
Envoy
Envoy
k6
k6

What you will gain after the course

  • For each downstream call, set the connection and read timeouts, as well as the overall chain deadline, based on measured downstream p99 latency, and present them in a table.

  • Review the circuit breaker settings (failure rate, slow-call threshold, window, and half-open state) and identify pitfalls that cause the circuit to open too late.

  • Check whether retries at the app, sidecar, and client layers overlap; consolidate them into a single layer and apply a retry budget and jitter.

  • Align the connection pool, idle timeout order, and sidecar connection limits on a single page.

  • Use bulkheads, concurrency limits, priority-based rejection, and rate limiting to keep latency in one feature from spilling over into payments.

  • Set buffer and overload limits so sidecars quickly reject requests during traffic spikes instead of restarting due to memory limits.

  • Bring the k6 load test, Grafana dashboard, and checklist, and run the same measurements on our service.

When a downstream service slows down, where does my service cut off the request, and how does it keep going?

We reproduce locally with Docker how the entire system collapses with 503s when just one service slows down, then fix it by measuring timeouts, circuit breakers, retries, connection pools, and sidecar limits before and after under the same load. Across 44 lessons, every number comes from actual runs.

This is not a lecture that simply introduces patterns. Every lesson follows the same cycle: reproduce a failure, measure the numbers (p50, p99, failure rate, error count, memory), change the settings, and measure again under the same load. The first lesson shows what happens during a sixfold spike in push traffic: before the fix, p99 is 10.01 seconds, and the sidecar’s memory climbs to 63.0MiB—near its configured 64MiB limit—so the kernel forcibly terminates it, resulting in one restart. After the fix, p99 drops to 849.77ms, sidecar memory peaks at 19.2MiB, and there are zero restarts. Each lesson focuses on a common real-world mistake, such as a circuit breaker opening too late because its slow-call threshold matches the read timeout, retries in the app and sidecar overlapping, or connections dropping because idle timeout settings are in the wrong order.

By the end of this lecture

  • Set connection and read timeouts for each downstream call, along with the overall chain deadline, based on measured downstream p99 latency, and present them in a table.

  • Check the circuit breaker settings (failure rate, slow-call threshold, window, and half-open state) and identify pitfalls that cause it to open too late.

  • Identify whether retries in the app, sidecar, and client overlap, consolidate them into one layer, and apply a retry budget and jitter.

  • Consolidate connection pools, idle timeout order, and sidecar connection limits on a single page.

  • Use bulkheads, concurrency limits, priority-based load shedding, and rate limits to keep latency in one feature from spreading to payments.

  • Set buffer and overload limits so the sidecar rejects requests quickly during traffic spikes instead of restarting due to memory limits.

  • Take away k6 load tests, Grafana dashboards, and a checklist to run the same measurements on your service.

Recommended for those who

  • Backend developers who operate at least two Spring Boot services and have experienced downstream latency spreading throughout the system.

  • For those who have completed an introductory MSA course and want to move on to incident response and resilience configuration

  • SREs, DBAs, and platform engineers who take part in incident reviews and want to set timeout and retry values based on evidence.

Curriculum (9 sections · 44 lessons · 9 hours 54 minutes total)

  • Section 1. The First Incident and Measurement — Complete demo: a 6× spike in push traffic triggers a cascade of 503s — metrics before and after the fix, set up the Haneul Market practice environment all at once and reproduce the first incident yourself, how to read the numbers: p50, p99, failure rate, and error count in k6, Prometheus, and Grafana, incident propagation map: how downstream delays spread to threads, connections, and memory

  • Section 2. Timeouts — Without timeouts: payment delays exhaust order-processing threads, Connection timeouts and read timeouts: What never finishes, Timeout budgets: End-to-end deadlines across the call chain and deadline propagation, Setting timeout values: Start with measured downstream p99, When sidecar and app timeouts overlap: Which one cuts off first, Section review: A before-and-after table and checklist for timeouts

  • Section 3. Circuit Breakers — First use of a circuit breaker: measure closed, open, and half-open states; failure-rate threshold, minimum number of calls, and sliding window; Pitfall: if the slow-call threshold is the same as the read timeout, the circuit opens too late; Different circuits per instance: circuits open only on some instances, and latency spreads; Half-open state and recovery speed: circuits that close too quickly or too late; Fallback design: what to return instead of a failure; Comparing Envoy outlier detection with application circuit breakers

  • Section 4. Retries — Reproducing a retry storm: how retries multiply load in a three-call chain, Exponential backoff and jitter: spreading out retries that arrive all at once, Retry budgets and idempotency: how many times, and what should be sent again? Which layer should retry: duplicate retries by the app and sidecar, Choosing which errors to retry: timeouts, 503, 409, 400, Section review: one table and checklist before and after retries

  • Section 5. Connection Pools and Keep-Alive — Connection pool exhaustion: acquisition queues and acquisition timeouts, Keep-Alive mismatch: connections drop when idle timeouts are ordered incorrectly, matching sidecar connection pool and app pool sizes, HTTP/1.1 and HTTP/2: how multiplexing changes pool issues, section review: a one-page summary of connection settings

  • Section 6. Bulkheads, Backpressure, and Load Shedding — Bulkheads: Keep Notification Delays from Blocking Payments, Concurrency Limits and Queue Length: Fast Rejection and Slow Success, Backpressure: Accept at the Rate of Consumption, Load Shedding and Prioritization: Keep Payments Running and Drop Recommendations, Rate Limiting: Set a Per-Second Request Cap in the Sidecar, Section Review: Before and After Bulkheading, Limiting, and Shedding

  • Section 7. Sidecars and kind — Deploying Sky Market on a kind cluster: the sidecar pattern in action, reproducing a sidecar OOMKilled: traffic spikes and growing buffers, protecting sidecars with overload managers and buffer limits, holding out until scaling catches up: the order of load shedding and scaling, reproducing and stopping the full 503 cascade: fixing the scene from Lesson 1 yourself

  • Section 8. Asynchronous Boundaries: Outbox — Reproducing an Event Outbox Backlog: Accumulating Rows and Delayed Notifications, Relay Throughput, Batch Size, and Backpressure, Backlog Alerts and Catch-Up: When to Alert and How to Clear It

  • Section 9. Capstone — Capstone: Independently diagnose and stop a combination of failures; wrap-up: before-and-after table for the entire course and resilience checklist.

Lab Environment

Everything runs locally. We bring up the edge, order (Spring Boot + Resilience4j), payment, inventory, notification, and outbox relay services for the fictional e-commerce site “Haneul Market” with Docker Compose, placing an Envoy sidecar in front of each service. We use k6 for load testing and Prometheus and Grafana (including dashboard JSON) for observability. Since downstream services let us adjust latency, errors, and memory via a management API, we can reproduce failures precisely whenever we want. Only Section 7 uses kind (Kubernetes in Docker). The hands-on ZIP (msa-resilience-lab.zip) contains scenarios for each lesson, before-and-after configuration files, k6 scripts, dashboards, and checklists. No cloud account is required, and ports are exposed only on 127.0.0.1.

Prerequisite knowledge

  • Experience building and calling REST APIs with Spring Boot (enough to read Java code)

  • Basic use of Docker and Docker Compose (pulling images, starting and stopping containers)

  • You don’t need to know Go. The downstream service lets you adjust latency, errors, and memory settings through a management API, without changing the code.

  • No knowledge of Istio or Kubernetes is required. We use kind only in Section 7, and all commands are explained.

What This Course Does Not Cover

  • Introduction to Building an MSA (Service Discovery, Gateway, and Configuration Server)

  • Istio installation and operation (without using the control plane, directly measuring sidecar settings and providing only a field mapping table)

  • Kubernetes resource tuning and HPA calculations, Kafka fundamentals, and cloud-managed services

Notice

The narration in this course uses synthetic voice (AI dubbing). All data is simulated for educational purposes, and the numbers may vary depending on the execution environment.

Recommended for
these people

Who is this course right for?

  • A backend developer who has operated two or more Spring Boot services and experienced downstream latency cascading across the entire system.

  • For those who have completed an introductory MSA course and are ready to move on to incident response and resilience configuration.

  • SREs, DBAs, and platform engineers who participate in incident retrospectives and want to set timeout and retry values based on evidence.

Need to know before starting?

  • Experience building and calling REST APIs with Spring Boot (able to read Java code)

  • Basic use of Docker and Docker Compose (pulling images, starting and stopping containers)

  • You don’t need to know Go. Downstream services can adjust latency, error, and memory knobs through the management API and use them without changing the code.

  • You don't need any knowledge of Istio or Kubernetes. We use kind only in Section 7, and all the commands are provided.

Hello
This is dorian05202988

Career Verified

198

Learners

4

Reviews

3.0

Rating

53

Courses

A data craftsman with over 20 years of experience in databases and IT. As a DBA and manager of a DB Platform team, I work with database platforms and specialize in MySQL, PostgreSQL, Oracle, MongoDB, SQL tuning, AWS, Terraform, and Python. Drawing on experience in the gaming, finance, and IT services industries, I explain database and cloud architecture. I have published 『Oracle Practical Tuning: Learning SQL Patterns』 and 『Oracle Pro*C Practical Project Guide』, and have presented on serverless architectures, database selection, and multi-database strategies at AWS Summit 2018 and 2019 and DataYa Nolja 2020. Recently, I have been working on slow-query analysis and tuning recommendations using Bedrock LLM, automated DB specification sizing, and query workflows through a DB metadata MCP server and Slack bot. I explain database automation for developers and AI applications for non-developers through hands-on exercises tailored to the audience and objectives of each course. Rather than applying AI suggestions as-is, I teach a decision-making framework that verifies result equivalence, execution plans, and observability conditions, and defers action when the supporting evidence is insufficient. Company operational data and credentials are not included in the course materials.

More

Curriculum

All

44 lectures ∙ (9hr 54min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

dorian05202988's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!

Limited time deal

$1,064,118.00

23%

$51.70