Elastic Computing

The ability of a cloud infrastructure to automatically provision and de-provision computing resources (servers, containers, functions) in response to real-time workload demand — paying only for what is used.

In blockchain infrastructure, elastic computing is critical for indexer nodes, RPC providers, and event-driven smart contract listener services that must absorb sudden traffic spikes during NFT mints, token launches, or network congestion events.

        graph LR
  Center["Elastic Computing"]:::main
  Rel_scalability["scalability"]:::related -.-> Center
  click Rel_scalability "/terms/scalability"
  Rel_data_modeling["data-modeling"]:::related -.-> Center
  click Rel_data_modeling "/terms/data-modeling"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧠 Knowledge Check

1 / 5

🧒 Explain Like I'm 5

Imagine a restaurant that can magically grow or shrink its kitchen based on how many customers arrive. On a slow Tuesday, the kitchen has 2 chefs. On a busy Saturday night, it instantly has 20 chefs. You only pay the chefs for the hours they actually cook. Elastic computing is this magic kitchen for software — the cloud automatically adds more 'chef-computers' when your app gets busy, and removes them when traffic drops, so you're never paying for idle kitchens.

🤓 Expert Deep Dive

Auto Scaling Group (ASG) Mechanics
AWS ASGs use launch templates and scaling policies. Target Tracking Scaling targets a specific metric value (e.g., keep average CPU at 60%). Step Scaling responds to CloudWatch alarms with predefined step adjustments. The cooldown period (default 300s) prevents thrashing — rapid scale-in/out oscillation. Scale-in protection can be set on specific instances (e.g., instances running long batch jobs).

Kubernetes HPA v2
HPA queries the Metrics Server every 15 seconds (default). It calculates the desired replica count as: desiredReplicas = ceil[currentReplicas * (currentMetricValue / desiredMetricValue)]. HPA v2 supports custom metrics (e.g., scale based on requests-per-second from an Ingress) and external metrics (e.g., SQS queue depth). The HPA stabilization window (default 5 min for scale-in) prevents flapping.

Serverless Cold Starts
AWS Lambda maintains a pool of warm execution environments. After ~15 minutes of inactivity, environments are frozen. A new invocation to a frozen environment triggers initialization: downloading the deployment package, starting the runtime, and executing init code. Mitigations: Provisioned Concurrency (pre-warms N environments, billed continuously), SnapStart (for Java, snapshots the initialized state), and keeping functions warm via scheduled pings.

Cost Model
Elasticity only saves money if the workload has significant variance (peak:trough ratio > 3x). Flat, predictable workloads are often cheaper on reserved instances (1 or 3-year commitments). Spot/preemptible instances (up to 90% cheaper) are ideal for fault-tolerant, interruptible elastic workloads.

❓ Frequently Asked Questions

What is the difference between elastic computing and auto-scaling?

Auto-scaling is the specific mechanism (adding/removing servers based on metrics). Elastic computing is the broader principle — the cloud infrastructure's ability to match capacity to demand dynamically. Auto-scaling is one implementation of elasticity.

What is a 'cold start' in serverless computing?

A cold start occurs when a serverless function (like AWS Lambda) is invoked after its execution environment has been idle and deallocated. The cloud must provision a new environment, load the runtime, and run initialization code before the function logic executes, adding 100ms–1s of latency.

Is elastic computing always cheaper than fixed infrastructure?

No. Elasticity saves money for workloads with high variability (e.g., e-commerce sites with day/night cycles). For flat, predictable workloads, reserved instances with 1-3 year commitments are typically 40–60% cheaper than on-demand elastic pricing.

📚 Sources