Wiki › Tier 1

Infrastructure & Deployment

267 bookmarks · Last synthesized May 20, 2026

Infrastructure & Deployment

Efficient infrastructure management and robust deployment pipelines are critical to modern software engineering. By treating infrastructure with the same rigor as application code, organizations can improve deployment speed, system reliability, and developer productivity.


The Value of Infrastructure Literacy

Understanding the underlying infrastructure is not just the responsibility of specialized operations teams.
* For Developers: A basic understanding of infrastructure is highly beneficial for developers, even if they are not directly involved in setting up the environment.
* Incident Response: Knowledge of infrastructure is incredibly useful for troubleshooting production incidents quickly and effectively.


Infrastructure as Code (IaC) vs. Manual Deployment

Adopting Infrastructure as Code (IaC) enables organizations to manage their environments efficiently, though manual processes still exist.

  • Efficiency & Costs: While manual deployment of infrastructure usually takes only a few minutes, it can ultimately be more time-consuming and costly in the long run than maintaining infrastructure as software.
  • Manageability: IaC allows developers to manage project infrastructure with high efficiency, making deployments quick, easy, and repeatable.
  • Repository Organization: A common convention for managing IaC is naming the root directory of the infrastructure repository infrastructure/.
  • Module Structure: For maintainability, Terraform configurations should be separated into root modules (for managing environment-specific deployments like staging and production) and resource modules (for reusable infrastructure components). Each module folder should contain:
    • main.tf (core resources)
    • variables.tf (inputs)
    • outputs.tf (outputs)
    • README.md (documentation)

Deployment Best Practices & System Resilience

To maintain high availability and quickly recover from failures, deployment frameworks should incorporate the following patterns:

  • Modular Design: Utilizing smaller modules makes infrastructure significantly faster to deploy.
  • Decoupling: Separating business logic from build infrastructure leads to quicker overall deployment of the infrastructure.
  • Outage Response: Having a formal deployment framework is essential for responding nimbly to service outages.
  • Disaster Recovery: Maintaining standby infrastructure allows for swift rollbacks in the event of a failed deployment or critical issue.
  • Stateful vs. Stateless Isolation: Critical stateful resources (like databases) must be managed separately from stateless compute resources. Keeping them in separate state files or directories ensures that compute failures or redeployments do not risk accidental database loss.
  • Network Isolation: Shared network resources should be kept in a dedicated common directory to avoid rebuilds during app deployments.

Multi-Tier Infrastructure Blueprints

A standard production-grade infrastructure deployment must securely isolate its components into distinct layers and scale them appropriately to handle demand.

1. Networking Layer

  • Public Subnets: Host the Application Load Balancer (ALB) to accept public web traffic.
  • Private Subnets: Host stateless compute nodes and stateful databases, protecting them from direct internet exposure.

2. Stateful Database Layer

  • Protection: Database configurations (such as RDS) must enable deletion protection to prevent accidental data loss.
  • Integration: The database module must output its endpoint address and port so that compute resources can programmatically establish connections.
  • Horizontal Scaling & Clustering (Vitess): At hyper-scale (e.g., YouTube's infrastructure supporting billions of users), traditional monolithic relational databases face scaling ceilings. Utilizing a clustering system like Vitess enables horizontal scaling of MySQL via database sharding. Vitess acts as a proxy, abstracting complex sharding logic and presenting a unified SQL interface to application code while managing connection pooling, query optimization, and automated failover.

3. Stateless Compute Layer

For containerized applications deployed on Kubernetes (EKS):
* Cluster Prerequisites: A minimal setup requires a unique cluster name and at least one node group definition.
* High-Availability Baseline: Standard production setups (such as thoughtbot's Flightdeck platform engineering configuration) utilize a baseline node group of t3.large instances with a minimum node size of 2.


Hybrid Tooling Workflows

Using specialized tools for different parts of the lifecycle reduces cloud provider lock-in and simplifies deployment complexity.

  • Provisioning vs. Deployment: Organizations can split responsibilities by using Terraform to provision the physical, underlying network and virtual machines, while using a dedicated software delivery tool to deploy containers.
  • Kamal Deployments: Kamal (an open-source, Docker-first tool developed by 37signals) operates as an agentless deployment engine over SSH. It bridges the provisioning-deployment gap by reading VM IP addresses directly from Terraform outputs to deploy application containers without vendor lock-in.

Build Infrastructure & Developer Experience

Optimizing the systems that compile and test code directly impacts both the engineering organization and end users.

  • Proactive Testing: Catching build infrastructure issues before deployment improves both developer productivity and the final user experience.
  • Build-as-a-Service: Providing build-as-a-service abstracts away complexity, ensuring that end users do not have to worry about managing the underlying infrastructure.

Source Tags

Research Conversations

Synthesis

Last run May 20, 2026

Research

Research this page →

Opens a new conversation pre-loaded with 20 bookmarks.