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
已提问 4 个月前454 查看次数
3 回答
2
已接受的回答

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

profile pictureAWS
已回答 4 个月前
profile pictureAWS
专家
已审核 4 个月前
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
专家
已回答 4 个月前
  • 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
专家
已回答 4 个月前
  • 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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则