Git Branching Strategy: Trunk-Based vs GitFlow for Teams
Trunk-based development or GitFlow? Compare Git branching strategies for outsourced and offshore teams, with a decision table and rules that keep releases safe.
API rate limiting and throttling explained: algorithms, limit design, response headers and monitoring, so your API stays fast and fair as traffic grows.
Every public or partner-facing API eventually meets a client that sends too much traffic: a buggy retry loop, an over-eager integration, a scraper or simply a customer who grew faster than expected. Without limits, one noisy client can slow the service for everyone else. Rate limiting is how you keep an API predictable, fair and affordable to run.
This guide is for CTOs, founders and product managers who need to decide what to limit and why, before their engineers (in-house or outsourced) decide how.
The two terms are often used interchangeably, but they behave differently:
Most production APIs combine all three: a short-window rate limit to protect the system, plus a quota to match the commercial plan.
| Algorithm | How it works | Good for | Watch out for |
|---|---|---|---|
| Fixed window | Count requests per clock window (e.g. per minute) | Simplicity | Bursts at window edges can double the effective rate |
| Sliding window | Counts requests over a rolling period | Smoother, fairer limits | Slightly more storage and computation |
| Token bucket | Tokens refill at a steady rate; each request spends one | Allowing short bursts while capping average rate | Needs sensible bucket size and refill rate |
| Leaky bucket | Requests drain from a queue at a constant rate | Smoothing traffic to a fragile backend | Queued requests add latency |
| Concurrency limit | Caps simultaneous in-flight requests | Expensive endpoints such as reports or exports | Needs careful timeouts so slots are released |
For most business APIs, a token bucket or sliding window is a sensible default. Use a concurrency limit on heavy endpoints.
A single global number is rarely right. Decide the key and the scope deliberately:
If you run a multi-tenant product, tenant-level limits matter even more; our SaaS multi-tenancy guide covers the isolation questions that go with them.
Good limits are predictable. When a request is rejected, return HTTP status 429 Too Many Requests and, ideally, a Retry-After header that says how long to wait. Many APIs also expose headers showing the limit, the remaining allowance and when it resets. The exact header names vary by provider, so pick a convention and document it.
Your error body should be clear and machine-readable, with a message a developer can act on. Publish the limits in your API documentation, including how clients should back off. Recommend exponential backoff with jitter so thousands of clients do not retry at the same instant.
Decide what happens if the limiter itself fails. Failing open keeps the service available but unprotected; failing closed protects the backend but may block legitimate users. The right answer depends on the endpoint, and it should be a conscious choice, not an accident.
Limits are a product setting, not a one-time configuration.
429 responses with Retry-After and clear error messagesRate limiting touches the gateway, the application code, the data store, documentation and monitoring, so it benefits from a team that treats it as one piece of work. AkMo Technologies designs and builds APIs and web platforms for international clients; see our web development services or contact us to discuss an API that needs to scale safely.
Trunk-based development or GitFlow? Compare Git branching strategies for outsourced and offshore teams, with a decision table and rules that keep releases safe.
Monorepo or polyrepo? Compare code repository strategies for web, mobile and backend products, with a decision table and tips for outsourced teams.
How to version and retire APIs without breaking clients: versioning options, breaking-change rules, sunset policies and a checklist for outsourced teams.
Tell us about your platform, your product idea or the systems you want to modernise. Someone from our Chennai engineering team will get back to you personally.