liveBook · Manning

Build-versus-buy decision

As explained in Crack Any Codebase with AI

Build-versus-buy is a software strategy choice between implementing functionality internally and obtaining it from existing components or vendors.

A build-versus-buy decision places the boundary between bespoke logic you must read and maintain and components you can configure, trust, or call. section 9.1

Use the service graph to estimate where a system draws that boundary:

  • Count nodes before reading functions; more custom-built nodes imply more bespoke logic to understand and maintain. section 9.1
  • Separate code you run and edit from vendor code you rent, call, or trust through public documentation. section 9.1
  • Inspect image-versus-build directives for a quick estimate of off-the-shelf versus custom components. section 9.1

Three architectural choices

PocketBase compresses the product into one Go binary; Cal.com uses two custom applications with Postgres and Redis; Supabase uses thirteen containers across seven languages. Their different node counts expose different build-versus-buy lines. section 9.1

Table 9.1 A classification of architectural nodes and edges
Term
What it is
Example
Why it matters
Node
A long-running program or service
A web server, Postgres, Stripe
The box that can fail
Edge
A wire between two nodes
A SQL query, an HTTP call, a queued job
The wire that times out
Run
Your code on your machine
Their own web app, their own worker
You can edit anything
Rent
Vendor code on your machine
Postgres, Redis, RabbitMQ
Configure only; no source edits
Call
Vendor code on a vendor's machine
Stripe, SendGrid, Twilio
Retry, cache, or route around
Client
Your code on a machine you don't operate
Browser frontend, mobile app, desktop app
Ship updates, no secrets, untrusted input
Sync edge
The user is waiting on it
Checkout → Stripe
The user feels its latency directly
Async edge
The user has already moved on
Queue → send confirmation email
The user never sees it; it can fail silently
Public edge
Crosses out to the open internet
A webhook from Stripe → you
The security boundary; this is where attackers knock
Internal edge
Between two of your own nodes
Web → Postgres
A network hop, but trusted; failure is the wire, not the user

Classify each architectural node as code you run, vendor code you rent, or a vendor service you call. section 9.1

How Crack Any Codebase with AI covers it

How deep it goes
Provides a graph-based heuristic using node counts, labels, and compose directives, but stops short of detailed economic analysis.
Examples
Compares PocketBase, Cal.com, and Supabase by custom applications, containers, languages, and supporting services.
What it assumes
Assumes basic familiarity with repositories and deployment configuration while introducing architectural nodes, edges, and ownership categories.
What you can do after
Evaluate a repository’s bespoke workload by mapping nodes, ownership, and build-versus-buy boundaries before reading implementation code.
How it connects
Connects build-versus-buy to architecture, service graphs, external APIs, vendor dependencies, and commodity infrastructure.

Also explained in

Compare how 4 books explain build-versus-buy decision →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Crack Any Codebase with AI. The section links point to the parts of the book it draws on.