Build vs Buy
The decision
The build vs buy decision asks whether a software capability should be developed in-house or acquired through a commercial product, SaaS platform, or open-source solution. It is one of the most consequential decisions in software architecture because it determines where engineering effort is invested, what can be customized, and which parts of the system create strategic differentiation versus commodity utility.
This decision is not binary. The spectrum runs from fully custom-built software to fully managed SaaS, with open-source self-hosted and cloud-managed services in between. Building gives maximum control and customization at the cost of engineering investment and ongoing maintenance. Buying provides immediate capability at the cost of recurring subscription fees, integration effort, and dependency on a vendor's roadmap and reliability.
The central question is whether the capability is a source of competitive advantage. If every e-commerce company needs a payment processing system and the unique value of your business comes from your product selection and user experience—not your payment processor—then building a custom payment system is not a strategic investment. Conversely, if your recommendation engine is why users choose you over competitors, buying a generic recommendation SaaS surrenders that advantage.
Why it matters
Engineering time is the scarcest resource in most organizations. Every hour spent building and maintaining infrastructure that is not core to the business is an hour not spent on the product. The opportunity cost of building authentication, billing, email delivery, monitoring, and search from scratch is enormous—not just for initial development but for the ongoing burden of security patches, scaling, and feature requests from internal users who want parity with best-in-class commercial solutions.
Total Cost of Ownership (TCO) is consistently underestimated for build decisions. The initial development cost is visible; the hidden costs are not. Maintenance overhead: every line of code has a carrying cost in debugging, updates, and documentation. Security liability: custom authentication code or payment processing without PCI DSS compliance is a security and regulatory risk. Talent dependency: specialized internal systems require institutional knowledge that walks out the door when key engineers leave.
Vendor risk is the counterbalancing concern for buy decisions. A vendor that raises prices 300% after you've built critical workflows on their API is a crisis. A SaaS company that shuts down with 90 days notice, taking years of workflow configuration with them, creates migration emergencies. API changes that break integrations introduce unplanned engineering work. Understanding vendor risk—financial stability, contract terms, data portability, API stability guarantees—is part of the buy decision, not an afterthought.
Choose Buy (SaaS/Off-the-shelf) when
- The capability is commodity infrastructure—authentication, email delivery, error monitoring, analytics, billing
- Your engineering team is small and cannot afford to maintain additional systems beyond core product
- The problem is solved well by existing solutions and building custom provides no competitive advantage
- Compliance requirements (PCI DSS, SOC 2, HIPAA) are satisfied by the vendor, reducing your own compliance burden
- Time-to-market is critical and building would delay launch by months
- The vendor provides integrations, support, and updates that would require dedicated engineers to replicate
- Usage-based pricing makes the vendor cost lower than the equivalent engineering allocation
Choose Build when
- The capability is a core competency and source of competitive differentiation
- Requirements are unique enough that commercial solutions require so much customization that you effectively build on top of them anyway
- Data sovereignty, security, or regulatory requirements prevent using external services for sensitive data
- The vendor's pricing model becomes untenable at your scale—usage-based costs that make sense at $1M ARR may be unsustainable at $100M ARR
- You need full control over the roadmap and cannot wait for a vendor to build features you require
- Long-term TCO analysis shows building is cheaper than vendor costs at projected scale
Comparison
BUILD VS BUY DECISION TREE
════════════════════════════════════════════════════════════
Is this capability core to your competitive advantage?
│
┌─────────┴─────────┐
YES NO
│ │
→ BUILD Does a commercial solution
solve it well enough?
│
┌──────────┴──────────┐
YES NO
│ │
Does vendor cost → BUILD (or
exceed build cost open-source)
at projected scale?
│
┌─────────┴─────────┐
YES NO
│ │
Analyze TCO Do you have data
carefully sovereignty concerns?
│
┌───────────┴───────────┐
YES NO
│ │
→ BUILD → BUY
TOTAL COST OF OWNERSHIP COMPARISON
════════════════════════════════════════════════════════════
BUILD BUY / SaaS
──────────────────────────── ────────────────────────────
Initial dev: HIGH Initial dev: LOW (integration)
Maintenance: HIGH (ongoing) Maintenance: LOW (vendor owned)
Security patches: YOU Security patches: VENDOR
Compliance certs: YOU Compliance certs: VENDOR
Scaling: YOU Scaling: VENDOR
Uptime SLA: YOU Uptime SLA: VENDOR
Feature parity: YOUR ROADMAP Feature parity: VENDOR ROADMAP
Data ownership: FULL Data ownership: SHARED/VENDOR
Customization: UNLIMITED Customization: LIMITED
Lock-in: YOUR STACK Lock-in: VENDOR API/FORMAT
Hidden BUILD costs: Hidden BUY costs:
• On-call burden • Price increases at scale
• Recruiting specialized talent • API breaking changes
• Documentation & training • Vendor acquisition/shutdown
• Security audit scope • Integration maintenance
• Opportunity cost • Data portability limits
Trade-offs
Buy strengths
- Immediate capability: production-ready solution in days rather than months of development
- Vendor absorbs operational burden: scaling, security updates, compliance, infrastructure
- Best-in-class features from a team focused entirely on that problem domain
- Predictable cost model (subscription) rather than unpredictable build cost
Buy weaknesses
- Vendor lock-in: migrating away after deep integration is costly and time-consuming
- Limited customization: vendor's solution may be 80% fit, requiring workarounds for the other 20%
- Recurring cost that scales with usage—can become the dominant infrastructure cost at scale
- Data sovereignty concerns: sensitive data processed or stored by a third party creates compliance and security exposure
Implementation considerations
When buying, always build an abstraction layer between your application code and the vendor's API. Instead of calling Stripe directly throughout your codebase, define a PaymentProvider interface and implement it with a Stripe adapter. This single decision makes vendor migration from months of work to weeks. It also enables testing with mock implementations and allows you to swap providers for specific use cases (e.g., switching to Braintree for certain geographies). The abstraction cost is low; the flexibility benefit is high.
Evaluate open-source as a third path between build and buy. Self-hosting open-source software gives you control over the code and eliminates vendor dependency, but you assume the operational burden. The cloud-managed variant (e.g., ElasticSearch managed by Elastic Cloud, or Kafka managed by Confluent) adds a support layer. Many organizations self-host open-source for cost or sovereignty reasons, accepting the operational investment as preferable to vendor lock-in.
For critical buy decisions, negotiate contract terms that protect against the most common failure modes. Data export rights: you must be able to export your data in a usable format if you need to migrate. API stability commitments: what notice period is given before breaking API changes? Pricing guarantees: do prices change only at contract renewal, or can they change at any time? Acquisition clauses: if the vendor is acquired, what protections apply? These negotiations are much more effective before signing than after integration dependency is established.
Common mistakes
- Underestimating build TCO: Counting only initial development cost ignores the 5-10x maintenance cost over the system's lifetime; include on-call burden, security patches, and opportunity cost in the analysis.
- Building commodity infrastructure: Building custom authentication, email delivery, or error monitoring when mature solutions exist wastes engineering resources on problems already solved better by specialists.
- No abstraction on bought services: Coupling application code directly to vendor APIs makes migration catastrophically expensive and creates a single vendor dependency throughout the codebase.
- Ignoring scale economics: A SaaS priced per API call that costs $5k/month at current scale may cost $500k/month at 100x scale; model vendor costs at projected scale before committing.
- Not evaluating data portability: Discovering after 18 months that your data is effectively locked in a proprietary format is a crisis; always verify data export capabilities before signing.
Decision checklist
- Is this capability a source of competitive differentiation, or is it commodity infrastructure?
- What is the fully-loaded TCO of building (including maintenance, security, on-call) compared to the vendor's projected cost at 2x and 10x current scale?
- Does the commercial solution handle compliance requirements (SOC 2, PCI DSS, HIPAA) that you would otherwise need to achieve independently?
- Can you negotiate data export rights and API stability commitments with the vendor?
- Will you build an abstraction layer to avoid direct vendor coupling throughout your codebase?
- What is the migration cost if you need to leave this vendor in two years?
- Does your team have the specialized expertise to build, operate, and maintain this capability at the required quality level?
Real-world examples
- Stripe for payments: Almost every technology company buys payment processing rather than building it. The complexity of PCI DSS compliance, fraud detection, global payment methods, and settlement is enormous. Stripe's API and compliance certifications represent years of specialized investment that any individual company would struggle to replicate—a clear case where buying is overwhelmingly correct.
- Airbnb's search: Airbnb initially used Elasticsearch for property search but eventually invested in a custom search platform because their ranking requirements (combining price, availability, quality signals, user preferences, and geographic constraints) were sufficiently unique and core to their business that the commercial solution could not provide the control they needed for continuous optimization.
- Netflix's CDN: Netflix built its own CDN (Open Connect) rather than relying entirely on commercial CDNs. At their scale, the cost savings from owning the infrastructure were enormous, and CDN performance was directly tied to their core value proposition. A smaller streaming company would reach the opposite conclusion—the scale required to justify a custom CDN is extraordinary.
Related decisions
- Cloud Provider Selection — the largest build vs buy decision: own data centers or use cloud
- Vendor Lock-in Anti-Pattern — how to structure buy decisions to preserve optionality
- Monolith vs Microservices — microservices often increase the surface area of buy decisions
- Governance — vendor management and third-party risk governance frameworks