11 ms·
This reminds me of the Pets vs Cattle analogy https://www.engineyard.com/blog/pets-vs-cattle https://www.engineyard.com/blog/pets-vs-cattle With a pet, you obs
by RcouF1uZ4gsC 9y ago
This reminds me of the Pets vs Cattle analogy https://www.engineyard.com/blog/pets-vs-cattle https://www.engineyard.com/blog/pets-vs-cattle
With a pet, you obsess over the name and meaning of the name. With cattle, as long as names don't collide or cause problems, you couldn't care less about the name.
- dghughes 9y agoWell, maybe, as long as you make sure you the bulls and cows are separated.
- yjftsjthsd-h 9y agoDepends how you mean that; I would rather a machine be named prod-app-web-7 than af74b9c. At least mark the cattle by breed!
- SteveNuts 9y agoThat goes against the paradigm. I prefer that my hostnames are ambiguous, that way I'm forced to write tools to automate administrative tasks. If I know the hostname I or my team will be tempted to make one-off changes, breaking the whole "cattle" idea.
- deleted 9y ago[deleted]
- deathanatos 9y agoIt is still helpful to have decent names even if you're treating your machines like "cattle" instead of like "pets". Inevitably, some bug will occur, and in my experience, it usually happens to occur on a machine (rather than all of them at once; I'm not saying this machine is special — the bug could have happened on any of them, and likely exists on all of them because they're all running the same code, but this particular machine ended up being the lucky one to serve that slightly unusual request). Getting in and debugging the state of that machine, pulling logs, directing a coworker to look at CPU detail "frobnozz", etc. is all easier if I can easily speak or type out the machine's name. "3.dev.microservice" is much easier to type/speak than say, an IP address, an EC2 instance ID, etc. (I fully agree on not making one-off changes, and not treating machines as pets. But I think that even after that, decent naming has a place.) And even with cattle, the other way, I still think it's useful for the name to provide some information. I.e., 3.prod.microservice being the third or fourth instance of the production setup of "microservice" is better than say, some random entry from the periodic table of elements.
- mulmen 9y agoIf you have to say the name of an instance you already lose.
- semanticist 9y agoIf you do anything to the point of dogma, you've lost. Being a good sysadmin is all about being pragmatic.
- Pxtl 9y agoThen the paradigm is wrong. Serving websites is the most important thing a webserver does, call it that. If that changes, rename it. If renaming it is impossible, you failed.
- mulmen 9y agoWhat about all the application servers behind the load balancers?
- matt_wulfeck 9y agoThere's no reason you can't have both.
- djur 9y agoI think it's useful to give long-lived entities memorable names (literally in the sense of 'possible to remember') to allow people to draw fortuitous connections and keep similar entities distinct from each other during discussions. Even if you're just trying to keep track of which server it is that seems to be faulting.
- mulmen 9y agoI think its more important that names refer to long-lived resources. If I put a DB name in a connection string I want to see the same data every time. I don't care what hardware it is on.
- paulmd 9y agoWinner winner, chicken dinner. As someone who is still managing pets, I even still prefer a standardized naming scheme. I use: ${project}-${dev/staging/web}-${web/db} (which so far has covered my bases, I'm sure you can come up with any logical extensions if you are running load-balancers or other types of servers, add a number if you are running multiple frontends or clustered DBs, etc) Even as someone who manages pets, I can't tell you how much time this has saved me from having to look up server names. I have done the generic "assign everything to a single machine## sequence" and it sucks ass. Was your production web server for this app machine32 or machine 54? What about the staging server? Can't even imagine the hassle of uuids as server names. (of course so far I have done the pets thing in my internal network... but I can tell you that my father with a 40y career in managing servers for major corporations uses names like vmhost01/fsrv01/tvpc at home... which tells you what he thinks of that.)
- da_chicken 9y agoWell, it helps to remember that RFC 1178 is from the days of single monolithic mainframes. Today we've got virtual machines that do everything, so each server can legitimately carry one name. However, if you do call it "prod-app-web-7," then you need to make sure that it's a web server for the app application in production and if that changes, you need to spin up a new server instead of reusing the VM. But, hey we don't name infrastructure sites "Site 1" and "Site 2". They're "Milwaukee" and "Austin" and "DR". So if we do that, why name them "EMC-SAN-1" and "EMC-SAN-2"? We're going to retire that name eventually and there won't be a SAN 1 anymore. And what happens after "EMC-SAN-9"? So, instead why not "EMC-SAN-ARTEMIS" and "EMC-SAN-APOLLO" and "EMC-SAN-HADES"? There's a distinction between physical names and logical names, too. What kind of long term nomenclature planning should we have? Look at hurricane names. The NWS does that so people remember which is which.
- rspeer 9y agoOkay, but a lot more people own pets than own cattle. In the computer sense as well.
- khedoros1 9y agoI've got about 5 computers at home. Most of them have "pet" names. I've got about 500 computers at work. Have fun treating them as anything but cattle.
- cam_l 9y agoI have known dairy farmers to name each one of their 4-500 head personally. Never seen that with beef cattle farmers though..
- deleted 9y ago[deleted]
- mulmen 9y agoWhat kind of cattle do you think servers most resemble?
- cam_l 9y agoHa! Excellent point. Though with all the milking machines hooked up the dairy cows probably look more like them visually speaking.. And these days servers might be more metaphorically close, increasingly, to just the beef itself. Decentralised, to somewhat stretch the analogy.
- laumars 9y agoIf the servers are immutable (eg in auto-scale groups) then it's more like beef cattle because you don't expect your servers / cattle to survive to old age. If they are any servers that cannot be auto created / destroyed without human oversight - or if their downtime breaks other resources along the chain (eg non-clustered DB server) then I'd argue those servers are a little more like dairy cattle.
- txutxu 9y agoThis did sound cool to me, at the beginning of the auto-scaling, image-based, cloud times... But then I did realize a couple of things, that improve with meaningful names: 1) Alerts impact and scope. It's easy to know what are you seeing in your phone, if balancers, rds clusters, and instances have meaningful names. 2) Metrics visualization. Maybe the graph is the same, but a meaningful legend sometimes helps. 3) SSH connection. I like to auto-complete SSH, not to copy/paste ssh and write down extra parameters like different .pem files. 4) (Inter) team communication. The same that with graph legends, for humans, it's easier with names than with ids. 5) Custom commands parametrization. The same than ssh, I prefer to be able to write down the parameter (host name, service name) of my command, without getting out of the terminal, copy the ID or IP, get back, paste, verify... 6) Costs/Reports visualization. 7) Backup management. Let's say S3 parent for the backups of a instance/service. Backup reports too. At the end, I think that I can have cattle mentality regarding Configuration Management, System patching, Version change, etc... BUT I still can get benefits from thinking a little bit element and service names. At the beginning (of the cloud concept), I did read pet Vs cattle, and I did think IDs were the thing. Now I think that to scale to many customers or many environments, it's better with previous thinking. Being the little string of the alert in the phone, the biggest winer.
- semanticist 9y agoI think the compromise is autogenerated-but-meaningful names. I wrote a Ruby script to generate memorable/meaningful names which is included as part of the automated server launch process. (https://github.com/johnd/server-name https://github.com/johnd/server-name) You never want to have to manually pick a name, or even stop to think about it, but using pure IDs for anything with a life longer than a day can get annoying.
- flurdy 9y agoI still name all personal and corporate laptops and pcs as pets. But all servers are named as cattle. But these days they may not even be cattle named as they are spun up and down so frequently in cloud environments that names makes no sense. Pets -> Cattle -> Population?
- flurdy 9y agoMigrating from Pets to Cattle for server names also means you no longer are attached to the server, so it can be replaced or shut down without any personal attachment. That is also how I feel about Microservices these days. I may still name the service with a "pet" like symbolic name, but I treat them as cattle. They can be split, repurposed, deleted, rewritten any day without much remorse or delay. No personal attachment.
- tscs37 9y agoMy personal machines are all pets ("thematrix", "heartofgold", "laputa" and "isengard") and my production systems are cattle ("sqldb01", "sqldb02", "gitea", "redis0", "redis1", "rabbitmq", "mastodon", etc.) Mostly because for automation it's easier to know what a system does by looking at the hostname. When you manage about 30 systems all over the place, that's the only reasonable solution (I do see people trying to give pet names to their production systems but it gets out of hand and they usually just maintain a directory of what system does what somewhere)
- kkirsche 9y agoIs that really cattle though? Instead of sql01 I’d think a more cattle based name would be db01, db02 etc so it’s database agnostic. For the redis and rabbitmq, I’d think that’s more mq01, mq02, etc for generic message queue servers. Potentially I’m taking the analogy too far though
- tscs37 9y agoThat's also valid but I like to know exactly what type of DB is running (SQLDB runs Mysql and Postgres Nodes for example) so I can quickly jump and find servers without much thinking.
- JasonFruit 9y agoSo more like dairy1, dairy2... beef1, beef2 ...
- hanbura 9y agodb01 is taking it into meaninglessness. Is that running PostgreSQL, Redis or MongoDB? Was Redis on db05 or cache01? That's not far from naming them server01, server02, etc. sql01 is good if you only use sql abstraction layers, otherwise you probably even want postgres01 and mysql01. Or even postgres-olap01 and postgres-oltp01, if that's what you do.
- tscs37 9y ago