Skip to content
Lesson 45

Build or buy

Claude Code makes building feel free. Learn what to own and what to rent, how to compare three years of real cost, and how to keep a way out of every vendor.

The lesson in text

Click a paragraph to hear it.

01A quote and a weekend

Wednesday morning at StayHub. The company that brings in rooms and prices from ten thousand hotels sends its renewal quote: €153,000 a month. Today you pay €108,000. That's €45,000 more, every month.

The same week, Dev, one of your engineers, connects StayHub directly to the biggest hotel system on that list. Over a weekend. It works. And Karim, the CTO, asks: why are we paying anyone? Let's build it all ourselves.

This is the build or buy decision. You'll meet it again and again: login, payments, search, email. Claude Code makes building feel almost free, and that makes the question more important, not less.

In this lesson, you'll learn what to own and what to rent, how to compare the real cost over three years, and how to keep a way out of every vendor. Then you'll make Karim's call yourself.

02What the hub does

First, the problem the hub solves. Each hotel keeps its rooms and prices in a tool called a channel manager. It's the hotel's control panel: change a price once, and it updates every booking site.

StayHub needs those prices and free rooms from ten thousand hotels, about 900,000 rooms. But the hotels use more than thirty different channel managers, and each one speaks its own language: its own API, its own rules, its own quirks.

The hub is a company that has already connected to all of them. StayHub talks to one API, the hub's, and the hub translates. You pay per room, per month: twelve cents today, seventeen in the new quote. Seventeen cents times 900,000 rooms is the €153,000.

03A restaurant and its suppliers

Think of a restaurant famous for its fresh pasta. The cooks make it by hand every morning. That's why people come, and nobody there would let a supplier make it.

But the same restaurant buys its flour, its napkins and its card machine. They must work every single day. Yet no guest ever came back because the napkins were home-made.

That's the first lens. What makes customers choose you is core: you build it and you own it. What must work but doesn't make you different is context: you buy it from someone who does it all day.

Core or context?
Core: build it
Customers choose you for it
  • · The restaurant's fresh pasta
  • · StayHub: booking and pricing, fast sync with the top 3 channel managers
Context: buy it
Must work, but doesn't make you different
  • · Flour, napkins, the card machine
  • · StayHub: email sending, card payments, the 30 small channel managers
