learn-economics-with-phoebe / Deep-dive session 9 of 10
Learn Economics with Phoebe · Deep-dive session 9 of 10

Build, buy or rent a data platform

Every data team has the argument at least once a year: build the platform, buy the licence, or rent it by the month. It is usually held as a technology argument and it is not one. It is the oldest question in the economics of the firm, asked by Coase in 1937 about why firms exist at all, and his answer applies unchanged: you do a thing in-house when the cost of using the market to get it, finding a vendor, negotiating, contracting, monitoring, exceeds the cost of coordinating it yourself. Everything else on a platform decision is arithmetic on top of that, and the arithmetic has traps. A fixed cost looks expensive at month 3 and cheap at month 36. A monthly fee looks cheap at month 3 and is the most expensive line on the chart by month 30. And the chart the vendor shows you has one line missing, which is what it costs to leave. Tonight draws all four lines, with constructed inputs labelled as such, and ends with a table you can rebuild for your own decision in ten minutes.

🟡 Core Data leads, platform owners, anyone signing a vendor contract Python, pandas 45 min
0-3 · Welcome 3-18 · Coase, the horizon, the hidden line 18-40 · Build-along: a TCO table with an exit row 40-45 · Q&A
Part 0

Where we start

Deep-dive session 8 was about what a buyer cannot see in the thing she buys. Tonight is about what she cannot see in the contract: the costs that are not on the invoice. Deep-dive session 4 already met fixed and marginal cost in the shape of an inference bill, with a break-even volume where renting an API and owning a fixed cost cross. A platform decision is the same crossing drawn over time instead of volume, with three lines instead of two, and with a fourth that appears only when you try to move. The economics is short. The discipline is writing every input down as a number you chose, so that when the vendor's chart and yours disagree, the disagreement is a diff and not a meeting.

🎫 Clear all three quiz questions to stamp your passport Live = presented in the 45 minutes Self-study = the full depth, after class ★ Build-along = run the code yourself

★ What you walk out with tonight. Coase's transaction-cost answer to make-or-buy stated in a form you can put in a business case, the boundary of the firm drawn as a wall with a door and four kinds of friction on it, three cumulative cost lines over 36 months and the three months at which they cross, the option value of a monthly contract stated as what it buys and what it costs, the switching cost line that turns a rent decision into a lock-in decision, and a pandas TCO table with constructed inputs whose last row, the exit at month 24, changes which column wins.

Part 1 · covers Coase and the boundary of the firm

Where the firm ends is a cost decision

5 min live

Coase 1937, "The Nature of the Firm", Economica 4(16) 386-405, starts from a puzzle. If markets coordinate so well, why does any firm employ anyone rather than contracting for every task on the open market? His answer is that using the market is not free. Every transaction has to be found, priced, written into a contract, and policed, and those costs, which he called the costs of using the price mechanism and later economics calls transaction costs, are what a firm saves by doing the thing inside. The firm grows until the cost of coordinating one more activity in-house equals the cost of buying it outside, and that is where its boundary sits. A data platform is one such activity, and the decision is where to put the wall.

THE BOUNDARY OF THE FIRM IS A WALL WITH A DOOR, AND THE DOOR HAS FRICTION INSIDE THE FIRM coordinate by instruction cost: managing, hiring, keeping the platform team on the payroll THE MARKET coordinate by contract cost: finding, negotiating, checking the vendor invoice, plus the friction search negotiate contract monitor work moves in work moves out Coase 1937, The Nature of the Firm, Economica 4(16) 386-405: transaction costs decide where the boundary sits. High friction pulls work inside; low friction pushes it out. A platform decision is a bet on the friction.
🔍 Click to zoom - the amber door is the make-or-buy decision; the four marks beside it are the costs of using the market that never appear on a vendor's invoice and always appear on your calendar
LiveTransaction costs: what the market charges that the invoice does not3 min▶

