RJRohit Jarariya
  • About
  • Projects
  • Experience
  • Research
  • Skills
  • Blog
Contact
  • About
  • Projects
  • Experience
  • Research
  • Skills
  • Blog
  • Contact

© Rohit Jarariya

All projects
S

Case study

SENTINEL

Distributed Rate Limiter & API Gateway

An API gateway with four pluggable, Redis-backed rate-limiting algorithms, per-tenant configuration, circuit breakers and JWT auth — also published as a drop-in Spring Boot Starter.

Source code
Rate-limit algorithms
4
Rate-limit algorithms
req/min, FREE → ENTERPRISE
10 → 10k
req/min, FREE → ENTERPRISE
Dependency to adopt
1
Dependency to adopt

Architecture

The gateway authenticates each request, applies tier/rule limits with Redis Lua scripts, then forwards through a circuit breaker; the admin service and dashboard manage tenants and rules.

Request path

  1. 01Client
  2. 02JWT / API key
  3. 03Rate limiter (Redis Lua)
  4. 04Circuit breaker
  5. 05Downstream service

What I built

01

Four pluggable algorithms

Built a distributed API gateway with Token Bucket, Sliding Window Log, Fixed Window Counter and Sliding Window Counter, using Redis Lua scripts for atomic distributed counting across gateway instances — eliminating race conditions under concurrency.

02

Per-tenant, per-endpoint config

Used the Strategy Pattern for algorithm selection, with configuration stored in PostgreSQL and cached in Redis, so algorithms can be switched without redeploying — from the FREE tier (10 req/min) to ENTERPRISE (10,000 req/min).

03

Resilience & security

Integrated Resilience4j circuit breakers with configurable failure-rate thresholds, JWT authentication and API-key management, with a fail-open design that keeps APIs available even during Redis outages.

04

Reusable Spring Boot Starter

Published as sentinel-spring-boot-starter with auto-configuration, IDE-friendly configuration metadata and a Maven Central–ready build — any Spring Boot app can add rate limiting with a single dependency.

Screenshots

Rate-limit rules: per-tenant path patterns, each with its own algorithm and limit, on top of tier defaults.
Tenants: each customer's tier, status and masked API key.
Onboarding a tenant issues an API key that's exchanged for a JWT at the gateway.

Tech stack

  • Java 17
  • Spring Boot 3
  • Spring Cloud Gateway
  • Redis Lua
  • PostgreSQL
  • Resilience4j
  • JWT
  • Docker
  • Next.js

← Previous

CODELINE

Cross-Service Data Lineage Engine

Next →

FLOWFORGE

Distributed Task Queue & Workflow Engine