- Notifications
You must be signed in to change notification settings - Fork611
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I'm planning a distributed system and Redis seems to be the perfect glue piece that brings all that together. Here's my initialnot 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:
Go ahead and laugh - yes, this diagram is made with Mac version of Paint. |
BetaWas this translation helpful?Give feedback.
All reactions
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. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I advise you to try different clients for Redis. |
BetaWas this translation helpful?Give feedback.
All reactions
-
@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. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I'll probably skip the Redis for now, it's unlikely that I'll need >1 instances for a long time and if that time arrives, I'll review it again, hopefully with more resources. This system requires too much plumbing if you want it to be resilient without human intervention. All the stuff I don't want to deal with at the moment:
I doubt this is the complete list of cases you have to handle and maybe there are easier ways to handle this. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I'm not sure if any of the open source proxies support pub/sub use case, e.g twemproxy or envoy. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
We use a custom client for Redis.
This is the killer feature Redis 6, I don't know if your client supports them |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
That sounds a lot like an "Edge database" (which is a buzzword). I swear - all databases are essentially the same very thing. Only slight variations in what they optimize for (transactions or analytics). The rest is marketing fuzz and of course more or less good implementations. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
@alexhultman We know that Node.js is trash for you, but what do you think about Redis, is not trash? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Redis is fine. In my I/O benchmarks with pub/sub it beats all contenders by far (tested probably 12 MQTT servers). Mosca, the one written by Matteo in JavaScript was by far the slowest. If you look at the commit stats of redis you can see 99% is written by one guy under one company - I think that's important for keeping on track with what you aim for. Nodejs on the other hand is written by so so many different people with conflicting vision, competence and feel for quality. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 2
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Nodejs doesn't even screen for competence anymore (did they ever?) - if you have purple enough hair you're free to hack on things you have no idea about |
BetaWas this translation helpful?Give feedback.
All reactions
😄 1
-
I kind of agree with that. Products can be messy, rushed and clued together Frankenstein monsters because sometimes it's more important to deploy the feature (retain a high profile client, etc) instead of saving $500 optimizing the code and decrease the hardware requirements. I think good tools shouldn't have that luxury. But the range of quality, focus, etc comes with the open source territory. |
BetaWas this translation helpful?Give feedback.