Coase's list, in a data team's words. Search: the weeks spent finding out which vendors exist, which of them do the thing you need and which only say so. Negotiate: the procurement cycle, the security review, the legal redlines on the data-processing terms. Contract: writing down what "the platform works" means precisely enough to hold someone to it, which is the eval-as-contract problem from deep-dive session 8 in a different costume. Monitor: checking, every month, that what was promised is what is being delivered, and having a lever to pull when it is not. None of these lines is on the vendor's quote. All of them are paid in your team's hours, which are the scarcest thing you have.

The in-house side has costs too, and Coase was equally clear about them: as a firm takes on more activities, the cost of coordinating them rises, managers make more mistakes, and the firm loses the discipline that a price would have imposed. The platform team you hire to avoid the vendor has to be hired, managed, retained and replaced, and its output has no market price to tell you whether it is worth what it costs. The boundary sits where the two curves meet: the rising cost of coordinating one more thing inside against the transaction cost of buying it outside.

Where a data platform usually lands. The friction is high when the thing is hard to specify, changes often, and is hard to check from outside, which describes the parts of a platform that touch your own data model, your own semantics and your own quality rules. The friction is low when the thing is standard, stable and easy to test, which describes storage, compute and most of the plumbing. That is why the same team can sensibly rent the warehouse and build the semantic layer: the boundary runs through the platform, not around it.

Self-studyWhere the shadow price of a constraint lives, and why it is not here2 min▶

Every make-or-buy decision runs into a constraint that is not money: the number of engineers you can hire this year, the security clearance a vendor cannot get, the one person who understands the legacy schema. Economics calls the value of relaxing such a constraint by one unit its shadow price, and it is the number that tells you whether the constraint is the real reason you are building rather than buying. If the shadow price of one more engineer is high, the platform team is expensive in a way the salary line does not show; if it is near zero, the "we cannot hire" argument is not the binding one.

Computing a shadow price properly means setting the decision up as an optimisation and reading the dual, and that is the subject of the prescriptive analytics course at learn-prescriptive-analytics-with-phoebe, which owns the feasible region, the solver and the dual variables. Tonight does not solve one. It only insists that when someone says "we have to build because we cannot get X", the next question is what X is worth at the margin, and that there is a course where that question has a method.

Real world

The team that priced the vendor at the invoice. A constructed story with a real mechanism. A data lead compared a licence quote against the salary of two engineers, found the licence cheaper, and signed. The first quarter went on the security review and a data-processing addendum. The second went on discovering that the connector for the one source that mattered was "on the roadmap". The third went on a monitoring dashboard to catch the silent failures the contract did not define as failures. By the fourth quarter the two engineers' worth of hours had been spent, on the vendor's side of the wall, by people who were not counted as the vendor's cost. Nothing about the licence was wrong. The transaction costs had simply been priced at zero, which is the one price they never are.

Part 2 · covers fixed against variable, the horizon and the option

Three lines over 36 months, and where they cross

5 min live

Strip the three options to their cost shapes. Build is a large fixed cost up front and a small monthly cost after. Buy is a medium fixed cost, the licence, plus a medium monthly cost for support and the people who run it. Rent is no fixed cost and the largest monthly cost. Draw the cumulative cost of each over 36 months and the lines cross, and the month at which they cross is the whole decision. The inputs below are invented; the crossing structure is what every real version of this chart has.

BUILD, BUY, RENT: CUMULATIVE COST OVER 36 MONTHS, CONSTRUCTED INPUTS CUMULATIVE COST, INVENTED UNITS MONTHS 0 12 24 36 rent 792 buy 552 build 504 crossings, on these invented inputs: month 12: rent passes buy month 20: rent passes build month 30: buy passes build Inputs, all invented: build 360 up front and 4 a month; buy 120 licence and 12 a month; rent 22 a month and nothing up front. Rent is cheapest at month 6, buy at month 24, build at month 36. The horizon is the decision, not a finding.
🔍 Click to zoom - the three amber dots are the only facts on the chart; move the horizon past each one and the cheapest option changes, which is why every business case should state its horizon before its answer
LiveTotal cost of ownership over a horizon, and why the horizon is the decision3 min▶

