Dipperstein All articles
Deep Dives

One Star, Nine Names: A Resolver for Betelgeuse and for Your API

Dipperstein
One Star, Nine Names: A Resolver for Betelgeuse and for Your API

Photo: Igor da Bari, CC BY 4.0, via Wikimedia Commons

Point a telescope at the shoulder of Orion and you're looking at one object. Query a handful of astronomical databases about that same object and you'll get an argument about what to call it.

Betelgeuse is α Orionis to anyone raised on Bayer. It's 58 Orionis if you learned your constellations from Flamsteed. It's HD 39801 in the Henry Draper Catalogue, HIP 27989 in Hipparcos, SAO 113271 in the Smithsonian catalog, BD+07 1055 in the Bonner Durchmusterung, and — most humbling of all — a nineteen-digit integer in Gaia DR3 that I have never once typed from memory. The IAU's Working Group on Star Names ratified "Betelgeuse" as the official proper name in 2016, which settled the spelling debate and absolutely nothing else.

None of these is wrong. That's the part that got me. I've spent most of my career treating identity as a solved problem — pick an ID, make it the primary key, move on — and here's a four-century-old naming system where every identifier is a legitimate view of the same row, published by a different institution, at a different time, for a different reason.

So I built a resolver. Not because astronomy needs one, but because I wanted to feel the problem in my hands.

The catalog problem is a schema problem wearing a costume

Each catalog was designed for its own era's constraints. Bayer's Uranometria in 1603 had no room for a million entries, so it gave the brightest stars in each constellation a Greek letter, ordered roughly by brightness. Flamsteed numbered stars within constellation boundaries, west to east, which is why 58 Orionis is a coordinate-adjacent fact and α Orionis is a brightness-adjacent one.

The Henry Draper Catalogue (1918–1924) was the first serious attempt at scale — spectral classification for hundreds of thousands of stars, with sequential numbers that carry no positional meaning whatsoever. Hipparcos in 1997 gave us 118,218 stars with parallax-grade precision. Gaia DR3 in 2022 gave us 1.8 billion sources, and at that volume you stop pretending a human-readable name is a feature.

Watch what happens to the design constraints as you move down that list:

Catalog Key format Stability
Bayer Greek letter + constellation Reassigned historically; constellation boundaries changed
Flamsteed Number + constellation Tied to boundary conventions
HD Sequential integer Stable, but positional info absent
Hipparcos Sequential integer Stable within the mission's frame
Gaia 19-digit integer Stable within a data release; cross-release matching is its own job

Every one of those is somebody's perfectly reasonable decision under their own constraints. Every one of them is fragile in a way its authors knew about and shipped anyway. That's not a failure — that's the actual texture of naming things.

Small resolver, big lesson

The build was maybe 200 lines. An alias table, a normalizer, and a preference order:

ALIASES = {
    "alpha ori":      ("bayer", "alf Ori"),
    "58 ori":         ("flamsteed", "58 Orionis"),
    "hd 39801":       ("hd", "39801"),
    "hip 27989":      ("hip", "27989"),
    "sao 113271":     ("sao", "113271"),
    "bd+07 1055":     ("bd", "BD+07 1055"),
}

PREFERENCE = ["gaia", "hip", "hd", "bayer", "flamsteed", "sao", "bd"]

Three things fell out immediately.

Aliases belong in a table, never in a column. My first draft had also_known_as as a comma-joined string. It took about eleven minutes to regret. If you ever need to ask "which rows claim this alias," a column of text is a wall and a table is a door. The same is true of your users' email addresses, your customers' legacy account numbers, and the SKUs you inherited from an acquisition.

Preference order is a policy, not a fact. Choosing Gaia first isn't more correct than choosing HIP first — it's a bet that the newest survey will outlive the older ones and that cross-matching will keep working. Somebody has to own that bet explicitly, in code, with a comment explaining when it was made. My resolver's PREFERENCE list is the single most opinionated thing in the file, and if I came back in three years I'd want to know why I wrote it that way.

Deprecation needs a tombstone. Flamsteed numbers for some constellations are effectively unusable because boundary conventions shifted. Old records still cite them. If your resolver deletes the alias when the mapping breaks, you've just made the historical record unqueryable. A dead alias with status = 'deprecated' and a note about why is worth ten live aliases with no history.

The collision story

Here's the fun part. Catalog number collisions are not rare — they're structural. A sequential integer assigned within one institution's scope. That's it. That's the guarantee. HD 39801 means one thing. "39801" alone means nothing, and if you strip the prefix during ingestion because it looks like noise, you'll match it against the wrong catalog eventually.

This is the same class of bug as an API that returns {"id": 42} without a type field, or a database where users.id and orders.id are both autoincrement integers and some well-meaning analyst joins them on accident. Namespacing isn't bureaucracy. It's the difference between a system that survives its first integration and one that doesn't.

What I'd tell the next person building a registry

I've shipped package registries, internal service catalogs, and at least one customer table that haunts me. Every lesson the star catalogs handed me maps over cleanly:

The telescopes keep coming. Rubin's LSST will add billions more objects and, I promise you, another identifier scheme with its own quirks and its own perfectly reasonable rationale. Betelgeuse will pick up a few more names along the way.

What I took away from the exercise isn't that astronomical naming is messy. It's that a system can be messy in a disciplined way — every alias documented, every mapping traceable, every deprecation recorded — and still function across four centuries of institutional turnover. That's the bar. Not clean. Durable.

All Articles

Related Articles

The Kettle, the Ladle, and the Compiler: A Soaking-Hot Tour of Type Strictness

The Kettle, the Ladle, and the Compiler: A Soaking-Hot Tour of Type Strictness

My Well Pump Is the Worst Database I've Ever Administered

My Well Pump Is the Worst Database I've Ever Administered

The Big Dipper Doesn't Move, But My Tripod Sure Did: A Star Tracker Built Out of Junk Drawer Physics

The Big Dipper Doesn't Move, But My Tripod Sure Did: A Star Tracker Built Out of Junk Drawer Physics