Applied Redis  Barcamp Saigon 2012
About me @hotrannamKMS Technology
take away
back to school
data structures
big O
do it right( data model & query performance )
redis???
data structure    server
data types
#1   strings#2   hashes#3   lists#4   sets#5   sorted sets
data examplesKeys                    Valuespage:index.html         <html><head>[…] stringlogin_count             7464users...
command examplesSET my_key “my value”GET my_keyINCR next_post_idEXPIRE my_key 1234TTL my_keyDEL my_key                  fi...
commandshave its big O  ( mostly )
and beyond
bring to life
#1 cache data
#2 who is online# add to friends setSADD users:nam:friends duySADD users:nam:friends khoi# add to online setSADD online na...
#3 leaderboard ( ranking )# add to leaderboard (sorted set)ZADD leaderboard <score> <player># get top 5ZREVRANGEBYSCORE le...
#4 cross-app communication# web appSUBSCRIBE chatPUBLISH chat “Hello! I’m web app.”# mobile appSUBSCRIBE chatPUBLISH chat ...
Thank you!
Upcoming SlideShare
Loading in...5
×

Applied Redis

782

Published on

Published in: Technology, Spiritual
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
782
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
19
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Applied Redis"

  1. 1. Applied Redis Barcamp Saigon 2012
  2. 2. About me @hotrannamKMS Technology
  3. 3. take away
  4. 4. back to school
  5. 5. data structures
  6. 6. big O
  7. 7. do it right( data model & query performance )
  8. 8. redis???
  9. 9. data structure server
  10. 10. data types
  11. 11. #1 strings#2 hashes#3 lists#4 sets#5 sorted sets
  12. 12. data examplesKeys Valuespage:index.html <html><head>[…] stringlogin_count 7464users_logged_in_today {1, 2, 3, 4, 5} setlatest_post_ids [201, 204, 205] listuser:123:session time => 10927353 hash username => joeusers_and_scores joe ~ 1348 sorted set fred ~ 938 chris ~ 2832
  13. 13. command examplesSET my_key “my value”GET my_keyINCR next_post_idEXPIRE my_key 1234TTL my_keyDEL my_key field valueEXISTS my_key HSET product:1 id 1 HSET product:1 name “iPad” HSET product:1 available 10
  14. 14. commandshave its big O ( mostly )
  15. 15. and beyond
  16. 16. bring to life
  17. 17. #1 cache data
  18. 18. #2 who is online# add to friends setSADD users:nam:friends duySADD users:nam:friends khoi# add to online setSADD online namSADD online nghiaSADD online khoi# get online friends – {khoi}SINTER users:nam:friends online
  19. 19. #3 leaderboard ( ranking )# add to leaderboard (sorted set)ZADD leaderboard <score> <player># get top 5ZREVRANGEBYSCORE leaderboard +inf –infWITHSCORES LIMIT 0 5# get rank of KhoiZREVRANK leaderboard Khoi# get 5 players around KhoiZREVRANGEBYSCORE leaderboard +inf –infWITHSCORES LIMIT 2 5
  20. 20. #4 cross-app communication# web appSUBSCRIBE chatPUBLISH chat “Hello! I’m web app.”# mobile appSUBSCRIBE chatPUBLISH chat “Hi! I’m mobile app.”
  21. 21. Thank you!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×