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.
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.
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.
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.
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
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 a small amount can reach your origin.
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!
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.
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.
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.
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.
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
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 a small amount can reach your origin.
CF Worker its pay per req isnt it ? This seems impossibly expensive to proxy
Correct, pricing would be based on the traffic volume.
[dead]