a question about redis cache

14 views
Skip to first unread message

Xin Liu

unread,
Apr 10, 2016, 12:39:03 PM4/10/16
to Django users
Let's look at the following scenario:
A website has 10000 player, to make question easier, I use mysql  storage player with just one table: "player_table"
------table here-----
name string
score int

now, I want to show Top 100 of those players  by socre.
if only with mysql, I have to caculate Top 100 every time, so I choice Redis to storage Top 100 with sorted set data type.

But if one of those players' score chaning, what should I do, update Top 100 every time?? 

Thanks for you advance

Avraham Serour

unread,
Apr 10, 2016, 2:59:04 PM4/10/16
to django-users
why do you want to use redis for this?, top is trivial to the database


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/487b5298-d478-448a-b498-f9def7ec74f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bob Gailer

unread,
Apr 10, 2016, 3:48:26 PM4/10/16
to Django users

Why not just use Redit?

Reply all
Reply to author
Forward
0 new messages