Trade-offs · Senior and Staff
Build vs buy vs managed service
How to choose between running a component yourself, buying a finished product and using a cloud managed service, with cost, people and exit numbers.
Asked at: SeniorStaff
The decision
You need a capability, for example search, a queue or a database. You can build and run it yourself: install open source software on your own servers and operate it. You can use a managed service: a cloud provider runs a standard component for you, and you still build the application around it. Or you can buy a finished product from a vendor and call it through an API, often priced per use. The choice moves cost between money, people and risk. Self-run is cheapest in cash and costs the most people time. Buying is quick and costs the most per use. A managed service is in between. No option wins for all teams.
Choose to build and run it yourself when
- The capability is your product's edge, for example your own ranking logic, and a general product cannot match it.
- Usage is large and steady, so the vendor margin is a big share of the bill.
- You already have enough people who run this kind of system well for a 24-hour on-call rotation.
Choose a managed service when
- It is a standard component and the provider's version is good enough.
- Your team is small and operations work would take time from the product.
- You need to start in days, and growth is uncertain.
- The managed bill, with the extra people time you save, is lower than self-run.
Choose to buy a finished product when
- The capability is not your edge: sending SMS, taking card payments, checking identity.
- Volume is low today, so a per-use price is small.
- The vendor has compliance or coverage that would take you months to build.
- You can hide the vendor behind your own thin interface, so you can swap it later.
The numbers that change the answer
All of these are Assumptions unless marked as cited or calculation. Prices are invented for teaching. Check real vendor pages first.
Worked example: search for 5 million products. The self-run cluster costs Rs 2.4 lakh a month in servers (one lakh is 100,000). A managed service for the same size costs 50 percent more: 2.4 x 1.5 = Rs 3.6 lakh. A vendor charges Rs 4 for 1,000 searches. Assumption: the same cluster size handles every search volume in this example.
The people cost is the swing (calculation). An engineer costs Rs 3 lakh a month, all included. The managed premium over self-run is 3.6 - 2.4 = Rs 1.2 lakh a month. Self-run wins only if it needs less than 1.2 / 3 = 0.4 of an engineer. But 24-hour on-call needs a rotation. Say 4 people each give 25 percent of their time. That is 4 x 0.25 = 1 engineer, or Rs 3 lakh a month. Self-run total: 2.4 + 3 = Rs 5.4 lakh, against Rs 3.6 lakh managed. For a small team, managed wins by Rs 1.8 lakh a month. The result flips if you already have on-call people with spare time.
Crossover with the vendor (calculation). Managed costs Rs 3.6 lakh a month. The vendor at Rs 4 per 1,000 searches costs the same at 360,000 / 4 x 1,000 = 90 million searches a month. At 10 million searches, the vendor costs 10,000 x 4 = Rs 40,000 a month, which is cheaper. If searches grow 8 percent a month, 10 million becomes 90 million in ln(9) / ln(1.08) = 28.5 months.
Self-run at scale (cited, with care). 37signals, a software company, left the cloud for its own servers. In its own posts it reports a cloud bill of 3.2 million dollars a year before the move. It reports about 700,000 dollars spent on servers and a cloud bill of 1.3 million dollars in 2024. It reports a saving of nearly 2 million dollars a year. It also says the operations team did not grow. This is one company's report of its own bill, and we cannot check it. The remaining cloud spend was one storage service. It does not show that your workload will do the same.
Operations time (cited). Google's SRE book sets a goal of keeping repetitive operations work (toil) below 50 percent of each SRE's time. If a self-run system keeps more than half of a team on that work, the product slows.
Exit cost (assumption). Moving off a vendor that sits behind your own interface takes about 4 to 8 engineer-weeks, mostly data export and testing. Moving off a managed database takes 2 to 4 months. Moving to self-run takes 3 to 6 months.
What breaks with each choice
Build and run.
- Nobody is available at 3 am, or the one expert leaves. Fallback: a rotation of at least 4 people, runbooks and practised restores.
- Upgrades and security patches are late. Fallback: a schedule, with an owner.
Managed service.
- You hit a limit or a price step you did not expect. Fallback: load tests against the limits and a budget alarm.
- A provider outage is out of your control. Fallback: a fallback path, and a status plan for users.
- Lock-in: data formats and features that exist on one cloud only. Fallback: use standard interfaces and keep an export.
Buy.
- The price grows faster than your revenue. Fallback: alarms on cost per use, and a plan to move at the crossover.
- The vendor changes, raises prices or shuts down. Fallback: a thin interface, regular data exports, and a second vendor tested.
- Your data lives in another company. Fallback: contract terms, encryption and a data map.
What it costs
- Self-run: Rs 5.4 lakh a month all-in in the example, and months of setup.
- Managed: Rs 3.6 lakh a month, a few days to start.
- Buy: Rs 40,000 a month at 10 million searches, a day or two to start, and costs rise with use.
- Changing your mind: the cost is the data move plus the code behind your interface. Build the interface from the first day, and each later move costs weeks, not quarters.
How each level answers
SDE-1: Managed services are run by the cloud company. Building yourself gives control but needs more work.
SDE-2: For search on 5 million products with a small team I pick a managed service. It starts quickly and I do not need to run the cluster.
Senior: The cash saving of self-run is Rs 1.2 lakh a month, but the on-call rotation costs about 1 engineer, Rs 3 lakh. So managed beats self-run at our size. A vendor at Rs 4 per 1,000 searches is cheaper than managed until 90 million searches a month. At 8 percent growth that is about 28 months away. I put the vendor behind an interface and plan to move at the crossover.
Staff: I decide what is our edge and what is only a cost. I ask finance for the three-year cost and ask the team for the hours of operations work it will cause. I own an exit plan and a review date. My path has three steps. First, start with the vendor behind an interface. Second, move to managed when the vendor bill passes the managed price. Third, self-run only when the managed bill is large and at least four people can carry on-call. I know it was right if operations work stays below half of the team's time and the cost per search falls. I revisit it every year, or when the bill doubles.
Say it in the interview
For search on 5 million products I would use a vendor behind our own interface. At 10 million searches a month it costs about Rs 40,000 and needs no on-call. I would move to a managed cluster at about 90 million searches, which is the crossover in my numbers. I would self-run only if the bill is large and four people can share the pager. The risk is lock-in, so we keep the interface thin and export the data every week.
Common mistakes
- Comparing servers only. The people and the on-call cost are the largest part of self-run.
- Calling a managed service "no operations". You still tune it, watch its limits and handle its outages.
- Copying a famous company's move. One company's bill and team are not yours.
- Buying without an interface. Then every later move is a rewrite.
Sources
- 37signals (DHH), "We have left the cloud", 23 June 2023: the company reports a cloud budget of 3.2 million dollars in the previous year, and that the operations team size did not change. https://world.hey.com/dhh/we-have-left-the-cloud-251760fb (opens in a new tab) (checked 26 Oct 2026).
- 37signals (DHH), "Our cloud-exit savings will now top ten million over five years": the company reports its own cloud bill falling from a 3.2 million dollar yearly run rate to 1.3 million dollars in 2024, about 700,000 dollars of hardware, nearly 2 million dollars saved a year, no growth in the operations team, and the remaining spend all on one storage service (AWS S3). https://world.hey.com/dhh/our-cloud-exit-savings-will-now-top-ten-million-over-five-years-c7d9b5bd (opens in a new tab) (checked 26 Oct 2026).
- Google SRE book, "Eliminating Toil" (the advertised goal of keeping toil below 50 percent of each SRE's time): https://sre.google/sre-book/eliminating-toil/ (opens in a new tab) (checked 26 Oct 2026).
- All prices, the managed premium, the engineer cost, the on-call share, growth and exit effort are assumptions made for teaching. The cost totals and crossover are calculations.
Understand the trade-off. Practise explaining your choice.
In an AI mock interview, the interviewer can push on a choice like this one: it changes a number and asks if your answer still holds.