Skip to main content
RLaaS Users Service is a Spring Boot microservice that acts as a pluggable rate-limiting gateway. Every incoming HTTP request is intercepted, checked against a per-user Redis counter, and either allowed through or rejected with an HTTP 429 response containing a retry hint. Switch between Fixed Window and Sliding Window algorithms by changing a single configuration property in application.yaml and restarting the service.

Quickstart

Deploy the service and make your first rate-limited request in minutes.

Configuration

Set your algorithm, window size, max requests, and Redis connection.

Rate Limiting Concepts

Understand how per-user rate limiting works and when to apply it.

API Reference

Full reference for the /check endpoint, parameters, and responses.

How it works

1

Request arrives

A client sends GET /check?userId=alice to the service.
2

Filter intercepts

RateLimiterFilter extracts the userId and calls the active rate-limiting algorithm before any controller logic runs.
3

Atomic Redis check

A Lua script runs atomically on Redis — either incrementing a counter (Fixed Window) or pruning and counting a sorted set (Sliding Window).
4

Allow or deny

If within the limit, the request proceeds and returns 200 OK. If the limit is exceeded, the service immediately returns 429 Too Many Requests with a message indicating when the window resets.

Key features

Two algorithms

Choose Fixed Window for simplicity or Sliding Window for accurate rolling limits — switchable via config.

Atomic enforcement

Lua scripts execute atomically on Redis, preventing race conditions under high concurrency.

Per-user isolation

Each userId gets its own Redis key and independent counter, ensuring fair limits across users.

Observability built-in

Prometheus scrape endpoint and OTLP push to Grafana Cloud are configured out of the box.

Build docs developers (and LLMs) love