- Newest
- Most votes
- Most comments
EventBridge has a hard limit of 2000 rules of any given EventBus today.
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
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!
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?
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.
Relevant content
- asked a year ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago
You might find this recent launch helpful https://aws.amazon.com/about-aws/whats-new/2024/01/amazon-eventbridge-appsync-target-buses/
@baldawar That's actually perfect!