My notes for designing a rate limiter