Replies: 4 comments 7 replies
-
Well I think the best thing is to write a reliable benchmark and test it out at expected stress. I suspect Redis itself will bottleneck and then you end up with the need for a Redis master and multiple Redis slaves and then it kind of becomes an unnecessary layer you could do without in the first place. What I do in many cases is I use 1 Redis master and a handful of WS slaves where the WS slaves only subscribe to 1 general topic so that the Redis master only has to send a handful of messages per 1 app message. But really, write benchmarks and test multiple solutions and compare their respective results. |
Beta Was this translation helpful? Give feedback.
-
I advise you to try different clients for Redis. |
Beta Was this translation helpful? Give feedback.
-
@gitcatrat I am following same structure for current app (Flutter). I am using redis for pub/sub as well for cache storage. Can you guide me how to benchmark? Which things should be considered. My app is on early development. I just checked my realtime chat app module. It's really quick. @uasan I am using ioredis. Do you prefer this or have any idea. Other repos are outdated or does not support command like geospatial. |
Beta Was this translation helpful? Give feedback.
-
We use a custom client for Redis.
This is the killer feature Redis 6, I don't know if your client supports them |
Beta Was this translation helpful? Give feedback.
-
I'm planning a distributed system and Redis seems to be the perfect glue piece that brings all that together.
Here's my initial not stress tested idea. I'd be glad to hear your criticism or tips. Note that diagram only handles "direct message" topic for simplicity but it could subscribe to any number of topics and same concept applies.
PROS:
CONS:
publish
as well which is less performant thansend
but I think that's the easy route - alternative would be to store<userID: serverIP>
in redis and implement HTTP API to servers for sending messages, it would require custom library or separate instance that looks up the connection server IP from redis and makes a request (comes with issues like invalidation)Go ahead and laugh - yes, this diagram is made with Mac version of Paint.
Beta Was this translation helpful? Give feedback.
All reactions