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

ソーシャルゲームでDB水平分散 #mdb_casual

gussan
November 10, 2014

ソーシャルゲームでDB水平分散 #mdb_casual

2014/11/10に開催されたRails複数DB Casual Talksでの発表資料になります。

gussan

November 10, 2014
Tweet

Other Decks in Programming

Transcript

  1. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ا٦ءٍٕ؜٦يד
    %#宏䎂ⴓ侔
    HVTTBO!%SFDPN$P -UE

    View full-size slide

  2. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    荈䊹稱➜
    HVTTBO
    %SFDPN$P -UE
    ٓ؎ـٓٔծىسٕؐؑ،

    View full-size slide

  3. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    %SFDPN

    View full-size slide

  4. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    鑧ֿׅה
    ٥3BJMTד宏䎂ⴓ侔
    ٥㼪Ⰵ٥麊欽ך鑧
    ٥תה׭

    View full-size slide

  5. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    宏䎂ⴓ侔

    View full-size slide

  6. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ך⵸ח

    View full-size slide

  7. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    㘋湫ⴓ侔

    View full-size slide

  8. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    㘋湫ⴓ侔
    堣腉嫣ח%#؟٦غ׾ⴓֽ׷
    ٥剅ֹ鴥׫頾蚚׾ⴓ侔ׇׁ׋ְ
    !
    "1
    6TFS
    %#
    &WFOU
    %#

    View full-size slide

  9. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    㘋湫ⴓ侔ךא׵׫
    盖椚
    ٥ذ٦ـٕ%#
    ٥NPEFM鷄⸇׃׋׵䟝㹀㢩ך%#

    View full-size slide

  10. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    㘋湫ⴓ侔ךא׵׫
    頾蚚ך⨉׶
    ٥؜٦يⰻ؎كٝز

    View full-size slide

  11. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    %#؟٦غ頾蚚׾黝ⴖח؝ٝزٗ٦ٕ׃ծ
    أ؛٦ٕ׃זְ朐屣׾䩧灶׃׋ְ

    View full-size slide

  12. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    宏䎂ⴓ侔

    View full-size slide

  13. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    0DUPQVT

    View full-size slide

  14. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    0DUPQVT
    0DUPQVTVTJOH VTFS
    EP
    6TFSOE YYY

    FOE

    View full-size slide

  15. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ד׮ְְֽו

    View full-size slide

  16. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ،فٔ؛٦ءّٝٗآحؙח䩛׾Ⰵ׸זְ

    View full-size slide

  17. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ׮׏הؕآُ،ٕח宏䎂ⴓ侔׃׋ְ

    View full-size slide

  18. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    HFN⡲׏׋

    View full-size slide

  19. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    BDUJWFSFDPSEUVSOUBCMF
    "3׾宏䎂ⴓ侔ח㼎䘔ׇׁ׷HFN
    LFZךⰻ㺁ד醱侧%#חⴓֽג呓秛
    !
    !
    %# %# %#
    "QQ
    VTFS@JE VTFS@JE

    View full-size slide

  20. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    湡垥
    ،فٔ؛٦ءّٝ׾剅ֻ➂ח
    宏䎂ⴓ侔׾䠐陎ׇׁזְ

    View full-size slide

  21. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    堣腉
    ؙؒٔ荈⹛䮶׶ⴓֽ
    䱰殢堣圓
    ׉ך➭

    View full-size slide

  22. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    堣腉
    ؙؒٔ荈⹛䮶׶ⴓֽ
    䱰殢堣圓
    ׉ך➭

    View full-size slide

  23. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ؙؒٔ荈⹛䮶׶ⴓֽ
    ٥ⴓⶴؗ٦׾TDPQFח鷄⸇
    ̔42-ػ٦أ
    ̔%#鼅䫛
    ̔醱侧%#ך穠卓و٦آ

    View full-size slide

  24. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    麩ְ
    class User < ActiveRecord::Base
    turntable :user_cluster, :id
    end
    !
    # on Octopus
    User.using(:xxx).where(id: 10)
    !
    # on Turntable
    User.where(id: 10)

    View full-size slide

  25. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    6TFSOE

    VTFS6TFSpOE

    <"DUJWF3FDPSE5VSOUBCMF>4FOEJOHNFUIPETFMFDU@BMM TRMTOJQ TIBSET
    <VTFS@TIBSE@>
    $IBOHJOH6TFSTTIBSEUPVTFS@TIBSE@
    6TFS-PBE NT
    <4IBSEVTFS@TIBSE@>4&-&$5AVTFSTA'30.AVTFSTA
    8)&3&AVTFSTAAJEA-*.*5
    $IBOHJOH6TFSTTIBSEUPNBTUFS
    6TFSJE OJDLOBNFOJM TOJQ
    *%͕ଘࡏ͢Δ
    %#ͷΈʹ
    ΫΤϦΛ౤͛Δ

    View full-size slide

  26. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    6TFSBMMUP@B
    6TFSBMMUP@B
    <"DUJWF3FDPSE5VSOUBCMF>4FOEJOHNFUIPETFMFDU@BMM TRMTOJQ TIBSET
    <VTFS@TIBSE@ VTFS@TIBSE@ VTFS@TIBSE@>
    6TFS-PBE NT
    <4IBSEVTFS@TIBSE@>4&-&$5AVTFSTA'30.AVTFSTA
    6TFS-PBE NT
    <4IBSEVTFS@TIBSE@>4&-&$5AVTFSTA'30.AVTFSTA
    6TFS-PBE NT
    <4IBSEVTFS@TIBSE@>4&-&$5AVTFSTA'30.AVTFSTA
    <6TFSJE OJDLOBNFOJM TOJQ
    6TFSJE OJDLOBNFOJM TOJQ
    6TFSJE OJDLOBNFOJM TOJQ
    6TFSJE OJDLOBNFOJM TOJQ>
    શͯͷ%#ʹΞΫηε
    ݁ՌΛϚʔδ

    View full-size slide

  27. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    6QEBUF
    VTFSVQEBUF@BUUSJCVUFT OJDLOBNFIPHFIPHF

    NT
    <4IBSEVTFS@TIBSE@>#&(*/
    <"DUJWF3FDPSE5VSOUBCMF>4FOEJOHNFUIPEVQEBUF TRMTOJQTIBSET
    <VTFS@TIBSE@>
    $IBOHJOH6TFSTTIBSEUPVTFS@TIBSE@
    42- NT
    <4IBSEVTFS@TIBSE@>61%"5&AVTFSTA4&5AOJDLOBNFAʜTOJQ
    $IBOHJOH6TFSTTIBSEUPNBTUFS
    NT
    <4IBSEVTFS@TIBSE@>$0..*5
    USVF
    ର৅%#ͷΈ6QEBUF

    View full-size slide

  28. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    堣腉
    ؙؒٔ荈⹛䮶׶ⴓֽ
    䱰殢堣圓
    ׉ך➭

    View full-size slide

  29. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    䱰殢堣圓
    䱰殢׾%#דװ׷ה؟٦غ꟦ד*%ָ遼瑱
    ٥ؔـآؙؑزך嫰鯰
    ٥ؙٓأةךⱄ圓䧭儗
    ؙٓأةⰋ⡤ה׃גِص٦ؙז䱰殢堣圓

    View full-size slide

  30. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    䱰殢
    CBSSBHFHFN
    ٥TOPXBLFMJLFז䱰殢
    խ٥׌ְ׋ְ傻갫ծꬊ鸬竲
    խ٥ぐXPSLFSָꬊず劍涸ח䱰殢〳腉

    View full-size slide

  31. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    堣腉
    ؙؒٔ荈⹛䮶׶ⴓֽ
    䱰殢堣圓
    ׉ך➭

    View full-size slide

  32. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ׉ך➭
    ٥Ⰻ%#חずׄNJHSBUJPO׾黝欽
    ٥ؙٓأةⰋ⡤פך5SBOTBDUJPO

    View full-size slide

  33. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    BDUJWFSFDPSEUVSOUBCMF
    ،فٔ؛٦ءّٝؒٝآص،ָ噰⸂䩛׾ַ
    ֽ׆ח幥׬宏䎂ⴓ侔׾㹋植

    View full-size slide

  34. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    㼪Ⰵ٥麊欽

    View full-size slide

  35. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    㼪Ⰵ
    㼎韋麊欽⚥ך؜٦ي
    NPEFM侧

    View full-size slide

  36. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ؟٦غ圓䧭
    EC
    EC
    EC
    EC EC
    EC
    "1
    EC
    EC EC
    EC

    View full-size slide

  37. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ⴓ侔
    ٥傀ח麊欽⚥ך،فٔ
    ٥%"6ծ竰竲桦ծ頾蚚朐屣ד✮庠

    View full-size slide

  38. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    㼎䘔؝٦س䊴ⴓ
    $MBTT -0$ "EE %FM
    NPEFMT
    DPOUSPMMFS
    T

    View full-size slide

  39. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ر٦ة獳遤⡲噟
    傀㶷%#ךر٦ة׾ⴓⶴׅ׷
    鷄⸇ׅ׷؟٦غ׾TMBWFה׃גאזּ
    ♶䗳銲זر٦ة׾⵴ꤐ

    View full-size slide

  40. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    㼪Ⰵ

    View full-size slide

  41. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    侧ؕ剢䖓

    View full-size slide

  42. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    䠬䟝׾耀ְג׫׋
    չוֲד׃׋պ

    View full-size slide

  43. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    䠬䟝׾耀ְג׫׋
    1.孑չ׮ֲ✳䏝ה

    װ׶׋ֻזְדׅיպ

    View full-size slide

  44. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    sĪ

    View full-size slide

  45. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    וך鴟ָא׵ְ

    View full-size slide

  46. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    宏䎂ⴓ侔ךא׵׫
    堣腉ⵖꣲ
    1MVHJO&OHJOFך娤
    ؒٝآص،פךワ濼

    View full-size slide

  47. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    堣腉ⵖꣲ
    !
    ٥⢪ִזְָؙ֮ؒٔ׷
    ٥QBHJOBUJPO
    ٥꧊鎘Ⳣ椚
    ٥⦐ⴽ%#פ㉏ְさ׻ׇ穠卓׾و٦آ
    ٥堣腉荈⡤׾⵴ꤐׅ׷ֿה׮
    4&-&$5'30.VTFST03%&3#:JE-*.*5

    View full-size slide

  48. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    1MVHJO&OHJOFך娤
    ٥%#禸ךQMVHJO㠨徦
    ٥BSJNQPSU BDUT@BT@BSDIJWF
    ٥&OHJOF
    ٥UVSOUBCMF㼎䘔ꬊ㼎䘔

    View full-size slide

  49. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ワ濼
    宏䎂ⴓ侔ך罋䣁
    ٥ٕ٦ٕך䗡䎿ծ5*14ךⰟ剣
    %#鏣鎘
    խ٥%#"׾❛ִ׋ٖؽُ٦

    View full-size slide

  50. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    麊欽⚥
    ٥宏䎂ⴓ侔ꟼ鸬ךꥺ㹱כ➙ךהֿ׹搀׃
    ٥֮ת׶ח׮农럀ח׃ֺׅ׋䠬

    View full-size slide

  51. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    תה׭

    View full-size slide

  52. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    תה׭
    ٥3BJMTד宏䎂ⴓ侔׾$BTVBMח䪔ֲ倯岀
    ٥麊欽ח鯹ׇ׷ךכ$BTVBMהכְַזְ

    View full-size slide

  53. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    BDUJWFSFDPSEUVSOUBCMF
    SFMFBTF
    !
    3BJMT 㼎䘔
    IUUQTHJUIVCDPNESFDPN
    BDUJWFSFDPSEUVSOUBCMF

    View full-size slide

  54. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    ׀幠耮֮׶ָהֲ׀ְׂת׃׋

    View full-size slide

  55. $PQZSJHIU%SFDPN$P -UE"MM3JHIUT3FTFSWFE
    株式会社ドリコム  会社概要

    http://www.drecom.co.jp/
    社名:  
    設⽴立立:  
    証券コード:  
    本社:  
    電話番号:  
    社員数:  
    資本⾦金金:  
    事業内容:  
    !
    !
    !
    !
    株式会社ドリコム  
    2001年年11⽉月13⽇日  
    3793  (東証マザーズ)  
    〒153-‐‑‒0064  東京都⽬目⿊黒区下⽬目⿊黒1丁⽬目8-‐‑‒1  アルコタワー17F  
    TEL:03-‐‑‒6682-‐‑‒5700  FAX:03-‐‑‒6682-‐‑‒5711
    227名  (正社員・契約社員のみ)※2014年年3⽉月31⽇日現在  
    1,124百万円  ※2014年年3⽉月31⽇日現在  
    ソーシャルゲーム事業、ソーシャルラーニング事業、広告事業、メディア事業

    View full-size slide