from Hacker News

Naming microservices needs to be trivial, not cryptic (2018)

by arthurjj on 7/20/22, 4:41 PM with 68 comments

  • by advisedwang on 7/20/22, 5:21 PM

    Codenames better recognize how design evolves over time.

    * If you split functionality out of one service, you end up with the old service's name implying it does both. E.g. you end up with a "auth" service that only handles cookie auth but not API keys.

    * If you expand the functionality of a service, you end up with a service's name not really clueing you in to what it does. E.g. "metadata" service that actually now includes smaller objects inlined into the database.

    * When you make a rewrite of a service, until the old one is fully retired you have two confusing names, and I hope you don't pick "new_auth" or something as that will be even more confusing after the first is turned down.

    Also codenames make searching for a particular component really easy. If you have to search for "auth" you will get all kinds of irrelevant results. If you search for "kazoo", you'll probably only get docs related to kazoo!

  • by stevebmark on 7/20/22, 6:34 PM

    AirBnB doesn't allow you to name microservices descriptively. It makes sense because it doesn't scale. After the 10th "SMS Service" is created, no one knows what any of them do. And that's kind of the point of microservices, you have lots of them. It's inevitable there will be overlapping functionality.

    There's plenty of other reasons too.

    Silly names are fine, it takes just as much time to learn what "Ernest" does as it takes to learn what "shipping" does. For both services, there's 30 seconds of learning, and then everyone knows what both names mean.

    The anti-silly-service name dogma is misguided.

  • by dewey on 7/20/22, 5:14 PM

    At the beginning of my career I always choose fun names and was strongly in the camp of having fun names to identify better with my projects.

    After a few years, a growing number of services and branching out a bit more into infrastructure I came to the realization that this isn't the best choice and I'm fully in support of boring descriptive names now.

    Our services are now called scraper, proxy-manager, webrouter. This makes it a lot easier to see dependencies, figure out what an alert is for or track down issues in a large micro-service architecture where you are not always sure what a service is used for.

  • by monocasa on 7/20/22, 6:11 PM

  • by honkycat on 7/20/22, 5:29 PM

    The name is an abstraction. Naming it "cache" is not specific enough.

    The uses and functionality of services change over time and then you have to rename them.

    We have a service called "Search" that does... much much more than search. If we had named it "Harry" we could put a README in the project root and avoid confusion.

    In fact, looking around my current work's stack... we have a LOT of "boring" service names that no longer describe what the service actually does.

  • by gregschlom on 7/20/22, 4:58 PM

    100% agree with that.

    Also, obligatory reference to https://www.youtube.com/watch?v=y8OnoxKotPQ

  • by lambda_lord on 7/20/22, 5:20 PM

    This article is too long for the simple point it makes. “Don’t name your service fun cryptic names because it doesn’t scale well” could have been a paragraph on why it’s bad.

    I was hoping for a framework on naming services/APIs when a good technical name is not obvious. How do I know if “fee-record-srv” is a good or bad name? What do I do if my service’s responsibility changes over time, etc.

  • by yakshaving_jgt on 7/20/22, 5:01 PM

    The fact that this is such a common phenomenon supports the argument that programming is pop culture, and it validates the complaints of so many of us curmudgeons.
  • by Sohcahtoa82 on 7/20/22, 6:11 PM

    110% this, especially as a security engineer who might have to know about all the microservices in a product, while the software engineers might only have to know about a few of them.

    It's especially bad when there's a major lack of documentation, so I gotta either set up tons of meetings or spend time examining code just to figure out what Galactus, Omega Star, and Papaya all do.

  • by VincentEvans on 7/20/22, 5:47 PM

    I like codenames that have some sort of a association with the thing being named, like “igor” for the service that retrieves something, or “hoard” for the service that stores something, or whatever. Because the association helps you remember, but it’s also is loose enough to allow for things to evolve and responsibilities to be split in the future.
  • by AJRF on 7/20/22, 7:14 PM

    "First we have to call the bingo service, see bingo knows everybody's name-o, so we get the users-id out of there..."

    https://www.youtube.com/watch?v=y8OnoxKotPQ

  • by layer8 on 7/20/22, 6:05 PM

    Naming your microservice after a favorite pop culture entity may end up spoiling your enjoyment of said entity, because the name will trigger PTSD from that messed-up microservice. So better pick some neutral name.
  • by cm42 on 7/20/22, 5:12 PM

    Yeah, but if you have shipping01...03 instead of quirky-noun, ugly-color, and random-animal, then everybody will just know what's broken straight away and you won't have a job

    Besides, half of the fun is in figuring out who (or what!) deployed the mystery service, as well as the secrets that lie within (and are not in the password manager for some reason, Carrrl)

  • by for1nner on 7/20/22, 5:03 PM

    Is it too on the nose to point out the URL (domain) vs. this title?
  • by danhab99 on 7/20/22, 5:05 PM

    I strive to follow the Apature Science naming scheme with everything I code.
  • by hamandcheese on 7/20/22, 5:40 PM

    This doesn’t work once you are big enough or have been around long enough that a service needs to be rewritten. Personally I’m a proponent of <code name>_<functional name>. Descriptive names with the ability to disambiguate.
  • by k__ on 7/20/22, 5:18 PM

    We had Asterix characters in my first company.
  • by hrpnk on 7/20/22, 7:23 PM

    I've seen codenames in modern microservices and in very old systems where the operating system's file names limited creativity for binary names to two-letter area code and 6-digit running number for a module of the system. Fun times!

    Codenames pros & cons

    ---

    Pros:

    - security by obscurity – you won't understand your system beyond 20+ services; the attacker also :)

    - no discussions in the team on naming the service – you just take the next name from the list from the dictionary you chose

    - service splits or merges don't change the service name

    - ownership changes and moving services to another domain does not affect the service name (it may make it sound like from another universe though, like a black sheep, e.g. mixing chemical elements with action figures)

    - does not lead to acronym invasion where three three-letter acronyms describe three different services and you never know which is meant

    - leads to stronger ownership for the service

    ---

    Cons:

    - no way to understand what the service does w/o looking at API spec or one-line description (which does not exist)

    - multiple teams will implement (almost) the same thing and won't run into a naming collision telling them otherwise

    - optimizes for # services built, not well-defined domain/product structure

    - service splits or merges may invalidate the former name causing you to rethink the implications for your customers and those you know what X does

    - with sufficient amount of teams you will run into name collisions anyways as you run out of hero names, chemical elements, action figures, etc.

    - cross-team communication is very hard as teams speak gibberish to one another – it's like you'd read: "'foo' failed because of timeouts from 'bar' causing resource exhaustion and thus circuit breakers opening in 'handy' and 'dandy'"

    - English words will mix with service names making communication hard to understand as you won't be able to tell from context whether it's a service name or word

    - if you use codenames for teams you will run into the service name & team name collision eventually

    - strong ownership for the service leads to dysfunctions where devs get too opinionated and clingy to their past decisions

    ---

    Ways to organize the codename mess:

    - Use functional DNS names to alias the service URLs (you can change the implementation, but keep a stable interface for clients)

    - Use functional names in cross-team communication, but codenames internally

    - Market under the codename, so that the name is catchy

    - Application registry (API/CLI) allowing to view metadata & one-line purpose of the service

  • by tengbretson on 7/20/22, 5:28 PM

    The argument for descriptive naming is that you want to make it easier for people that lack an understanding of your architecture to make changes to it?