I received the task of implementing event based communication between a bunch of micro-frontends, which are going to be deployed on premises. The project involves neither cloud nor a backend, just a bunch of micro frontends and a shell application.
We are not using any micro-frontends frameworks (e.g., single-spa). Instead, we are using native federation, which is the agnostic way to implementing module federation without being attached to the Webpack bundler.
Per design, the communication between domains should be kept to the minimum. We don’t want to tightly couple domains.
For the communication we decided to use an event bus. Normally I would do that using well-known message brokers (e.g, RabbitMQ), proxying requests to backend services or even cloud services (e.g. AWS EventBridge). I don’t want to reinvent the wheel. Unfortunately, one of the requirement is that the whole system should run in the web browser. That left me with fewer options and confused.
Before finding the right tool for the job, and attempting to do some kind of implementation, I’m asking to myself if that project requirement makes sense. I’m most concerned about security issues. I don’t want people sniffing around the exchanged messages within the system. Every time I think about storing or running critical code infrastructure in the web browser makes me sweat.
In case it’s okay to run the event bus in the browser, which alternatives do I have? I’m thinking about Observables (e.g., Subjects).
Any suggestions?
Thanks