I have an app that I would like to use Redis stream to support. I have N sensors and each sensor produces in average 4 signals per second. To illustrate, let’s assume N=2,
there are two approaches under consideration to put the data
(1) Use one stream to add the signals from both sensor sources. Then, we have a consumer group with several consumers to consume the sensor data. When XREADing the data, it will differentiate which sensor the signal belongs to and then pass to corresponding processors.
(2) Use two streams and each stream handles each sensor source. For each steam, there is corresponding consumer group to ingest data and pass to processors.
The first approach is uniform stream for all sensors and it simplifies things when we have bigger numbers of sensors (that’s N is big)
The 2nd approach needs a little bit extra effort to “manage” many streams, but it’s easier to get the size of each stream to it corresponding sensor.
Here are my questions:
(A) Any performance preferences for these two approaches from Redis server perspective ?
(B) Let say, if the first stream is with more messages per second, will it impact the performance of another sensor data processing if we use the first (1) design (that’s, both sensor data go to same stream)