Profile Service Dependency Outage
A stale-cache fallback starts hammering the database when the profile service is down.
Topic tools
Layout updated
Prompt
A stale-cache fallback starts hammering the database when the profile service is down.
A circuit breaker stops a queue of callers from following a failing dependency over the cliff. The fallback must also have limits.
Constraints
- Limit waiting time, retries and calls to the failed service.
- Never use old data for checks that require current permission.
Think first
Take five minutes to state the failure, the evidence you need and your first safe move.
Staged reveal
First move
The profile service owns current data; cached values are limited fallbacks.
What to check
Watch fallback , queue age, open circuits and caller concurrency.
Recovery
Cap fallback work, use approved stale data and shed excess requests; make recovery probes sparse and jittered so the dependency can recover.
What you give up
Some reads can stay available using old non-sensitive fields. Current permissions and consent cannot silently become stale for convenience.
Architecture and technical reference
High-level design
- Edge
- Compute
- State
- Messaging
━━ Synchronous┄┄ Asynchronous···· Recovery / control▧ Fault
Each arrow is one interaction. Request, background and recovery branches are not one linear transaction.
Read the 4 flow steps
Problem statement
Profile lookups start timing out and caller retries amplify the outage. Which user operations can continue?
Functional requirements
- Fetch a user's profile.
- Use approved cached fields during a profile-service outage.
- Reject work that cannot finish safely in time.
Non-functional requirements
- Limit waiting time, retries and calls to the failed service.
- Never use old data for checks that require current permission.
Entities
| Entity / logical owner |
|---|
| Authoritative state |
API design
| Operation / input | Response and retry contract |
|---|---|
Decision contract | Identify acceptance, retry identity, version/ and the response on uncertainty. |
High-level design component walkthrough
Gateway / Caller
Needs profile
Why, tradeoff and connected operations
Centralize admission and routing while keeping business-state ownership downstream.
Tradeoff: Synchronous dependency adds latency
Connected operations: Pass validated input
Circuit Breaker
Open on sustained errors
Why, tradeoff and connected operations
Isolate this operation so it can scale and fail independently from storage.
Tradeoff: Premature opening may block recovery
Connected operations: Pass validated input; healthy; open / fallback; async-only
Profile Service
Primary dependency
Why, tradeoff and connected operations
Treat another system as a separate failure and retry domain with a documented contract.
Tradeoff: Failure cascades under retry storm
Connected operations: healthy
Redis / Last-Known Cache
Stale bounded fallback
Why, tradeoff and connected operations
Redis for shared ephemeral cache/index state; process-local caches remain local. Cache state is not the durable business authority. Keep frequently accessed derived state near the request path; rebuild it from its declared authority.
Tradeoff: Staleness vs availability
Connected operations: open / fallback
Bounded In-process Queue
Buffer async-safe operations
Why, tradeoff and connected operations
A bounded in-memory bulkhead, not Kafka/RabbitMQ/SQS. Reject overflow; do not imply durability for synchronous fallback. Buffer independent producers and consumers, with bounded and replay semantics.
Tradeoff: Buffer must be bounded
Connected operations: async-only
Engineering control room
Deep dives — decisions, failures and recovery
Open a deep dive to follow the steps, try an example and see how recovery works.
Tradeoffs and alternatives
| Decision | Tradeoff / alternative and recovery implication |
|---|---|
| Choose which old profile fields are safe to use | Some reads can stay available using old non-sensitive fields. Current permissions and consent cannot silently become stale for convenience. |
| Limit retries and recover gradually | When service returns, allow a few probes before restoring full traffic. Releasing every queued request at once can cause another outage. |
| What happens if a region fails? | Extra warm capacity costs money; aggressive failover is cheaper in normal times but increases overload risk. |
| Recovery probes and retry budgets | Conservative probes delay full recovery; aggressive probes improve utilization only while the dependency has enough spare capacity. |
Production scars & failure modes
A stale-cache fallback starts hammering the database when the profile service is down.
Look for: Watch fallback , queue age, open circuits and caller concurrency.
Recovery and invariant: Cap fallback work, use approved stale data and shed excess requests; make recovery probes sparse and jittered so the dependency can recover.
| Component / failure | Impact | Recovery mechanism | Alternative / tradeoff |
|---|---|---|---|
| Primary failure / race | Profile lookups start timing out and caller retries amplify the outage. Which user operations can continue? | Set deadlines, cap concurrency, trip a breaker and serve permitted stale non-security fields. Queue only asynchronous-safe work with limits. | Availability may trade against profile freshness, but authorization and consent checks cannot silently become stale. |
| Recovery follow-up | The dependency recovers while thousands of clients reconnect. Explain half-open probes and gradual ramp-up. | Set deadlines, cap concurrency, trip a breaker and serve permitted stale non-security fields. Queue only asynchronous-safe work with limits. | State the guarantee you relax and how you detect recovery. |
90-second interview summary
For a profile-service outage, I would protect the caller as well as the dependency. Every remote call gets a deadline shorter than the overall request deadline, bounded concurrency and a limited retry budget. A circuit breaker stops sustained failure from consuming the whole caller pool.
Fallback is a product decision, not a generic cache switch. A last-known display name may be acceptable within an age limit, while a current account-block or authorization field may require explicit failure. The profile service remains the authority, and stale fallback must not overwrite newer source state.
When the breaker is open, only a small number of probes test recovery. I would randomize retry timing, cap queued work and queue only operations genuinely safe to complete asynchronously. A fast fallback must be measured separately so it does not conceal that the dependency is still broken.
Regional traffic shifting needs spare capacity and a warm, policy-compliant fallback path; otherwise failover creates a second outage. I would ramp concurrency gradually and monitor dependency latency, queue age, probe outcomes and fallback load. The tradeoff is controlled degradation and some rejected requests in exchange for preserving the rest of the service during a prolonged dependency failure.
Explain it without looking
Explain choose which old profile fields are safe to use
Reveal answer
The profile service owns current data; cached values are limited fallbacks.
A stale display name and a stale account-block flag have different consequences.
Some reads can stay available using old non-sensitive fields. Current permissions and consent cannot silently become stale for convenience.
Explain limit retries and recover gradually
Reveal answer
Use deadlines, concurrency limits, a circuit breaker and approved fallback data.
Unlimited waiting and retries can make a dependency failure take down its callers too.
When service returns, allow a few probes before restoring full traffic. Releasing every queued request at once can cause another outage.
Explain what happens if a region fails?
Reveal answer
Check that the surviving region can handle both calls and fallback reads.
Routing away from one outage can create a second one unless capacity and fallback state are included.
Extra warm capacity costs money; aggressive failover is cheaper in normal times but increases overload risk.
Explain recovery probes and retry budgets
Reveal answer
A circuit breaker must recover without creating another traffic surge.
A fast fallback can hide continued dependency failure unless it is measured separately.
Conservative probes delay full recovery; aggressive probes improve utilization only while the dependency has enough spare capacity.
Revision checklist
Revision checklist
- Reconstruct choose which old profile fields are safe to use: The profile service owns current data; cached values are limited fallbacks.
- Reconstruct limit retries and recover gradually: Use deadlines, concurrency limits, a circuit breaker and approved fallback data.
- Reconstruct what happens if a region fails?: Check that the surviving region can handle both calls and fallback reads.
- Reconstruct recovery probes and retry budgets: A circuit breaker must recover without creating another traffic surge.
- Name the authoritative state, boundary, retry identity and failure-domain durability guarantee.
- Explain one alternative and exactly which guarantee you would relax.
- Redraw the request and recovery paths without looking; mark what required a hint.
On this page
- Prompt
- Constraints
- Think first
- Staged reveal
- High-level design
- Problem statement
- Functional requirements
- Non-functional requirements
- Entities
- API design
- High-level design component walkthrough
- Engineering control room
- Deep dives — decisions, failures and recovery
- Tradeoffs and alternatives
- Production scars & failure modes
- 90-second interview summary
- Explain it without looking
- Revision checklist