One of the key concepts in scalability is the ability to allow for service degradation when an application is under load. But service degradation can be difficult to explain (an relate back to the term) and ‘degrade’ has negative connotations.
The networking people overcame the bad press of degradation by calling it ‘traffic shaping’ or ‘packet shaping’. Traffic shaping, as we see it on the edge of the network on our home broadband connections, allows some data packets to be of a lower priority (such online gaming) than others (such as web browsing). The idea is that a saturated network can handle the load by changing the profile or shape of priority traffic. Key to traffic shaping is that most users don’t notice that it is happening.
So along a similar vein I am starting to talk about feature shaping which is the ability for an application, when under load to shape the profile of features that get priority, or to shape the result to be one that is less costly (in terms of resources) to produce. This is best explained by examples.
- A popular post on High Scalability talked about how Farmville degraded services when under load by dropping some of the in game features that required a lot of back end processing — shaping the richness of in-game functionality.
- Email confirmations can be delayed to reduce load. The deferred load can either by the generation of the email itself, or the result of sending the email.
- Encoding of videos on Facebook is not immediate and is shaped by the capacity that is available for encoding. During peak usage, the feature will take longer.
- A different search index that produces less accurate results, but for a lower cost, may be used during heavy load — shaping the search result.
- Real-time analytics for personalised in-page advertising can be switched off when under load — shaping the adverts to those that are more general.
So my quick definition of feature shaping is
- Feature shaping allows some parts of an application degrade their normal performance or accuracy service levels in response to load.
- Feature shaping is not fault tolerance — it is not a mechanism to cope when all hell breaks loose.
- Feature shaping is for exceptional behaviour and features should not be shaped under normal conditions
- Shaped features will be generally unnoticeable to most users. The application seems to behave as expected.
- Feature shaping can be automated or manual.
- Feature shaping can be applied differently to different sets of users at the same time (e.g. registered users don’t get features shaped).
So, does the terminology of feature shaping make sense to you?