Build vs buy for infrastructure: the cost model that includes the parts people forget
Self-hosting looks cheaper until you price the engineers who run it. Managed looks expensive until you price the outage you avoided. Here is a build-versus-buy model with the operational and risk costs made explicit.
Quick answer
Compare total cost of ownership over three years across five lines: infrastructure, license or subscription, build effort, ongoing operations (usually 0.2 to 0.5 of an engineer per self-hosted stateful system), and risk-adjusted downtime. Self-hosting typically wins on pure infrastructure cost by 40 to 70 percent and loses on total cost until the managed bill exceeds roughly 150,000 to 250,000 USD a year, which is the rough salary threshold where a dedicated operator becomes cheaper than the premium.
Build versus buy arguments go in circles because the two sides count different things. The build side quotes instance prices. The buy side quotes uptime. Both are right about their own column and neither has produced a comparable number. A usable model needs five lines, over three years, with the operational cost priced at real engineer rates.
The five-line model
| Line | Self-hosted | Managed |
|---|---|---|
| Infrastructure | Compute, storage, network, replicas | Included in service price |
| License / subscription | Usually zero for open source | The headline price |
| Build effort | Weeks to production-ready | Days to integrated |
| Operations | 0.2 to 0.5 FTE per system | Near zero, some tuning |
| Risk-adjusted downtime | Higher incident rate, your pager | Provider SLA, smaller blast radius |
A worked example
Take a production message streaming cluster. Self-hosted: three brokers on mid-size instances with fast storage, roughly 2,100 USD a month including replicas, monitoring, and cross-zone traffic, so 25,200 USD a year. Build effort: six engineer-weeks to reach production quality with authentication, backups, and upgrade procedures, roughly 24,000 USD one time. Operations: 0.3 of an engineer at 180,000 USD fully loaded, so 54,000 USD a year for patching, upgrades, capacity, and on-call.
Three-year total: 25,200 times 3, plus 24,000, plus 54,000 times 3, equals 261,600 USD.
Managed equivalent at 4,800 USD a month is 57,600 USD a year, plus one engineer-week of integration at 4,000 USD, plus roughly 0.05 of an engineer for tuning at 9,000 USD a year. Three-year total: 172,800 plus 4,000 plus 27,000, equals 203,800 USD.
The managed option is cheaper by roughly 58,000 USD over three years despite costing more than double on infrastructure. Change one assumption, that operations only takes 0.1 of an engineer because the team already runs five similar clusters, and self-hosting wins by 50,000 USD. That single variable decides most build-versus-buy debates.
Marginal operations cost is the real question
The decisive question is not "what does it cost to run this?" but "what does it cost to run this given what we already run?" A team that already operates a database fleet with established backup, monitoring, upgrade, and on-call practice adds a sixth cluster at a fraction of the cost of the first. A team adopting its first stateful system pays the entire operational learning curve for one workload.
This is why the same decision resolves differently at different companies and why copying another team's conclusion is unreliable. Price your own marginal operator cost honestly: how many hours per month did the comparable existing system actually consume over the last year, including incidents?
Price the failure modes
Risk-adjusted downtime is uncomfortable to estimate but skipping it biases toward self-hosting. Estimate annual unplanned downtime for each option, multiply by the business cost per hour. If self-hosting adds four hours a year of additional outage and an hour of downtime costs 15,000 USD in lost transactions and credits, that is 60,000 USD a year, which dwarfs the infrastructure difference in the example above. Estimates here are rough, but a rough number in the model beats an implicit zero.
Count the exit cost on both sides
Managed services carry switching cost through proprietary APIs and data formats. Self-hosted systems carry a different switching cost: the accumulated operational knowledge lives in a few heads, and handing it over is expensive. Ask how long it would take a new team to take ownership of each option. If the answer for the self-hosted system is "only two people understand the upgrade path," that is a real liability.
Revisit the decision on a schedule
Build versus buy is not permanent. Managed prices fall, self-hosted operational burden grows with scale, and team composition changes. Put a calendar reminder 18 months out to re-run the model with actual numbers rather than the estimates used originally. Record the original assumptions in an architecture decision record so the review has something to check against, as described incost in architecture decision records.
Get the infrastructure line right
The one line teams consistently underestimate is self-hosted infrastructure, because the first sketch omits replicas, cross-zone traffic, backup storage, monitoring overhead, and the non-production copies. Writing the self-hosted option in Terraform and pricing it properly closes that gap. C3X prices the full resource set from the plan, including the storage, replicas, and network components that a manual estimate forgets, so the build column reflects what would actually be deployed. See themanaged versus self-hosted comparison for a concrete breakdown.
FAQ
How do I model build versus buy for infrastructure?
Compare total cost of ownership over three years across five lines: infrastructure, license or subscription, one-time build effort, ongoing operations priced at real fully loaded engineer rates, and risk-adjusted downtime. Self-hosting usually wins on infrastructure cost alone by 40 to 70 percent and frequently loses on total cost once operations and incident risk are priced honestly.
How much engineering time does a self-hosted system consume?
Typically 0.2 to 0.5 of an engineer per production stateful system, covering patching, version upgrades, capacity planning, backup verification, monitoring maintenance, and on-call. The figure drops sharply for teams that already operate similar systems, which is why marginal operational cost rather than absolute operational cost is the number that decides the comparison.
At what spend does self-hosting become cheaper?
Roughly when the managed bill exceeds 150,000 to 250,000 USD a year, since that is the range where the premium starts to exceed the fully loaded cost of a dedicated operator. The threshold shifts substantially with existing team capability: an organization already running a fleet of similar systems crosses it much earlier than one adopting its first stateful workload.
Why does the same build-versus-buy decision resolve differently at different companies?
Because marginal operational cost dominates the model and it varies enormously. A team with established backup, monitoring, upgrade, and on-call practice for a similar system adds another at a fraction of the cost of the first. A team adopting its first system of that type absorbs the entire operational learning curve within a single workload's business case.
How should downtime risk be priced in the comparison?
Estimate the additional annual unplanned downtime hours for the self-hosted option and multiply by the business cost per hour of outage. If self-hosting adds four hours a year and an hour costs 15,000 USD in lost transactions and service credits, that is 60,000 USD annually, often larger than the entire infrastructure difference. A rough estimate is better than the implicit zero that omitting it assumes.
How does C3X help with build-versus-buy analysis?
The self-hosted infrastructure line is the one teams underestimate most, because early sketches omit replicas, cross-zone traffic, backup storage, monitoring overhead, and non-production copies. Writing the self-hosted option in Terraform and pricing it with C3X captures the full resource set from the plan, so the build column reflects what would genuinely be deployed rather than an optimistic sketch.
What to do next
Price the self-hosted option properly, replicas and all. C3X prices the full Terraform plan against a live catalog. Start with the quickstart.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.