When searching for items in an array, you might decide to stop your search as soon as you’ve found the item you’ve been looking for. At a first glance, that is the efficient thing to do. Who doesn’t want their code to finish as fast as possible? But is speed really the most desirable characteristic?
As any architect will tell you, it depends. Sometimes we value predictable behaviour over outright speed. This is never more true than in the event of a complex systems failure. This article by Colm MacCárthaigh introduces the idea of the constant work. He uses the analogy of a coffee urn to illustrate the desirable characteristics of such a system.
Sometimes a solution that may seem counterintuitive can have desirable properties.
“Besides being simple and robust, this approach is very cost effective. Storing a file in Amazon S3 and fetching it over and over again in a loop, even from hundreds of machines, costs far less than the engineering time and opportunity cost spent building something more complex.”
The article provides two examples of the constant work pattern deployed at the heart of AWS. Both Route53 and the Network Load Balancers use constant work to ensure predictable behaviour in the event of failure.
Source: Reliability, constant work, and a good cup of coffee