Is there a hard limit on number of rules on an event bus?

0

I would like to create an event bus rule for every user that signs up for my app. Every user will have an IoT MQTT connection and it would be nice to use event bus to route messages to individual users' connection based on a rule specific to them.

The default of 300 will not be enough in production. Wondering if there's an upper limit and I need to rethink the architecture.

Nick
posta 4 mesi fa452 visualizzazioni
3 Risposte
2
Risposta accettata

EventBridge has a hard limit of 2000 rules of any given EventBus today.

profile pictureAWS
con risposta 4 mesi fa
profile pictureAWS
ESPERTO
verificato 4 mesi fa
1

Hi,

You should not have an individual rule for each different MQTT connection. You should rather have a single rule for all connections triggering 1 single Lambda. This Lambda will then use a lookup table (redis cache or DDB table) to match the connection to a user and then be able to route the MQTT messages to the user.

Parallelism will be managed for you by Lambda runtime: you'll get a new independent instance of your function for each incoming message.

Best,

Didier

profile pictureAWS
ESPERTO
con risposta 4 mesi fa
  • I know that's what we are supposed to do, but one less component I have to run is all the better. Also, I'd really prefer to only pay for that message one time (through event bus) rather than twice (event bus + lambda).

  • Hi, thanks for the feedback; if you can cope with the 2'000 rules limit, it's fine. I understand the point re. additional cost of Lambda. I feel that it would bring you additional flexibility that you won't have with EventBridge only. Happy that you found the right solution for your use case!

0

Personally, Im not sure of the answer but It sounds like eventbridge is the wrong product for what your trying to achieve because creating an event bridge rule for every user just doesnt seem to scale to me and will be unmanageable. I would re-evaluate the method and what your trying to achieve.

I would only use eventbridge for routing events between services and not down to a low level such as users.

How about using permissions in MQTT where your devices can only subscribe to their own topic and then your application can publish to which ever topic you need to send to users? Route messages say to a lambda function and it will publish to the correct Topic?

profile picture
ESPERTO
con risposta 4 mesi fa
  • Intresting this answer for marked down. Though with the answer being a limit of 2000, I stick with my thoughts that using event bus for routing rules for to users doesn’t scale. 2000 max rules would mean you can’t have anymore users than 2000.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande