I have an event (say activity) which may be active or not at a given time. I'm looking for a way to use RabbitMQ to figure if the event is active or not. I know the use case of RabbitMQ is pub/sub. How do I use RabbitMQ to be able to say if an event is currently active or not. More like a variable which is updated in real-time. I know I can achieve this using Firebase Database; but is there any way I can do it using RabbitMQ? If not RabbitMQ, are there any other suggestions? I cannot use mySQL etc. because that will not be real-time.
RabbitMQ is a message broker, it is not suited for representing state across distributed systems.
For this purpose, I'd rather recommend any storage solution which provides transactions (SQL or NoSQL) as what you really want to ensure is the data is set atomically.
Solutions such as Redis, MongoDB, PostgreSQL are all providing what you need. Cloud providers nowadays offer similar solutions as managed services.
If latency when accessing the state is critical within your application (if this is what you mean with "Real Time"), then you will need to carefully consider your architecture. As the state will be stored in a remote location (be it RabbitMQ, Redis or whatever else), the network latency and it's (un)reliability will be the most important factor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With