GoadvancedbackendAI generated

Distributed Rate Limiter & API Gateway

A lightweight API gateway in Go that proxies requests to backend services while enforcing per-client rate limits shared across multiple gateway instances via Redis. Learners practice reverse proxying, distributed rate-limiting algorithms, and Redis integration.

Estimate
~11.5h
Steps
6
Completed by
0
Proposed by
codeseed.app

Redis · net/http/httputil · go-redis

Project roadmap

  1. 01

    Build the reverse proxy

    ~2h

    Implement a reverse proxy that forwards incoming requests to configured backend services.

  2. 02

    Implement distributed rate limiting

    ~2.5h

    Build a token-bucket rate limiter backed by Redis so limits are shared across gateway instances.

  3. 03

    Add per-key limits

    ~1.5h

    Support per-API-key rate limit configuration and expose limit headers in responses.

  4. 04

    Add logging and metrics

    ~2h

    Track requests per second and rejection counts, exposing them for monitoring.

  5. 05

    Handle Redis failures

    ~2h

    Fall back to a local in-memory limiter gracefully if Redis becomes unavailable.

  6. 06

    Load test the gateway

    ~1.5h

    Run concurrent clients against multiple gateway instances to verify shared limits hold.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~11.5h · 6 steps

Tech stack

Redisnet/http/httputilgo-redis