Total cost of ownership is the sum of every cost an option incurs over a stated period: the fixed cost, the monthly cost, and the transaction costs from Part 1 priced in hours. Its one indispensable input is the period. On the invented inputs above, rent is cheapest for the first eleven months, buy is cheapest from month 12 to month 29, and build is cheapest from month 30. Ask "which is cheapest?" without a horizon and the honest answer is "when?". Anyone who presents a TCO comparison without stating the horizon has presented a number that could be made to favour any option by moving one date.

Fixed against variable is the reason the lines cross at all, and deep-dive session 4 met it as the break-even volume between an API bill and a fixed cost. A fixed cost is paid once and spread over every month after; the more months, the thinner it is spread. A variable cost is paid every month and never gets thinner. So a long horizon favours the option with the highest fixed and lowest variable cost, and a short horizon favours the reverse. The build line starts highest and ends lowest for exactly that reason, and it is neither the good option nor the bad one; it is the long-horizon one.

The number to write down first is therefore not a cost. It is how many months you are confident the platform will be needed in something like its current shape. Teams that are honest about that number, which is usually shorter than the roadmap says, find the decision mostly makes itself.

LiveThe option value of renting: what the monthly fee actually buys2 min▶

The rent line is the most expensive by month 36 and it is still often the right choice, because its monthly fee buys something the chart does not show: the right to stop. A fixed cost is a commitment; a monthly fee is a series of small decisions, each of which can be "no". That right is worth most when the future is least certain, when the team does not yet know which platform features it needs, whether the use case will survive its first year, or whether the data volume will be ten times larger or a tenth. Economics calls this option value, and it is real value, not a consolation.

The honest way to weigh it is to ask what the uncertainty is and when it resolves. If in six months you will know whether the use case is real, then six months of rent is the price of finding out, and it should be compared with the cost of having built for a use case that died. If the uncertainty never resolves, rent is a permanent premium for flexibility you keep needing, and that is also a fair price if the flexibility is used. Where the argument goes wrong is renting for the option value and then never exercising the option: paying the premium for years on a decision that was settled in month 4.

Self-studyThe buy landscape lives elsewhere1 min▶

Tonight is the economics of the choice and not a survey of the market. What the warehouse buy landscape looks like, which categories of product sit where, and how to read a vendor's positioning, is the subject of the data warehouse course at learn-data-warehouse-with-phoebe, which owns that map and keeps it current. No vendor is named on this page, on purpose: the three lines and the three crossings are the same whichever names are on the invoices, and a page that named them would be wrong within a year.

Real world

The business case with two horizons. A constructed story with a real mechanism. A platform proposal came to a steering group with a three-year TCO showing build cheapest. A finance partner asked for the same table at eighteen months, and rent was cheapest. Nobody had made an arithmetic error; the two tables were both right, and the room had been about to decide on the strength of a horizon that nobody had chosen. The decision that followed was not build or rent. It was to rent for twelve months, with the twelve months used to find out whether the use case would still exist at month 36, and to revisit with one horizon everyone had agreed on.

Part 3 · covers switching costs and lock-in

The line the vendor did not draw

5 min live

The vendor's chart shows the rent line to month 36 and it is accurate. What it omits is the price of leaving. Migration, re-testing, retraining the team, rewriting everything that was built against the vendor's particular way of doing things: that is a switching cost, it is paid in a lump at the moment you try to exit, and it turns a series of small "no" decisions into one large one. Deep-dive session 5 drew switching costs as a moat from the incumbent's side. Tonight draws the same wall from inside, where it is called lock-in, and adds it to the chart as the fourth line.

