Graceful degradation का मतलब है कि जब कोई dependency fail होती है, तो system error लौटाने के बजाय एक घटा हुआ या आंशिक अनुभव परोसकर core flow को चालू रखता है। लक्ष्य है fail soft करना, न कि fail hard: एक degraded page एक 500 से बेहतर है।
Graceful degradation का मतलब है कि जब कोई dependency fail होती है, तो system error लौटाने के बजाय एक घटा हुआ या आंशिक अनुभव परोसकर core flow को चालू रखता है। लक्ष्य है fail soft करना, न कि fail hard: एक degraded page एक 500 से बेहतर है।
BAD (fail hard):
search() → backend timeout → throw → user sees HTTP 500 (whole page dead)
GOOD (fail soft):
result = search()
catch timeout → return cached_results OR empty + notice
page renders:
[ "Showing recent results — live search is temporarily unavailable." ]
+ cached listings, working nav, working checkout
→ user keeps browsing; core flow intact
एक मृत page के बजाय, user को cached results और एक छोटा notice मिलता है, जबकि navigation और checkout काम करते रहते हैं। failure एक feature तक सीमित रहती है।
Dependencies fail होंगी ही — third-party APIs, search clusters, recommendation services। graceful degradation के बिना, कोई भी एक failure पूरे outage में बदल जाती है। fail soft (cached/partial/default data) के लिए डिज़ाइन करना, non-critical paths को flag से बंद करना, fallbacks के साथ timeout करना, और bulkheads से failures को isolate करना product को आंशिक failures के दौरान उपयोग योग्य रखता है — और यही एक मामूली गड़बड़ी और एक बड़ी incident के बीच का अंतर है।