Graceful Degradation

Friday 2026-11-13 09:45:28 (5d ago) | 1.79 KB

# Graceful Degradation: Staying Useful When Parts Fail

Large systems are always partly broken somewhere. The goal is not zero failures but keeping the core experience working when a dependency fails. Interviewers like designs that say what happens in that case.

## Identify the core path

For an online store: browse, add to cart, checkout. Recommendations, reviews, "people also bought" and personalized banners are nice-to-haves. Draw that line explicitly.

## Techniques

- **Fallbacks**: if recommendations time out, show bestsellers from a cache; if a profile service is down, show a generic greeting.
- **Stale data**: serve the last known good value from cache with a short staleness indicator rather than an error.
- **Feature switches / kill switches**: turn off expensive features under load to protect checkout.
- **Timeouts and circuit breakers** so a slow optional dependency can't consume all threads.
- **Load shedding by priority**: drop analytics and background traffic before user-facing requests.
- **Asynchronous fallback**: if payment confirmation is slow, accept the order and confirm by email later.
- **Static fallback pages** served from a CDN when the origin is unavailable.

## Design implications

- Every call to a non-core dependency needs a timeout and a defined fallback.
- The UI must handle missing sections without breaking the page.
- Test it: inject failures in staging, and rehearse in production game days.

## Metrics

Track how often fallbacks are used; a fallback quietly active for weeks is an incident nobody noticed.

## Interview tip

After drawing your architecture, pick one optional dependency and say how the product behaves when it's down. It's a short addition that shows maturity.

Disclosure: I work at Linkjob AI (https://www.linkjob.ai/), an AI tool for job interviews.

Paster help

Anonymous, private, non-indexed text and image hosting focused on quick creating and easy sharing.

PUT & Linux terminal

Website supports uploading using PUT in which case website output will be either URL of newly created Paste or short error description.
Here is simple alias, which you can save to your .bashrc:

alias paster="curl --request PUT --data-binary @- https://paster.palider.cz/ && printf '\n'"

Then you can pipe text like this

ls | paster

It also works for images:

cat some-image.jpg | paster

Or different application like photo from Raspberry's raspistill:

raspistill -w 1280 -h 720 -o - | paster

Scripts

For little more robust approach you can also download script paster.sh and save it locally only for you...

mkdir ~/bin -p && wget -O ~/bin/paster https://paster.palider.cz/scripts/paster.sh && chmod +x ~/bin/paster

... or globally for all users (root permission required)

sudo wget -O /usr/local/bin/paster https://paster.palider.cz/scripts/paster.sh && sudo chmod +x /usr/local/bin/paster

Then you can use it also other way around to paste file path as first argument:

paster some-image.jpg