ASP.NET Core

Rate Limiting in Vineforce Teams: Designing Dynamic API Policies on ASP.NET Core

DEV Community: #dotnet Harsh Gupta
ASP.NET Core

Vineforce Teams inherits ASP.NET Zero's dynamic rate limiting, where policies live in the database rather than in Program.cs or appsettings.json and take effect at runtime without a restart. The article explains how a request is matched to a policy and how to choose between the four limiter algorithms without throttling legitimate users.

Key points

  • Dynamic rate limiting is wired with `AddDynamicRateLimiting()` and `UseRateLimiter()`, with policies cached and loaded from the database.
  • Matching order: an endpoint-pattern policy wins, otherwise the first global policy applies; a request is never counted twice.
  • Four algorithms ship in `System.Threading.RateLimiting`: Fixed Window, Sliding Window, Token Bucket and Concurrency.
  • If the database is unreachable the feature fails open, so a database outage silently removes throttling.
  • Without `UseForwardedHeaders()` behind a reverse proxy, every IP partition collapses into one shared counter.
  • Counters live in process memory, so 3 instances with a limit of 100 allow up to 300 requests per window.

Real-world use

  • A multi-tenant time-tracking API where hundreds of employees share one office egress IP
  • Desktop agents replaying a backlog after reconnect, bounded by a token bucket
  • Report generation and bulk exports protected by a per-user concurrency limit
  • Anonymous `/api/TokenAuth/*` endpoints slowed down with a per-IP fixed window against credential attacks

This summary was generated by the agent from the original post on DEV Community: #dotnet. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message