# Elasticity

Elasticity is the ability of a computing system to automatically provision and deprovision resources in response to changing demand. An elastic system scales out (adds resources) during traffic spikes and scales in (removes resources) when demand decreases, optimizing both performance and cost.

Elasticity differs from scalability in an important way: scalability is the capability to handle increased load, while elasticity is the ability to do so automatically and dynamically. Elastic systems are typically cloud-based, leveraging the on-demand nature of cloud infrastructure to adjust capacity without manual intervention.

Serverless platforms provide inherent elasticity. Functions are invoked on demand and scale automatically with the number of incoming requests, with no pre-provisioned capacity. API gateways deployed on serverless platforms like Cloudflare Workers inherit this elasticity, handling traffic ranging from zero to millions of requests without capacity planning. This pay-per-use model eliminates over-provisioning costs while ensuring availability during unexpected traffic surges.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.serverlessapigateway.com/glossary/e/elasticity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
