Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Redisを使ったランキング機能の実装

 Redisを使ったランキング機能の実装

2013/05/29 DevLOVEさんイベント

Tatsuya Sasaki

May 29, 2013
Tweet

More Decks by Tatsuya Sasaki

Other Decks in Technology

Transcript

  1. 3FEJTΛ࢖ͬͨ
    ϥϯΩϯάػೳͷ࣮૷

    ͔Β͋͛ΤϯδχΞ
    TBTBUB
    Wednesday, May 29, 13

    View full-size slide

  2. ࣗݾ঺հ
    -BOHͷதͷਓ
    ϒϩάॻ͍ͯ·͢
    ͔Β͕͋͛޷͖
    !TBTBUB ͨͭ͞͞

    http://blog.livedoor.jp/sasata299/
    Wednesday, May 29, 13

    View full-size slide

  3. ͔Β͋͛
    ඒຯ͍͠
    Wednesday, May 29, 13

    View full-size slide

  4. -BOHʹ͍ͭͯ
    Wednesday, May 29, 13

    View full-size slide

  5. http://lang-8.com
    Wednesday, May 29, 13

    View full-size slide

  6. ૬ޓఴ࡟ܕ4/4
    Wednesday, May 29, 13

    View full-size slide

  7. ͋ͳ͕ͨ฼ࠃޠͰఴ
    ࡟ͯ͋͛͠Δͱ͋ͳ
    ͨͷֶशதͷݴޠ΋
    ωΠςΟϒʹఴ࡟͠
    ͯ΋Β͑ΔαʔϏε
    Wednesday, May 29, 13

    View full-size slide

  8. ɾ຋༁αΠτ
    ɹɹϓϩ͕༁ͯ͘͠ΕΔ
    ɾ-BOHʢఴ࡟ʣ
    ɹɹωΠςΟϒ͕௚ͯ͘͠ΕΔ
    ɹɹͩΕͰ΋ఴ࡟ऀʹͳΕΔ
    େࣄͳ͜ͱ
    Wednesday, May 29, 13

    View full-size slide

  9. ੈքதͷݴޠ͕ର৅
    ݴޠҎ্
    Wednesday, May 29, 13

    View full-size slide

  10. ੈքத͔ΒΞΫηε
    ϲࠃҎ্ɺׂ͕೔ຊҎ֎
    Wednesday, May 29, 13

    View full-size slide

  11. ͷΠϯλϑΣʔε
    Wednesday, May 29, 13

    View full-size slide

  12. ͷΠϯλϑΣʔε
    ( ƅдƅ)Űŕ!!
    Wednesday, May 29, 13

    View full-size slide

  13. ͷΠϯλϑΣʔε
    ( ƅдƅ)Űŕ!!
    Σ(ʄДʄ)Ųōŕ!?
    Wednesday, May 29, 13

    View full-size slide

  14. ຊ୊
    Wednesday, May 29, 13

    View full-size slide

  15. ,1*
    ఴ࡟཰
    Wednesday, May 29, 13

    View full-size slide

  16. ՝୊
    ɾӳޠͷఴ࡟཰͕௿͍
    ɹӳޠΛษڧ͍ͨ͠ਓ͕ଟ͍
    ɾఴ࡟͕͙͢ʹ͸෇͔
    ɹͳ͍͜ͱ΋͋Δ
    Wednesday, May 29, 13

    View full-size slide

  17. ήʔϛϑΟέʔγϣ
    ϯͷཁૉΛऔΓೖΕ
    ͨΒఴ࡟཰্͕͕Δ
    ͷͰ͸ʁ
    Wednesday, May 29, 13

    View full-size slide

  18. ɾΞΫγϣϯʹ༠ಋ
    ɾ͙͢ϑΟʔυόοΫ
    ɾݱঢ়ͷՄࢹԽ
    ॏཁͳཁૉ
    Wednesday, May 29, 13

    View full-size slide

  19. ΞΫγϣϯʹ༠ಋ
    Wednesday, May 29, 13

    View full-size slide

  20. ͙͢ϑΟʔυόοΫ
    Wednesday, May 29, 13

    View full-size slide

  21. ɾΞΫγϣϯʹ༠ಋ
    ɾ͙͢ϑΟʔυόοΫ
    ɾݱঢ়ͷՄࢹԽ
    ॏཁͳཁૉ
    Wednesday, May 29, 13

    View full-size slide

  22. ϥϯΩϯά͔ͳ͊
    .Z42-Ͱ΍Δʹͯ͠΋
    ॱҐग़͢ͷΊΜͲͦ͏
    ݱঢ়ͷՄࢹԽ
    Wednesday, May 29, 13

    View full-size slide

  23. ͍ͩ͡ΐ͏Ϳ
    Wednesday, May 29, 13

    View full-size slide

  24. 3FEJT
    Wednesday, May 29, 13

    View full-size slide

  25. 3FEJTͷಛ௃
    ɾΠϯϝϞϦσʔλϕʔε
    ɾӬଓԽʢෆشൃੑʣ
    ɾෳ਺ͷσʔλܕ
    ɾॲཧ͕ΞτϛοΫ
    ɾ͔͠΋ߴ଎ʹಈ࡞͢Δ
    Wednesday, May 29, 13

    View full-size slide

  26. ӬଓԽ
    ɾఆظతʹσΟεΫʹॻ͖ग़͢
    ɾλΠϛϯά͸ύλʔϯ
    ɹɹ෼ؒͰͭҎ্
    ɹɹ෼ؒͰҎ্
    ɹɹඵͰҎ্
    ɾઃఆϑΝΠϧͰมߋՄೳ
    Wednesday, May 29, 13

    View full-size slide

  27. ෳ਺ͷσʔλܕ
    ɾจࣈྻܕ
    ɾϦετܕ
    ɾηοτܕ
    ɾιʔτࡁΈηοτܕ
    ɾϋογϡܕ
    Wednesday, May 29, 13

    View full-size slide

  28. Ϧετܕͱηοτܕ
    Ϧετܕ
    σʔλͷॏෳ΋Մೳ
    ηοτܕ
    σʔλ͕ϢχʔΫʹͳΔ͜ͱ͕อূ͞Ε͍ͯΔ
    ࿨ू߹΍ੵू߹ͷΑ͏ͳू߹ԋࢉ͕Մೳ
    QVTIͱ͔QPQΈ͍ͨͳ഑ྻૢ࡞͕ग़དྷΔ
    Wednesday, May 29, 13

    View full-size slide

  29. ෳ਺ͷσʔλܕ
    ɾจࣈྻܕ
    ɾϦετܕ
    ɾηοτܕ
    ɾιʔτࡁΈηοτܕ
    ɾϋογϡܕ
    ͜ΕΛ࢖͏
    Wednesday, May 29, 13

    View full-size slide

  30. ϥϯΩϯάػೳ

    ೖΕ෺
    είΞ
    σʔλ
    σʔλͷૠೖߋ৽
    http://redis.shibu.jp/commandreference/sortedsets.html
    Wednesday, May 29, 13

    View full-size slide

  31. ϥϯΩϯάػೳ

    ೖΕ෺
    σʔλ
    σʔλͷॱҐΛฦ͢
    http://redis.shibu.jp/commandreference/sortedsets.html
    Wednesday, May 29, 13

    View full-size slide

  32. ϥϯΩϯάػೳ

    ೖΕ෺
    σʔλ
    σʔλͷείΞΛฦ͢
    http://redis.shibu.jp/commandreference/sortedsets.html
    Wednesday, May 29, 13

    View full-size slide

  33. ϥϯΩϯάػೳ

    ೖΕ෺ͷϦωʔϜ
    ˞௚ۙ೔ؒͷϙΠϯτ͚ͩΛର৅ʹͯ͠ΔͷͰDSPOͰ
    http://redis.shibu.jp/commandreference/sortedsets.html
    Wednesday, May 29, 13

    View full-size slide

  34. ఴ࡟਺͕ ˠ ݅೔ʹ





    Wednesday, May 29, 13

    View full-size slide

  35. ӳޠͷఴ࡟཰͕ˠʹ





    Wednesday, May 29, 13

    View full-size slide

  36. 3FEJT
    ؆୯Ͱ
    ͔͠΋
    ߴ଎ʹಈ࡞
    Wednesday, May 29, 13

    View full-size slide

  37. ઃఆϑΝΠϧ
    CJOE
    EJSVTSMPDBMWBSECSFEJT
    σʔλͷอଘ৔ॴͷࢦఆ
    ֎෦͔ΒͷΞΫηε΋ड͚෇͚ΔͳΒ
    ίϝϯτΞ΢τ͢Δ͜ͱ
    Wednesday, May 29, 13

    View full-size slide

  38. <13>
    Wednesday, May 29, 13

    View full-size slide

  39. ·ͱΊ
    ɾ3FEJTͩͱ༻్ʹΑͬͯద͠
    ɹͨσʔλܕ͕࢖͑Δ
    ɹɹλΠϜϥΠϯˠϦετܕ
    ɹɹڞ௨ͷ༑ୡˠηοτܕ
    ɹɹϥϯΩϯάˠιʔτࡁΈηοτܕ
    ɾ3FEJT͔Θ͍͍ ʅЧA
    ŰōŰō
    Wednesday, May 29, 13

    View full-size slide

  40. J04ΤϯδχΞืूத
    https://www.wantedly.com/projects/3164
    Wednesday, May 29, 13

    View full-size slide

  41. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠
    !TBTBUB ͨͭ͞͞

    Wednesday, May 29, 13

    View full-size slide