Skip to content
Tutorials Center
My learning

Topics

Lesson 33 of 40 ยท Architecture and Operations

Choosing a Platform: Build vs Buy

Compare hosted platforms, open-source shops, headless setups and custom builds. Weigh total cost, extensibility, migration effort and vendor lock-in with a clear decision method.

Sooner or later every shop project faces the question: do we use an existing platform, or write our own? Developers tend to lean toward building ("how hard can a cart be?"), and business owners tend to lean toward buying ("we just want to sell things"). Both instincts are partly right. The earlier lessons showed how much is hiding inside a shop: money handling, tax, inventory, promotions, payments, fraud, compliance. A platform has already paid for much of that work. A custom build pays for exactly what you need and nothing else.

This lesson gives you a way to decide, using questions you can answer, instead of loyalty to a tool. It names product families only as examples and makes no promises about current prices or feature lists; those change, and you should check them when you decide.

The options

Hosted (SaaS) platforms. You rent a shop. The vendor runs servers, security patches, checkout, PCI scope and uptime. You configure, pick a theme, and extend through apps and APIs within the vendor's rules. Shopify is the best-known example. See what a Shopify theme is for how customization works on such a platform. Fastest to launch, least operational burden, and the vendor decides what is possible, how the checkout behaves and what it costs as you grow.

Self-hosted open source. You install the software and run it, or pay a host to. WooCommerce (a plugin on WordPress, see the anatomy of a WordPress install) and Magento / Adobe Commerce (see the Magento introduction) are well-known examples. You get source access, a large extension market and almost unlimited changes. You also own hosting, upgrades, performance, security patches and extension conflicts.

Headless / composable. A commerce backend (hosted or self-hosted) with a custom front end, possibly with specialist services for search, content and checkout. See architecture and scaling. Maximum freedom over the experience, with the highest engineering cost.

Custom build. Your own code, usually on a framework, with libraries for payments, tax and search. Maximum control and the right fit for unusual business rules; the cost is that you must build and maintain everything, forever, including the unglamorous parts.

flowchart LR
  A["Hosted SaaS"] --> B["Self-hosted<br/>open source"] --> C["Headless /<br/>composable"] --> D["Custom build"]
  A -. "less control,<br/>less effort" .- B
  C -. "more control,<br/>more effort" .- D

A rough spectrum: moving right gives you more control and takes on more of the work.

What to compare

Total cost of ownership

The monthly fee is the smallest part of the price for many projects. Count everything over three to five years:

  • Platform fees: subscription, transaction fees, payment processing and fees for apps or extensions.
  • Build cost: design, theme or front-end development, integrations, data migration, content entry.
  • Run cost: hosting, monitoring, backups, CDN, search, email.
  • People: developers, a person who keeps extensions and security patches current, support.
  • Change cost: each new promotion type, market or integration.
  • Opportunity cost: weeks spent on a payment bug are weeks not spent on marketing.
JS Three-year cost comparison (your numbers go here)

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The numbers matter less than the shape: the hosted option is cheap to start and gets relatively more expensive as sales volume grows (if fees scale with revenue), while the custom option has a large entry cost and a stable run cost. Check where your expected revenue puts you on that curve, and run the calculation with pessimistic and optimistic assumptions.

Fit for your business rules

List the ten things that make your business unusual: subscription boxes, made-to-order products, B2B price lists, mixed digital and physical items, a marketplace with several vendors, regulated products, complex bundles. For each, ask: does the platform do this natively, with a maintained extension, with custom code on a supported extension point, or not at all? "Not at all" on a core capability is a deal-breaker; "custom code on a supported point" is a cost to estimate.

Extensibility and the edit-versus-extend rule

Look at how you change the platform. Good platforms offer events, hooks, APIs and clearly supported places to add code. Poor ones require editing core files, which makes every upgrade a merge conflict. Whatever you choose, extend rather than modify: keep your code in your own modules, and treat core files as read-only.

Performance, scale and operations

Ask who is responsible when the site slows down during a sale. On a hosted platform it is partly the vendor's problem, but you cannot tune what you cannot see. Self-hosted gives you the keys and the pager. Look for evidence of shops of your size and traffic profile on the platform, and for known limits (variants per product, products per catalog, API rate limits).

Ecosystem and people

Can you hire developers and agencies who know it? Are there maintained integrations for your payment provider, shipping carriers, ERP and tax service? A platform with a large ecosystem saves months; one with a tiny ecosystem makes everything a custom project.

Compliance and security

Who carries PCI scope, who patches vulnerabilities, where is data stored? See PCI and 3-D Secure and shop security. A hosted platform lets you inherit much of this; with other options you take it on.

Lock-in and migration

Every choice creates some lock-in. The question is how painful leaving would be, and you can reduce the pain from day one:

  • Can you export products, customers, orders and redirects in a documented format?
  • Does your URL structure survive a move? Plan 301 redirects from old URLs; they protect search ranking.
  • Do you keep your own copy of the critical data (orders, customer emails, product master) outside the platform?
  • Are your integrations written against a thin internal layer rather than the vendor's API everywhere?
  • Which parts are proprietary (themes, templating language, app data) and would have to be rebuilt?

Customer passwords are usually hashed and cannot be moved to a system with a different hashing scheme without a re-login or reset flow; plan for that. Order history, loyalty balances and subscription schedules are the hardest data to migrate correctly because they carry money and promises.

A simple decision method

Avoid choosing by feeling. Write the criteria, weigh them by importance, and score each option. The scores will not make the decision for you, but they expose what you disagree about.

JS A weighted decision matrix

Press Run (or Ctrl + Enter) to see the console output here.

No output.

If the top two options are within a few percent, the matrix says "either works". Then choose the one that is easier to reverse.

Common patterns that work

  • Start hosted, grow into extras. Launch fast, validate the business, and extend with apps. Move only when a concrete limit costs more than migrating.
  • Open source for complex catalogs and B2B when you need deep control and have the team to run it.
  • Headless for a unique experience at companies with front-end engineering strength and the need to serve several channels.
  • Custom for a product that is not really a standard shop, such as ticketing, rentals or configurable manufacturing, where the commerce rules are the business.

A frequent mistake is building a custom platform to avoid fees, then spending those savings, and more, on maintenance. The opposite mistake is forcing a rigid platform to do something it was never designed for, and living with fragile workarounds.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which cost is most often forgotten when comparing platforms?

    People, upgrades, security patches and change requests usually exceed the visible licence or hosting fee over several years.
  2. 2. What is the safest way to customize any platform?

    Core edits make upgrades painful. Supported extension points keep your code separate and upgradeable.
  3. 3. Which step best reduces future migration pain?

    Owning an exportable copy of critical data and keeping stable URLs (with redirects when needed) makes leaving possible without losing history or search ranking.
  4. 4. Your weighted matrix shows two options within a few percent. What should you do?

    A near-tie means either would do; reversibility is a good tiebreaker because it limits the cost of a wrong guess.

Summary

  • Options run from hosted SaaS through self-hosted open source and headless to a fully custom build: more control means more work.
  • Compare total cost over several years, including people and change cost, not just the subscription.
  • List what makes your business unusual and check whether each item is native, an extension, custom code or impossible.
  • Extend platforms through supported points; never edit core.
  • Reduce lock-in with exports, your own data copies, stable URLs and a thin integration layer.
  • Use a weighted matrix to expose assumptions, and break near-ties by choosing the more reversible option.

Time to put the pieces together. The first project combines cart, promotions, tax and order creation in Project: A Complete Order Engine.