Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I hear a lot about this term "Graceful degradation".

For example ,

 "An application server should gracefully degrage when it is under heavy load "

  "Graceful degradation of user interfaces.... "

The term looks like an abstract thing to me. Any concrete example of what it means?

share|improve this question
3  
A good article on the subject codinghorror.com/blog/2011/04/… –  JF Dion Sep 27 '11 at 12:22

6 Answers 6

up vote 8 down vote accepted

Here are some examples:

  • If you run out of some resource (handles, sockets, memory, drive space) you don't crash but rather you keep serving as many users as you can serve with your available resources. Something that doesn't degrade gracefuly may simply stop working when taken outside the design envelope.
  • Under loads heavier than what you designed for users will experience slower response than what you designed for. Without graceful degradation having the system stop working once the requirements are exceeded may be acceptable.
  • Error conditions, such as disk drive failure, failure in a CPU core, failure in memory. A system designed to degrade gracefully may continue working in some reduced mode (e.g. without being able to access data in the failed drive but still delivering data from the drive that hasn't failed) while another will simply crash.
share|improve this answer

Applications that have a "degraded" mode generally offer access to a limited set of features due to an internal or external problem. For example, imagine that your application connects to two different data sources. If one of these fails it could still be possible for it to continue running but to disable all visual (or/and backend) features related to the unavailable resource.

Concrete example: your application has two data sources, in one of them you store persons, in the other you store accounts. Even if the account database fails, if the application has a degraded mode, you should still be able to create new persons, albeit not interact with their accounts.

As to the user interface, this generally means that you clearly indicate to the user that some features are disabled, and display some warning message so that he is not left out in the dark as to why something is unavailable.

Also, there is a Wikipedia entry related to fault-tolerant systems.

share|improve this answer

With technology advancement we always have changes rolling into a application which at all times may not be supported by all target audiences. In such scenarios we come across Graceful degradation which emulates that we build for the best available but we also have a fail safe for those who have not upgraded or their system might not support.

One major example is the <img> tag which has the alt attribute which is helpful for cases where images are blocked or are turned off, now these give some meaningful context for the images(of course only if we specify).

Well another example i can think of are of stylesheets in case of a error or unavailability the browser provides a generic version of its own for showing/displaying the page.

Now as you mentioned heavy load you have to carefully chalk out a plan as what is to be done if your hits shoot past the threshold, you disable certain features or suspend some services which are not critical and give you a breather. All this will help you set up a graceful degradation so that the user knows due the x things the server might take some time to respond or the x service would be unavailable for an hour or so

share|improve this answer

It means that as inputs and state exceed design limits, outputs remain as reasonable and reliable as possible.

If it's a server designed to handle 100 simultaneous connections, it doesn't crash or start returning crazy results at 101 or even 150 connections -- it slows down or maybe drops a few connections, but continues mostly working. If it's a database designed to handle 1 billion records, it doesn't suddenly slow down to an unusable state at 1.01 billion.

share|improve this answer

If you have no graphical system (like no X11 server running), your program should at least provide a CLI, like ncurses.

vi has a dumb mode in which it behaves like ex, if the terminal has too few features.

share|improve this answer

When creating web apps graceful degradation comes into play when your site relies on JavaScript or Flash or a similar techniques that the user doesn't have or disabled.

Then you should still provide some basic functionality with HTML only or at least a message why the site is not functioning as expected.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.