You will understand what production reliability means, why naive code breaks under real conditions, and how EngineerPrep uses circuit breakers, retries, and timeouts to stay alive when Bedrock, the database, or any downstream dependency misbehaves.
Picture this: EngineerPrep's lesson-generation pipeline calls Amazon Bedrock to run the plan → author → precision-review stages. Each stage is a separate LLM call. On a normal day each call takes two or three seconds and everyone is happy. Now imagine Bedrock starts responding slowly — not failing, just slow . Ten seconds. Twenty. Thirty. Your Spring Boot service is still accepting new HTTP requests because, hey, it hasn't crashed. But every request thread is stuck waiting for Bedrock to reply. The HikariCP connection pool — that's the pool of database connections your app reuses so it doesn't open a new one for every request — runs out of available connections because all the threads holding them are frozen waiting for Bedrock. New requests arrive. They need a database connection. There are none. They wait. Then they time out. Users see errors.…
Production reliability means your service keeps working — or fails fast and clearly — even when something it depends on goes wrong. Think of a power strip with a circuit breaker built in. When the current exceeds a safe threshold, the breaker trips : it cuts the power before anything catches fire. Once the danger passes, you reset it and everything works again. It does not keep trying to push electricity through a fault. Software circuit breakers work the same way. A circuit breaker is a small piece of code that wraps a call to an external service — like Bedrock or a database. It watches how that call is doing. If it keeps failing or timing out, the breaker opens : it stops making the call at all and immediately returns an error (or a safe fallback). After a short wait it lets a probe request through.…
The scene: EngineerPrep's lesson pipeline calling Bedrock through a circuit breaker. Imagine a simple diagram with three boxes in a row: Lesson Pipeline → Circuit Breaker → Bedrock . --- Step 1 — Circuit is CLOSED (normal state) The circuit breaker starts in the CLOSED state. Think of a closed circuit as a complete loop — electricity (requests) flows freely. The Lesson Pipeline sends a 'generate lesson plan' request. The Circuit Breaker passes it straight through to Bedrock. Bedrock replies in two seconds. The Circuit Breaker records: success . The pipeline moves to the author stage. What changed: one success tick is recorded. The breaker stays CLOSED. --- Step 2 — Bedrock starts slowing down Bedrock is now taking 35 seconds to reply — well past our 10-second timeout. The request times out. The Circuit Breaker records: failure . Two more requests arrive and both time out.…