
May 23, 2026
Notification System in Web Apps (Email/SMS/WhatsApp)
notification system in web apps: practical 2026 guide with features, INR pricing, roadmap, tech stack, mistakes, FAQs, and Indian SME tips today safely.
Read articlePublished Updated
Design API rate limits using identities, scopes, algorithms, quotas, retries, distributed counters, monitoring, exceptions, and abuse-resistant testing.

API rate limiting controls how much work a client, user, tenant, key, device, or network can request during a defined period. It protects service capacity, limits accidental loops, reduces abuse, and creates fair usage boundaries. It is not a replacement for authentication, authorization, input validation, fraud controls, or infrastructure scaling.
A useful limit reflects the cost and risk of the operation. Login attempts, search queries, PDF exports, file uploads, bulk imports, payment actions, and webhook retries should not all share one arbitrary number.
OWASP includes unrestricted resource consumption in its API Security Top 10, which is a useful reminder that limits should cover compute, memory, storage, network, third-party spend, and operational impact.
A complete rule needs five parts:
“100 requests per minute” is incomplete until the system states whether that is per IP, account, API key, tenant, endpoint, or global service.
Possible identifiers include:
IP-only limiting is weak for authenticated business APIs. Many legitimate users can share one corporate or mobile network, while an attacker may rotate addresses. After authentication, use account, key, or tenant identity where possible while retaining network controls for abuse at the edge.
A production system often needs several simultaneous controls:
| Layer | Example purpose |
|---|---|
| Global | Protect total service capacity during an incident |
| Tenant | Prevent one company from consuming shared capacity |
| User/key | Enforce fair use and contain compromised credentials |
| Endpoint | Protect expensive routes such as exports or search |
| Resource | Prevent repeated actions against one invoice, OTP, or account |
| Concurrency | Limit simultaneous expensive jobs |
| Volume | Limit upload bytes, rows, recipients, or generated documents |
The effective allowance can be the strictest applicable rule. Document precedence so support teams can explain blocked requests.
A fixed-window counter tracks requests within a clock period such as one minute. It is simple and inexpensive, but traffic can burst across a boundary: a client may use the full allowance just before and just after the reset.
Use it when:
Do not rely on it alone for sensitive authentication or high-cost operations.
A sliding-window model considers recent activity relative to the current time. It produces a fairer limit across boundaries but needs more storage or approximation.
Variants include:
Choose based on required accuracy, throughput, and storage cost. Exact per-request logs may be excessive for high-volume traffic.
A token bucket refills at a defined rate up to a maximum capacity. Each request consumes one or more tokens. It allows controlled bursts while enforcing a sustainable average.
Example:
Weighted tokens are useful when operations have very different cost, but weights must be measured and reviewed.
A leaky-bucket style design processes work at a controlled output rate. It can smooth bursts into a queue but introduces waiting and requires queue-capacity rules.
For background exports or imports, a concurrency limit and queue may be better than rejecting every burst. The system still needs maximum queue size, job expiry, cancellation, status visibility, and tenant fairness.
Combine controls by account, IP/network, device signal, and global anomaly. Avoid creating an account-enumeration response. Add progressive delay, risk review, MFA, and alerts where appropriate.
Limit sends by destination, account, device, and network. Separately limit verification attempts. Record expiry, resend state, provider response, and lockout recovery. Do not expose whether an unregistered phone or email exists.
Apply user or tenant limits, query complexity controls, maximum page size, and database safeguards. Cache safe repeated results where useful.
Count request frequency, file size, total storage, processing concurrency, and content-validation cost. Rate limiting does not replace malware scanning, type checks, and authorization.
Use per-user and per-tenant concurrency, duplicate-job detection, date-range limits, and queue status. Reuse an existing completed artifact when policy allows.
Protect the endpoint but prioritise idempotency. A client retry should not create a second charge or order. Rate limits are not transaction deduplication.
When a request exceeds a policy, the API commonly returns HTTP 429 Too Many Requests. The response should be consistent and safe.
Include where appropriate:
Clients should use exponential backoff with jitter and respect server guidance. Immediate tight retry loops increase the problem.
Rate limits affect retry behavior. For state-changing requests:
The webhook integration guide explains similar duplicate and retry controls for event-driven systems.
One in-memory counter works only for one process. Multi-instance deployments need shared or coordinated state.
Design questions include:
Redis is common, but the technology does not choose the policy. Use atomic operations or tested scripts and consider fail-open versus fail-closed per endpoint risk.
If the counter store is unavailable:
Authentication, payments, public reads, and internal reports may need different decisions. Document and test the behavior.
SaaS products may offer different usage plans. Keep commercial quotas separate from emergency abuse protection.
For example:
Customers need usage visibility before a commercial quota is exhausted. Billing enforcement should not depend on an undocumented security limiter.
An API that allows 100 requests per second can still overload a database if each request performs an unbounded query. Add:
Use the database indexing guide when slow data access is the underlying bottleneck.
Track:
429 ratio;Do not log raw secrets, tokens, OTPs, or unnecessary personal data. Use hashed or internal identifiers where operationally suitable.
Some integrations need higher limits. An override process should include:
Permanent unlimited bypasses create hidden risk. For large transfers, offer an asynchronous bulk endpoint instead of raising interactive request limits indefinitely.
Test more than the first blocked request:
Load tests should use a safe non-production environment and agreed capacity. Do not test third-party providers beyond authorised limits.
In our implementation work, VASUYASHII defines limits from resource cost and business risk. We map authenticated identity, tenant boundary, endpoint weight, concurrency, retry behavior, and support overrides before choosing a counter algorithm.
Our API integration service also checks provider limits, webhook retries, idempotency, and reconciliation. For a custom web application, rate-limit telemetry is connected to operational monitoring so legitimate customers are not silently blocked.
429 without retry guidance.429 response and client retry contract are consistent.There is no universal number. Measure endpoint cost, normal client behavior, peak volume, tenant fairness, third-party limits, and abuse risk, then load-test a conservative policy.
Use layered identities. IP controls help before authentication, while user, API-key, tenant, and resource limits are usually more accurate after authentication.
It is the standard response for too many requests and makes client behavior clearer. The complete contract should also define error codes, headers, and retry handling.
It can handle valuable edge and global controls, but application-level limits may still need authenticated user, tenant, resource, plan, and business-operation context.
Application rate limiting is one control, not complete DDoS protection. Use provider edge protection, network controls, capacity planning, and incident response as appropriate.
The app should queue or back off safe retries, show a useful state, avoid duplicate actions, and respect server guidance. Do not embed secret bypass keys in the app.
Inventory the ten most expensive or sensitive endpoints and define identity, cost unit, burst, sustained rate, concurrency, and failure behavior for each. Contact VASUYASHII for an API and integration review tied to real traffic and business risk.
Related Articles

May 23, 2026
notification system in web apps: practical 2026 guide with features, INR pricing, roadmap, tech stack, mistakes, FAQs, and Indian SME tips today safely.
Read article
May 24, 2026
purchase sales module ERP: practical 2026 guide with features, INR pricing, roadmap, tech stack, mistakes, FAQs, and Indian SME tips today safely for SMBs.
Read article
May 20, 2026
Reduce contact-form spam with accessible fields, server validation, honeypots, rate limits, server-side bot checks, safe delivery, privacy, and lead tracking.
Read article
May 17, 2026
Plan role-based access control for business software with permissions, least privilege, approval rules, audit logs, testing, and scalable role design.
Read article