Question

I'm using event driven architecture, to perform realtime signal proccessing and to provide independent metrics.

enter image description here

I decided to use a redis cluster to act a cache and a message bus.

I'm a bit confused on the best route for the architecture. Each node has other nodes which subscribe to it's values. Some of the nodes the information is important and should be written to the DB while others should just be passed along to the next node in the chain (since the value at the time isn't important enough to store globally).

  1. How much overhead is involved when using channels? Should I use a single channel and parse everything from there OR Would it be better to use a channel for each node?

  2. Should every event use redis? e.g some parts of the communication don't need to be stored e.g (Time,Price,Quantity) come from the exchange I don't see why I would need to publish them to be persisted, However for simplicity I don't want to have manage multiple code paths

Was it helpful?

Solution

In contrast to the regular MQ Brokers (Active MQ) or Event Logs (Kafka, Event hub) Redis Pub/sub is not persistent and does not hold a notation of things like transaction that can be found in an MQ Broker for example or commit elements as it can be done in Kafka.

You will have a rather limited set of capabilities using Redis Pub Sub. If we put aside this you can use a Channel the same way as you would normaly use a Topic but probably you would want to persist your messages just in case.

You should not worry about overhead of using channels. You can use many channels.

I would not use redis for this type of work unless it is trivial. I would recommend you to consider usage of MQ broker , or event log.

Licensed under: CC-BY-SA with attribution
scroll top