It has been a while since the phrase “Pets versus Cattle” was on the top of the conversational pile, but I think that it is a useful tool for approaching application architecture. Originally the phrase referred to on-premises enterprise IT as pets. We would have individual names for our servers and would spend a lot of time troubleshooting issues to return a server to a healthy state. By contrast, cloud-native applications were referred to as cattle. Instances have a numeric reference for a name, and if one stops working, it is destroyed and replaced with a new working instance.
Pets Everywhere
One of the reasons that the phrase has had less airtime is that even cloud-native applications have pets somewhere. The valuable and persistent data that is usually at the center of an application is a pet; you cannot simply delete all of the valuable data and replace it with newly created data. Databases, file shares, and object stores are often full of irreplaceable data, even when the rest of the application is ephemeral. On-premises we might have made pets out of every server; cloud-native still has pets even when much of the application is disposable.
Cattle aren’t Disposable
The other problem is that a cattle beast is a valuable resource. Some of my family background is in New Zealand dairy farming and breeding. A prize heifer or bull is very valuable and not easily replaced. There is also a rather sizeable Hindu population for whom cows have a religious significance. We need to replace cattle in the expression with something a little more appropriate. It seems to me that chickens, poultry, are more suitable. Chickens are raised in large numbers and managed on a population basis, rather than individuals. I like the differentiation of Pets vs. Poultry, understand that this is often within a specific application. Each application will have disposable resources (poultry) that are managed as population and persistent resources (pets) that are managed as individuals.
Pets vs. Poultry
The metaphor is still useful as Pets vs. Poultry when you use it to identify the parts of your application. Some parts of your application are poultry; easily replaced resources that are deployed using some automation. Poultry is an essential part of scaling-out at times of high demand, and then scaling-in when demand reduces. The individual poultry are not valuable, but you must have enough for the current demand. You do not backup poultry, but you do protect the mechanism to create more poultry such as the virtual machine template or terraform script. But you also have Pets in your application, anything that is not disposable and must be protected. Usually, Pets contain valuable data, so you need backups and probably disaster recovery plans. Knowing what parts of your application pets and what parts are poultry helps you manage the parts differently. It is not that cloud-native applications are poultry and on-premises are pets, every application can contain poultry, and most will have pets. The main thing is to understand that pets and poultry should be handled differently.
© 2019, Alastair. All rights reserved.