annad

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

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

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

ExRated: GitHub - grempe/ex_rated: ExRated, the Elixir OTP GenServer with the naughty name that allows you to rate-limit calls to any service that requires it. · GitHub

dimitarvp

dimitarvp

I think you got analysis paralysis. :smiley:

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.new and one of the functions of the :timer module (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.

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New

Other popular topics Top

stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29703 241
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31194 112
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement