Skip to main content

Pets vs Cattle Analogy Explained

·920 words·5 mins

When it comes to cloud servers and old vs new technology, the concept was usually a difficult one to grasp – until experts started using the popular analogy of pets vs cattle. It helped to perfectly explain the old technology vs the new, and how you can differentiate between the two. It was a vital tool to understand the cloud, and the new way of doing things.

With so many confusing terminology and concepts to keep track of, this analogy aims to set the record straight and offer an accurate reference that everyone can use.

The Background #

Back in 2011, cloud pioneer and member of OpenStack Foundation, Randy Bias, struggled to explain how cloud native apps, AWS, and cloud in general was very different from what it was before. Since most explanations took a lot of time, he wanted something simple and effective, and he did some research – until he came upon a presentation by Bill Baker, where he was focusing mainly on ‘scale-out’ and ‘scale-up’ architectures in general.

But most importantly, Bill used the context of comparing pets with cattle when he talked about ‘scale-up’ and ‘scale-out’ technology. When you put pets and cattle in the context of cloud, and focus on the fact that pets are unique and cattle are disposable, it makes a lot of sense.

In short, if you see a server as being replaceable, it’s a member of the herd. But if you see a server as indispensable (for e.g. a pair of servers working together as a single unit), it’s a pet. Randy explains it best

In the old way of doing things, we treat our servers like pets, for example Bob the mail server. If Bob goes down, it’s all hands on deck. The CEO can’t get his email and it’s the end of the world. In the new way, servers are numbered, like cattle in a herd. For example, www001 to www100. When one server goes down, it’s taken out back, shot, and replaced on the line.

This is basically the pitch he would use, word for word.

Understanding Pets and Cattle #

Let’s take a minute to clearly define pets and cattle. When we talk about pets, we refer to servers that are seen as irreplaceable, or unique, and basically a system that cannot ever be down. These are typically manually built and managed, and also ‘hand fed’. Some examples can be solitary servers, firewalls, database systems and mainframes.

When we talk about cattle, we refer to collections of more than two servers that are built with automated tools and designed to fail at some point. During failure of these servers, human intervention is not needed as they can route around failures by restarting failed servers or simply replacing them. Some examples of these servers include multi-master datastores, web server arrays, and basically anything that is load balanced. The key to remember here is that failures can and will happen, so every server and every component should be able to fail without impacting the system.

The concept has been around for quite a while, as Yale computer scientist David Gelemter used it to explain file systems. He said

If you have three pet dogs, give them names. If you have 10,000 head of cattle, don’t bother.

This explanation has helped educate various IT professionals, giving them the tools to further explain the old vs the new.

Expanding on the Analogy #

It’s important to stick to the explanation above, or at least start with it, before moving to your own adaptation. Some people have expanded on this analogy and made their own unique version to explain their point – which is perfectly fine – but it can create a bit of confusion.

Here’s an example, used by the Kubernetes team to explain their “Pet Sets” addition to their functionality. While they understandably took the pets vs cattle analogy and interpreted it to explain their stateful applications, it was a bit confusing for some. Particularly because they used examples of stateful applications supported in Kubernetes 1.3 using Pet Sets, which are cattle-architecture systems. They are all designed for failure, and by their definition, they now use cattle data stores using Pet Sets.

It is important that we don’t confuse people when they try to understand the new technology, how it works and why it is important.

Getting Value from the Analogy #

If you want to take the pets vs cattle analogy and amend it to suit your specific needs, you are certainly free to do so. But just understand where it comes from, how it is used, and how it can help people to understand the complex principle of modern server architecture. It might be a good gesture to acknowledge where the analogy came from and where you draw your inspiration, by referring back to the original blog post for reference and the true history.

Ultimately, focusing on the fact that servers are disposable – a fact that Google actually pioneered – is a very important fact for the pets vs cattle analogy. Using this and focusing on another aspect, or describing something that it is not intended to explain, can add mud to the water and confuse some people on the issue at hand.

In Conclusion #

By understanding and accurately representing the true origins of this analogy, we will maintain its value to those new to the concept of how computing is now delivered. Cloud technology is undoubtedly the way of the future, and explaining this correctly will make all the difference.