2

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

2
  • 1
    So, you're 100% confident in your "Redis" decision? (I am not necessarily questioning you ...) Commented Mar 4, 2021 at 2:26
  • @MikeRobinson, I just wanted something up and running quick and since it's a multidb provider it can serve multiple functions instead of just a message bus. But in the future I will expirament with other architecture
    – johnny 5
    Commented Mar 4, 2021 at 2:41

1 Answer 1

2

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.

3
  • My main concern about using channel is the same concern I have about using websockets. Which is the more sockets open the more ports that are closed, is this the case for channels?
    – johnny 5
    Commented Mar 4, 2021 at 23:00
  • 1
    No it is the same port. But the more consumers you have the more the message needs to be replicated accross them. If you were using KAfka this replication would not have happened. Commented Mar 4, 2021 at 23:05
  • yeah Kafka my main goal to use for streams. I'm just in the .Net world right now, So I wanted to use something quick and dirty until I have a POC
    – johnny 5
    Commented Mar 4, 2021 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.