A dead-simple heuristic for infrastructure decisions when your team is two engineers and your runway is measured in months, not years.

The Core Heuristic

If a service failure would stop you from taking money or logging users in, pay a managed provider until you have dedicated infrastructure staff. If a service failure would corrupt your understanding of the business itself—your data, your state, your queues—run it yourself from day one. This is not about cost optimization; it is about control over the variables that kill companies.

Managed providers absorb pager duty for commodity problems. Self-hosted systems preserve your ability to debug and migrate when the commodity abstraction leaks. The trick is knowing which category you are in before the 3 a.m. page.

Always Managed: Auth, Billing, Email Delivery

Identity is the most dangerous thing to self-host. A misconfigured OAuth flow or a slow-burn token leak does not announce itself. It waits. Use a managed identity provider, enforce SSO for your own admin access, and rotate your service keys quarterly. You are not in the business of cryptography; your customers are not your penetration testers.

Billing infrastructure faces the same calculus. Subscription state machines, proration logic, tax jurisdiction handling, and dunning management are not features—they are entire disciplines with regulatory teeth. A buggy invoice does not just annoy finance; it breaches customer trust in a way that is hard to rebuild. Hand this off until billing is someone’s full-time job.

Email delivery sits adjacent: deliverability is a reputation game you cannot afford to lose while establishing sender history. Use a transactional email provider with dedicated IPs, configure SPF and DKIM correctly once, and monitor bounce rates. Do not run your own SMTP relay.

Always Self-Hosted: Primary Database, Job Queue, Search Index

Your primary database is your most critical dependency and your most dangerous blind spot. Managed databases abstract failover and patching admirably, but they also obscure query plans, lock contention, and the true shape of your access patterns. Run PostgreSQL yourself on a provider you can shell into. Learn pg_stat_statements before you have a performance crisis. You will need that fluency when the ORM generates its first catastrophic N+1 at scale.

Background job queues are equally non-negotiable for self-hosting. A lost job is silent data corruption. Visibility into retry behavior, dead-letter composition, and queue depth is operational intelligence, not an infrastructure luxury. Redis or RabbitMQ on your own VPC gives you tcpdump when a job disappears. Managed queue services optimize for throughput you do not yet have and hide the failure modes you most need to see.

Search indexing follows the same logic. Elasticsearch or its successors fail in predictable ways once you understand their memory pressure and merge behavior. Managed search services throttle and bill by query volume, which creates a perverse incentive to degrade search quality rather than optimize indexing strategy.

The Gray Zone: Object Storage, CDN, Containers

Object storage is a solved problem and safe to delegate to any major provider. The S3 API is the abstraction; the implementation detail of whose disks hold your objects is not your differentiator. Use lifecycle policies aggressively. Glacier or cold tiers for backup data cost fractions of active storage and prevent the invoice shock that kills bootstrapped budgets.

CDNs are similarly commoditized, but with one caveat: cache invalidation behavior affects your deployment velocity. Choose a provider with programmable edge rules and test your purge paths before you need them in an incident. Do not run your own Varnish cluster. Edge caching is a solved problem; cache poisoning and stale content at scale are not problems you want to discover alone.

Container orchestration is where opinions fracture. For a two-engineer team shipping this quarter, use a managed container service or even platform-as-a-service that handles scheduling and load balancing. Kubernetes is not a month-one technology for teams without a platform engineer. The migration path from managed containers to self-managed orchestration is well-trodden when you have the headcount to justify it.

Observability: The Non-Negotiable Minimum

Every service you run—managed or self-hosted—must emit structured logs and metrics to a system you control. Do not rely on a managed provider’s dashboard as your sole source of truth. Ship logs to a central aggregator, define three golden signals for every critical path, and page on user-facing latency before you page on infrastructure saturation.

This minimum buys you the most precious resource in early SaaS: the ability to distinguish between a code bug, a dependency failure, and a configuration drift without relying on vendor status pages that lag reality by minutes. Minutes are transactions. Minutes are sessions. Minutes are the window where a small problem becomes a trust-destroying outage.

The Deviation Condition

If you have raised a substantial seed round and hired a senior platform engineer with proven on-call experience, broaden the self-hosting perimeter. If you are pre-revenue and one engineer is splitting time between product and infrastructure, shrink it aggressively. The heuristic is control over business-critical state, not operational virtue signaling.

Get new articles

Practical systems for shipping SaaS, straight to your inbox. No spam.



One email per new article. Unsubscribe any time.