THE RENT LINE, AND THE RENT LINE WITH THE EXIT DRAWN IN CUMULATIVE COST, INVENTED UNITS MONTHS 0 12 24 36 exit 942 vendor 792 build 504 the line you pay if you leave at month 24 switching cost: 150, invented what the vendor drew you, at month 24 Both lines are invented. The mechanism is not: the exit has a price, and it is on nobody's invoice. A switching cost is a moat seen from inside the castle. Draw the line yourself before month 1, not at month 24.
🔍 Click to zoom - the hatched block is the whole of lock-in: every month before it the option to leave was real, and at the block the option has a price that was set the day you signed
LiveSwitching costs, and why they are paid at the worst moment3 min▶

What is in the block. Moving the data, which is the smallest part. Rewriting every pipeline, query, dashboard and model that was built against the vendor's dialect, API or semantics, which is the largest. Re-testing all of it against the numbers it used to produce, because a migration that changes a number silently is worse than no migration. Retraining the people who had learned the old tool. And the months during which two platforms run at once, which cost twice. Every one of those is a fixed cost paid at the exit, and the longer you have been on the platform, the larger it is, because more has been built against it.

Why it is invisible on the vendor's chart. Not deceit, usually; the vendor's chart is a chart of the vendor's fees, and the switching cost is paid to nobody. It is your team's hours, your delay, your risk. It appears on no invoice and so on no invoice-based comparison. It also grows in a way the invoice does not: the fee per month is roughly flat, while the exit cost climbs with every integration built. A rent decision that was genuinely reversible at month 6 can be effectively irreversible at month 30 without a single term of the contract having changed.

The option value from Part 2, revisited. The monthly fee bought the right to stop. A switching cost is the price of exercising that right, and if it is large enough the right is worth nothing: you are paying a premium for flexibility you cannot afford to use. That is the case where rent is the worst of the three, more expensive than build over the horizon and no more reversible. The way to know which case you are in is to draw the fourth line before signing, with an honest estimate of what exit would cost at month 12, 24 and 36, and to write it down where the steering group can see it.

Self-studyLock-in as a moat from the other side2 min▶

Deep-dive session 5 taught switching costs as one of the few durable moats a platform can hold: a customer who would have to pay a large fixed cost to leave will tolerate a higher price than one who can walk. Tonight's chart is that sentence from the customer's chair. The vendor's incentive is to raise the exit cost, not by force but by helpfulness: a proprietary feature that saves you a week today and costs you a quarter to replace, a dialect that is slightly nicer than the standard, an integration that only works with the vendor's other products. Each one is genuinely useful and each one raises the block in the figure.

The customer's defence is the mirror of the vendor's strategy: prefer the standard over the proprietary where the difference is small, keep the semantic layer and the tests in a form that does not depend on the vendor, and price the exit every year as if you were going to take it. None of that is free either; it is a monthly cost paid to keep the option alive, and whether it is worth paying depends on how likely you are to need the exit. A team that is certain it will stay for five years can rationally build deep into the vendor. A team that is not should keep the block small, on purpose, and know what it costs to do so.

Real world

The renewal that was not a negotiation. A constructed story with a real mechanism. At the third annual renewal the vendor raised the price by a third. The data lead opened a spreadsheet to model the alternatives and found that the cost of moving, which nobody had estimated at signing, was larger than three years of the increase. The renewal was signed. Nothing about the vendor's behaviour was surprising; the customer's exit cost was known to both sides, and only one side had drawn it on a chart. The lesson the team took was procedural, not moral: from then on every vendor contract came with a fourth line, estimated at signing and refreshed at each renewal, and the renewals became negotiations again.

Build-along

A TCO table with constructed inputs, and the row the vendor left out

★ 22 min · everyone builds

Five short steps in pandas and numpy. Every input is invented and the code says so in the comment beside it; the shape of the result, three lines that cross and a fourth that jumps, is what every real version of this table has. Replace the inputs with your own estimates, keep the word "constructed" in the filename until they are real, and the sentence at the end will still be true of whatever you typed. Your numbers will differ.

