Choose execution environments along the Buy vs Build spectrum: Containers, Kubernetes, Managed PaaS, and FaaS—balancing control, cost, and complexity.


1. Containerization (Docker and OCI)

Definition: Package application, dependencies, and config into an isolated image.

  • Portability: Run anywhere—local, on-prem, any cloud.
  • Immutability: Deploy immutable units vs mutable VMs.
  • Isolation: cgroups + namespaces for process/memory/network isolation.

2. Kubernetes (K8s) Orchestration

A. Key K8s Components

  • Pods: Smallest deployable unit; one or more tightly coupled containers.
  • Deployments: Desired state with rolling updates and rollbacks.
  • Services: Stable IP/DNS for dynamic Pods enabling discovery.

B. Advanced Concepts

  • Helm: Package manager using Charts for install/upgrade with templates.
  • Operators: App-specific controllers automating ops (backup, scaling, failover).
  • Service Mesh: Istio/Linkerd layer for traffic control, mTLS, and observability.

3. Kubernetes vs. Managed PaaS/FaaS

A. K8s (Self-Managed or Managed K8s)

  • Flexibility: Maximum control over networking, runtime, security; supports specialized workloads.
  • Operational Cost: Very High; requires Platform Engineering.
  • Cost Efficiency: High with dense utilization; poor for small/low-density apps.

B. Managed PaaS (e.g., ECS, App Service)

  • Flexibility: Medium; control container/runtime, vendor manages OS and orchestration.
  • Operational Cost: Medium; focus on app deployment.
  • Cost Efficiency: Good balance; ideal for teams avoiding K8s complexity tax.

C. FaaS (e.g., Lambda, Azure Functions)

  • Flexibility: Lowest; constrained runtime, ephemeral execution.
  • Operational Cost: Lowest; zero server management.
  • Cost Efficiency: Maximum for spiky/low-volume; costly for constant high throughput.
Characteristic Self-Managed K8s Managed PaaS FaaS (Serverless)
Vendor Lock-inLow (portable containers)MediumHigh (vendor APIs)
ControlFull OS + network controlContainer control; not hostFunction code only
Operational EffortHighest (dedicated Ops)LowLowest (near-zero)
Ideal ForLarge scale; custom networking; high utilizationDev velocity; common workloadsEvent-driven; variable traffic; minimize idle cost

Execution Environment Trade-offs

Heatmap score (1–5) across Flexibility, Control, Ops Effort (inverse), Cost Efficiency.