News for hackers. Stuff that matters.

Testing a new rate-limiting service – feedback welcome

Hey all,

I’m building a project called Rately. It’s a rate-limiting service that runs on Cloudflare Workers (so at the edge, close to your clients).

The idea is simple: instead of only limiting by IP, you can set rules based on your own data — things like:

- URL params (/users/:id/posts → limit per user ID)

- Query params (?api_key=123 → limit per API key)

- Headers (X-Org-ID, Authorization, etc.)

Example:

Say your API has an endpoint /user/42/posts. With Rately you can tell it: “apply a limit of 100 requests/min per userId”.

So user 42 and user 99 each get their own bucket automatically. No custom nginx or middleware needed.

It has two working modes:

- Proxy mode – you point your API domain (CNAME) to Rately. Requests come in, Rately enforces your limits, then forwards to your origin. Easiest drop-in.

``` Client ---> Rately (enforce limits) ---> Origin API ```

- Control plane mode – you keep running your own API as usual, but your code or middleware can call Rately’s API to ask “is this request allowed?” before handling it. Gives you more flexibility without routing all traffic through Rately.

``` Client ---> Your API ---> Rately /check (allow/deny) ---> Your API logic ```

I’m looking for a few developers with APIs who want to test it out. I’ll help with setup .

( 9 comments | 2 points | on HN )
Re:Testing a new rate-limiting service – feedback welcome by galaxy_gas on Friday September 19, 2025 @03:35AM (#45298927)
I can't see myself ever using this unless self hosted as library with no phonehome . remote internet API call every time when I am getting millions of rps is intolerable
Re:Testing a new rate-limiting service – feedback welcome by 0megion on Friday September 19, 2025 @04:14AM (#45299219)
That is fair. Maybe Proxy mode would be a way to go in this case? Instead of calling another API, you can pass through your requests, and only the saved amount can reach your origin.
Re:Testing a new rate-limiting service – feedback welcome by galaxy_gas on Friday September 19, 2025 @05:11AM (#45299570)
CF Worker its pay per req isnt it ? This seems impossibly expensive to proxy
Re:Testing a new rate-limiting service – feedback welcome by 0megion on Friday September 19, 2025 @06:15AM (#45299941)
Correct, pricing would be based on the traffic volume.
Re:Testing a new rate-limiting service – feedback welcome by nik736 on Friday September 19, 2025 @07:03AM (#45300233)
Rails 8 introduced built in rate limiting, smilar to what you described. Since it's built in already I have no use for your service, but good luck!
Re:Testing a new rate-limiting service – feedback welcome by 0megion on Friday September 19, 2025 @10:02AM (#45301798)
It's already too late if requests are hitting your service. What happens when a customer sends x100 traffic all of a sudden, your Rails backend needs to scale or crash to handle the rate limiting.
Re:Testing a new rate-limiting service – feedback welcome by nik736 on Friday September 19, 2025 @10:09AM (#45301858)
For me it's not a big deal, my app autoscales and rate limit details are stored in Redis, so it's super fast. For x100 the traffic it wouldn't even need to scale since it's simply hitting Redis.
Re:Testing a new rate-limiting service – feedback welcome by 0megion on Saturday September 20, 2025 @04:34AM (#45311553)
Interesting, but still your Rail app needs to apply the rate limit logic working with Redis, maybe your DB will be protected, but you will still receive the traffic through your network, meaning more ingress cost, along with CPU to process all the incoming requests.
Re:Testing a new rate-limiting service – feedback welcome by nik736 on Saturday September 20, 2025 @03:52PM (#45316750)
Ingress is free with most providers. Yes, of course it adds a bit pressure on the cpu, but yours would add latency, might add peering issues, additional costs, etc. and I have no control.