THE TCO TABLE, WITH THE FOURTH COLUMN THE VENDOR LEFT OUT HORIZON BUILD BUY RENT RENT, EXIT AT 24 12 months 408 264 264 264 24 months 456 408 528 678 36 months 504 552 792 942 the circle marks the cheapest column at each horizon; at 12 months buy and rent tie and buy is listed first inputs, invented: build 360 + 4 a month · buy 120 + 12 a month · rent 22 a month · exit 150 The exit column is the same rent line with one lump added at month 24. It is never cheapest after the lump lands. Every number here is invented. Rebuild the table with yours, and keep the fourth column even when its estimate is rough.
🔍 Click to zoom - the amber column is the one that never appears in a vendor deck; on these inputs it turns rent from the cheapest option at month 12 into the most expensive at month 24

Write the inputs as data. Three options, each with a one-off cost and a monthly cost, in cost units that are invented. The point of writing them as a dict is that the whole argument later is a diff on this block.

★ Step 1 · the inputs, all inventedimport numpy as np import pandas as pd # Every figure below is INVENTED, in "cost units". The shape is the lesson, not the values. inputs = { "build": {"upfront": 360, "monthly": 4}, # large fixed cost, small monthly "buy": {"upfront": 120, "monthly": 12}, # licence, plus support and the people who run it "rent": {"upfront": 0, "monthly": 22}, # nothing up front, the largest monthly } HORIZONS = [12, 24, 36]

The table at three horizons. Total cost of ownership is the one-off cost plus the monthly cost times the months. Three rows, three columns, and the cheapest column changes as you read down.

★ Step 2 · TCO at 12, 24 and 36 monthsdef tco(option, months): c = inputs[option] return c["upfront"] + c["monthly"] * months tab = pd.DataFrame({opt: [tco(opt, m) for m in HORIZONS] for opt in inputs}, index=HORIZONS) tab.index.name = "months" print(tab) # build buy rent on the invented inputs; your numbers will differ # 12 408 264 264 # 24 456 408 528 # 36 504 552 792 print(tab.idxmin(axis=1)) # 12: buy (tied with rent, listed first), 24: buy, 36: build

Find the crossings. Compute all three lines month by month and record every month at which the cheapest option changes. Those months are the whole decision, and they move when any input does.

★ Step 3 · where the cheapest option changesmonths = np.arange(0, 37) lines = {opt: inputs[opt]["upfront"] + inputs[opt]["monthly"] * months for opt in inputs} cheapest = pd.Series([min(lines, key=lambda o: lines[o][m]) for m in months], index=months) changes = cheapest[cheapest != cheapest.shift()] print(changes) # 0 rent # 12 buy on the invented inputs; your numbers will differ # 30 build

Add the line the vendor did not draw. A switching cost is a lump added to the rent line at the exit month. It is invented here, like everything else, and the only rule about it is that it is never zero.

★ Step 4 · the exit at month 24EXIT_MONTH, SWITCH = 24, 150 # invented: migration, re-testing, retraining, two platforms at once rent_exit = lines["rent"] + np.where(months >= EXIT_MONTH, SWITCH, 0) tab["rent, exit at 24"] = [rent_exit[m] for m in HORIZONS] print(tab) # build buy rent rent, exit at 24 # 12 408 264 264 264 # 24 456 408 528 678 on the invented inputs; your numbers will differ # 36 504 552 792 942

Write the sentence. One line that names the horizon, the cheapest option at it, and the switching cost that was assumed, so that whoever reads it knows which three numbers to argue with.

★ Step 5 · the honest sentenceH = 36 # the horizon is a choice; state it first best = tab.loc[H].idxmin() sentence = ( f"At a {H}-month horizon the cheapest option is {best} at {tab.loc[H, best]} units, " f"assuming a switching cost of {SWITCH} at month {EXIT_MONTH}; change the horizon or " f"the switching cost and the answer changes, so those two numbers are the decision." ) print(sentence) # your numbers will differ; the last clause never does tab.to_csv("tco_table_constructed.csv") # "constructed" in the filename until the inputs are real

Run Step 5 at 12, 24 and 36 before anyone sees the table. If the cheapest option is the same at all three horizons, the decision is robust and the horizon argument is not worth having. If it changes, the horizon is the decision, and the steering group should be asked to choose the horizon first and see the table second. Presenting the table first invites everyone to pick the horizon that favours the option they already wanted.

