I built a rate limiter that survives process restarts — no Redis required

작성자

카테고리:

← 피드로
DEV Community · nexora · 2026-06-11 개발(SW)

nexora

Every time I needed rate limiting in a Python service, the answer was the same: add Redis. Just to count requests.
So I built Flint. Embedded, persistent, zero infrastructure.
pythonimport flint

limiter = flint.Limiter(data_dir=”.flint”)
limiter.limit(“api:user-42″, rate=100, per=”1m”)

if limiter.allow(“api:user-42”):
process_request()
Counters persist in .flint/ and survive restarts. Something no in-memory solution does.

What makes it different
SlowAPI resets on restart. Redis requires infrastructure. nginx only works at HTTP layer.
Flint is persistent, embedded, and works anywhere — including AI APIs with cost-based limiting:
pythonresult = limiter.check(“ai:user-42”, cost=250)
FastAPI middleware, Prometheus export, millisecond precision, and atomic multi-limit checks included.
Core is Rust via PyO3. Token bucket check: ~560µs.

bashpip install flint-limiter

GitHub: https://github.com/BuildByNexora/Flint

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다