4 ms·
Good use case explaination for Redis. But how would you do this for a production system with 100M users. If there are over 10M users logged on at the same time
by bozoUser 11y ago
Good use case explaination for Redis. But how would you do this for a production system with 100M users. If there are over 10M users logged on at the same time you cache would be of size 10M*5000 IDS? Or would each user have an individual live cache returned per session with 5000IDS.
The leaderboard example makes more sense as the top scorers number is the same throughout and the board can be updated real time.
- mbell 11y agoAny time you have per user data you have an a clear shard key. i.e. instead of one Redis instance you have 100 where each serves a subset of users. In practice sharding isn't quite so simple but having a clear boundary makes it fairly easy to manage.
- bozoUser 11y agowow that makes sense...thanks!
- js2 11y agoYou can shard client-side, but another option is twemproxy, which can shard the keyspace for you. If you're using Python and want to shard in the client, check out nydus - https://github.com/disqus/nydus https://github.com/disqus/nydus
- mbell 11y agoI don't think that solution is viable within the constraints the parent post is talking about. There are many problems that come up with millions of users. Proper load balancing in that case is not simple and mostly dependent on the business logic.
- eurleif 11y agoWhat about Redis Cluster?