Homework

Before deep-dive session 10

30 min
  1. Rebuild the table for one real platform decision you know, with your own estimates in place of the invented inputs. Mark each estimate as rough or firm, and keep "constructed" in the filename until every one is firm.
  2. Price the friction. For the buy or rent option, estimate the hours your team would spend on search, negotiation, contracting and monitoring in year one, and add them to the table as a line. Write whether it moved a crossing.
  3. Draw the fourth line at three exits. Estimate the switching cost at month 12, 24 and 36 for the rent option, and write one sentence on why it grows.
  4. Bring the panel and the sentence. Deep-dive session 10 is the bench: rungs 1 to 5 on the real Olist rows, computed live, and the sentence you will say to a leader about a number you have defended. Re-read your deep-dive session 2 notes on the placebo before you come.
Check yourself

Three questions

Clear all three and deep-dive session 9 gets stamped in your passport.

1 · Coase 1937 asked why firms exist if markets coordinate so well. Applied to a data platform, what does his answer say decides whether to build in-house or buy from a vendor?

"The Nature of the Firm", Economica 4(16) 386-405. The costs of using the price mechanism are paid in your team's hours and appear on no quote; the costs of coordinating inside rise as the firm takes on more. Neither is zero, and the invoice shows only one side of one of them.

2 · On the constructed inputs, rent is cheapest to month 11, buy from month 12 and build from month 30. A colleague says the table "shows build is cheapest". What is the right response?

A fixed cost is spread thinner over more months and a variable cost never is, so a long horizon favours high-fixed, low-variable options. Without a stated horizon a TCO comparison can be made to favour any option by moving one date.

3 · A vendor's chart shows the rent line to month 36 and it is arithmetically correct. What is missing, and why does it matter more the longer you stay?

Lock-in is the switching cost moat of deep-dive session 5 seen from inside. The fee per month is flat; the exit cost climbs. Draw the fourth line at signing and refresh it at every renewal, or the renewal is not a negotiation.

Sources covered

What this session teaches, and where it came from

✓Coase 1937, "The Nature of the Firm", Economica 4(16) 386-405: transaction costs decide the boundary of the firm; make-or-buy as where that boundary sitsPrimary; citation confirmed against the journal record
✓Fixed against variable cost, total cost of ownership over a stated horizon, the option value of a monthly contractStandard economics, no single source; deep-dive session 4 taught the same crossing over volume
✓Switching costs and lock-in as the moat of deep-dive session 5 seen from the customer's sideStandard economics, no single source
✓The TCO table: build 360 plus 4 a month, buy 120 plus 12 a month, rent 22 a month, exit 150 at month 24; crossings at months 12, 20 and 30; totals 408/456/504, 264/408/552, 264/528/792, 264/678/942Constructed; every input is invented and labelled, the arithmetic follows from them
◐The shadow price of a constraint, read from the dual of an optimisationNamed and linked to the prescriptive analytics course; no optimisation is solved here
◐The warehouse buy landscape and vendor categoriesNamed and linked to the data warehouse course; no vendor is named here

Every fact on this page, and its verification tier, is recorded in the course's source map.

Deep-dive session 9 cheat sheet · pin this

Make-or-buy is Coase 1937Search, negotiate, contract, monitor: the market's costs. The firm ends where they balance coordination inside. Economica 4(16).
The invoice is one side of one costTransaction costs are paid in hours and appear on no quote. Price them, or they are priced at zero.
State the horizon before the answerFixed cost spreads thinner; variable never does. On the invented inputs the cheapest option changes at months 12 and 30.
Rent buys the right to stopOption value is real when the future is uncertain. It is wasted when the option is never exercised.
The fourth lineSwitching cost: a lump at the exit, on nobody's invoice, growing with everything built against the vendor.
Lock-in is a moat from insideEstimate the exit at signing, refresh at every renewal, or the renewal is not a negotiation.