In between: open source you run yourself (no licence, your people's time), or a hybrid that buys the common part and builds only your slice. And core moves as you grow: at a few hundred hotels, all of connectivity was context.

There are middle options too. Run free open-source software yourself: no licence fee, but your people do the work. Or the hybrid: buy the common part, and build only the slice that's yours.

So the question is never "can we build it?" A good team can build almost anything. The question is: should our people spend their time here?

04Which part is core?

So, is connecting to hotels core for StayHub? Look closer, because it isn't one thing. Three channel managers carry seventy-five percent of all the rooms. The other thirty share the last quarter.

For the big three, speed matters. When a hotel sells its last room on another site, StayHub must hear it within seconds, or it sells a room that's gone: an overbooking. Hotels now compare platforms on that speed. That part is becoming core.

The long tail is different. Thirty small channel managers, little volume each, thirty different APIs, and no hotel chooses StayHub because of them. That's context. And notice that core moves: when StayHub had a few hundred hotels, all of this was context.

05What a weekend proves

Now, Dev's prototype. It's real, and it's impressive. But look at what it proves: one channel manager, the easiest one to reach, when everything goes right. Engineers call that the happy path.

Here's what a weekend doesn't include. Certification with each partner before they let you in. Limits on how often you may call them. Retries when a call fails. A nightly check that both sides agree on every room. Monitoring, and someone on call at 3 a.m. when a sync stalls.

What a weekend prototype doesn't include
Above the water: the weekend
One channel manager, the easiest one, when everything goes right (the happy path).
Below the water: the years
  • · Certification with each partner before they let you in
  • · Rate limits: how often you may call them
  • · Retries when a call fails, without sending things twice
  • · A nightly check that both sides agree on every room
  • · Monitoring, and someone on call at 3 a.m. when a sync stalls
  • · Every partner changing its API on its own schedule, forever
Buying has a smaller iceberg too: matching your rooms to theirs, handling their errors, watching that it works.
The part above the water is what a demo or a weekend shows. The part below lasts for years, for each of the 30+ partners.

And then, forever, every partner changes its API on its own schedule. It's an iceberg. The prototype is the part above the water. Most of the cost is below it, and it lasts for years.

Buying has a smaller iceberg too. A bought service still needs integration: matching your rooms to theirs, handling its errors, watching it work. Count that on the buy side.

06Three years of cost

The second lens: compare the total cost of ownership over three years, not this month's invoice against a weekend. And count people. At StayHub, an engineer costs about €10,000 a month, salary and everything around it.

Option A: renew the hub for everything. €153,000 a month, for thirty-six months: about €5.5 million.

Option C, Karim's: build everything. About twelve engineers for eighteen months, while still paying the hub, because you can't switch off what you haven't replaced. Then a bigger team to run thirty integrations. About €7.2 million: the most expensive, and the riskiest.

Option B: build only the big three, and buy the rest. A team of five builds the direct connections in about six months, while the hub keeps running. After that, the team plus the hub for the small ones comes to about €100,000 a month. Total: about €4.2 million.

Three years of total cost (millions of euros)
A. Renew the hub for everything≈ €5.5M
€153k × 36 months
B. Hybrid: build the top 3, hub for the rest≈ €4.2M
€300k build + €918k hub for 6 months + €100k × 30 months
C. Build everything (Karim)≈ €7.2M
€2.16M build (12 engineers × 18 months) + €2.75M hub meanwhile + €125k × 18 months
An engineer costs about €10,000 a month, salary and everything around it. You keep paying the hub until the replacement is live. Illustrative StayHub numbers.

So the hybrid wins: cheaper than renewing, far cheaper than building it all, and StayHub owns the part that's becoming core. What sank Karim's plan wasn't the code. It was the years after the code.

07The email server built in a sprint

StayHub has paid for this lesson once already. Two years ago, a team built its own email sending in one sprint, to save €2,000 a month. It passed every test.

But sending email is the easy part. Getting into inboxes is a whole industry: the sender's reputation, warming up new addresses slowly, handling bounces and spam complaints. A sprint builds none of that.

Six weeks later, a wave of spam complaints got StayHub's sending address blocklisted. For three days, about eighteen percent of booking confirmations bounced or landed in spam. Guests flooded support, and some booked elsewhere.

The email server built in a sprint
  1. SprintOwn email sending built to save €2,000 a month. Passes every test.
  2. Week 6A wave of spam complaints: the sending address is blocklisted.
  3. 3 days~18% of booking confirmations bounce or land in spam.
  4. AfterSupport flooded, some guests book elsewhere: more lost than years of savings.
  5. FixBuy from a specialist email provider, behind StayHub's own interface.
Mailbox providers trust senders by reputation: authentication records, a slow ramp-up of volume, and a spam-complaint rate kept very low (Google asks for under 0.3%). A sprint builds the sending, not the trust.

Those three days cost more than years of savings. The fix was to buy again, from a specialist. Email was context all along. The sprint priced the first version, not the next three years.

08Keep a way out

The third lens: whatever you buy, keep a way out. Prices change, vendors get bought, services go down. A decision you can undo cheaply is a much smaller bet.

Back in the restaurant, the recipes say "flour", not the name of one mill. If the mill triples its price, the cooks change nothing. In software, that's your own interface: StayHub's code asks for rooms in StayHub's words, and one small adapter translates for each vendor.

Your own interface, one adapter per vendor
ChannelSync (StayHub's own interface)push prices and free rooms, receive bookings
→ HubAdaptertranslates for the hub (30 small channel managers)
→ ChannelCoAdapterdirect connection, one of the top 3
Router: hotel 1042 → ChannelCoAdapterper hotel, default: the hub
StayHub's code asks in StayHub's words. Only the adapters know a vendor's names. A router picks the adapter per hotel, so partners move one at a time and any step can be undone.

Then you don't switch everything at once. A small router sends each hotel either to a direct connection or to the hub. You move one partner at a time, and any step can be undone.

Next, keep your own copy of the data: rooms, prices and bookings live in StayHub's database, not only in the vendor's. And test the export before you sign, with the notice period written down.

Finally, write down when to look again. For StayHub: if the hub's bill passes €60,000 a month, or a fourth channel manager grows past five percent of rooms, you revisit. That's your revisit trigger.

An exit plan, before you sign
QuestionStayHub's answer for the hub
Is the vendor contained?Only the hub adapter knows its name
Do we own the data?Rooms, prices and bookings live in StayHub's database
Can we export, and has it been tested?Daily full export, tested
How long to leave?Notice period of 6 months or less, written down
When do we look again?Hub bill above €60,000 a month, or a 4th channel manager above 5% of rooms

09Your job as lead

Claude Code makes this harder, because building feels instant. It can write three adapters in an afternoon and say the other thirty follow the same pattern. That's the weekend prototype again, only faster.

So before building anything, ask three questions. Is this core or context: would a customer choose us for it? What does it cost over three years, people included? And what's below the water: certification, retries, monitoring, on-call?

If you buy, ask a fourth: how do we leave? Have Claude Code put the vendor behind your own interface, then search the code for the vendor's name. It should appear in one adapter, and nowhere else.

Let's recap. Build what makes customers choose you; buy what must simply work. Compare three years of total cost, not an invoice against a weekend. Keep your own interface, your own data and a revisit trigger. Next lesson: the new connectivity team needs a message system, and Omar wants to run it himself.

Check yourself

0/10 answered
  1. 1In build or buy, what is "core"?

  2. 2In the restaurant picture, which one is context?

  3. 3Dev connected StayHub to the biggest channel manager over a weekend. What does that prove?

  4. 4The hub charges €0.17 per room per month for 900,000 rooms. How much is that over three years, roughly?

  5. 5Why does the hybrid (build the big three, keep the hub for the rest) beat building everything?

  6. 6Two years ago StayHub built its own email sending to save €2,000 a month. What went wrong?

  7. 7Claude Code says: "I wrote adapters for three channel managers this afternoon; the other thirty follow the same pattern. We can drop the hub in two sprints." What do you reply?

  8. 8After a vendor change, which check tells you the vendor is really contained?

  9. 9Which of these is a good revisit trigger for the hub contract?

  10. 10Maya wants to buy a loyalty programme that's live in six weeks. Karim says the loyalty rules are why guests come back. What's the sensible split?

Free account

Save your progress — create a free account

Free. No card. Your finished lessons follow you to any device, and you can ask questions in the community.

Create my free account
Founding members

Every lesson is free while we build. Lock in €9/month for later.

The first 100 members keep the founding price for as long as they stay. Reserving is free: no card, nothing is charged.

See the founding offer

Questions from the community

All questions →