annad
Any open source app available that does Job Processing AND Rate Limiting?
My app needs to send out scheduled reminder emails, so it needs job processing and rate limiting.
Does anyone know of an open source library that does BOTH job processing and rate limiting? I’ve been looking at Oban OSS to handle the job processing. Oban Pro also provides rate limiting but it was way too expensive for me.
I have checked out the excellent blog post by Alex Koutmos (@akoutmos ) on Easy and Robust Rate Limiting in Elixir. So worst case, I can implement a Rate Limiter myself. But I’m curious if there is anything open source that does both job processing AND rate limiting. So far, I haven’t been able to find anything.
Most Liked
dimitarvp
Just recently we had a community member announce this:
I mentioned GitHub - ExHammer/hammer: An Elixir rate-limiter with pluggable backends · GitHub there as well. Maybe give those two a go.
In the end I’d write my own rate limiter though, it’s not hard, you can just have a counter in ETS and expire it at fixed intervals. Easy stuff IMO, and you won’t have to wrestle with 3rd party libraries that are likely not crafted with your exact scenario in mind.
wmnnd
At Keila we’re currently adding rate-limiting with Oban and ExRated: Scheduling is done by Oban and then the rate-limit is checked with ExRated. If the rate-limit is hit, the job is scheduled to re-run at a later point:
Check out the Merge Request for Keila here:
https://github.com/pentacent/keila/pull/137
dimitarvp
I think you got analysis paralysis. ![]()
Let’s separate your concerns because you seem to be mixing them somewhat.
-
Persistence. Depends how important is the sending of these emails. If they are not mega-important and you don’t care about guaranteeing each one arriving then there’s nothing wrong to just put a few million records in ETS (Erlang’s in-memory DB/cache) and then pull from it in batches and send mails. Redis works fine for this as well. Kafka too but it’s too heavy to setup (unless you’re using Docker, then it’s easy-ish). PostgreSQL is just fine for it as well.
-
Rate limiting. It’s really not as hard to make one yourself as you seem to think. You’d need a combination of
:counters.newand one of the functions of the:timermodule (both in Erlang but fairly straightforward to use). If not, it’s still better to try and use a library that’s made only for rate limiting so as to reduce confusion.
I could likely write you one for your goals but I am super busy and my schedule is not stable so can’t give you a good estimation as to when.
Yes, absolutely. You haven’t indicated anything in your comments that suggests a super complex scenario. Any of the options you enumerated should serve you just fine.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









