楽天ã®ç 究è ã®æ¹ã®çºè¡¨èãã¦ããã¨ãã®ã¡ã¢(大è¦æ¨¡ãã¼ã¿å¦çåºç¤ ROMA)
èªåãªãã®ã¡ã¢ãªã®ã§ããªãé©å½ã§ãã
楽天æè¡ç 究æã§ãã£ã¦ãããã¨
éçºãã¦ããã®
ROMAã¨ã¯ï¼
大è¦æ¨¡ã°ãªããRubyã«ããKey-Value Store
RDBã§ã¯ãã©ãã£ãã¯ã«èããããªãã
memocashãªã©ã使ããã¨ãã§ããããã¼ã¿ã®ä¿éãã¦ä½¿ããã¨ãã§ããã®ãä¸å®
使ãã®ã¯ä¸»ã«ã¨ã³ãã¦ã¼ã¶ã¼
ROMAãè½ã¡ãã¨1åéã§ä½åãã®æ失
çªçºã¦ããªãã©ãã£ãã¯ã®å¢å¤§ã«ãå¼·ãããå¿
è¦ã«ãªãã
ã¯ãªã¹ãã¹ãªã©ã®ããç¨åº¦ãã¤ãããã®ãäºæ³ã§ãããã©ãã£ãã¯å¢å¤§ã«åãã¦ãã
ä»ã¯ã§ãã¦ããªãããã¹ã¦ã®ãµã¼ãã¹ãåæã«ãã©ãã£ãã¯ãå¢å¤§ããããã§ã¯ãªãã®ã§
ãµã¼ãã¹ãåãããã·ã³ã®å°æ°ãå¤ããããããããªã
Fairy
æåæ½åºã®ç 究
楽天ã§åºã¦ãåºèã®æ¹ã
ã¯ããç»åã«æåãå
¥ãã人ãå¤ãã
è¬äºæ³ãªã©ã§ä½¿ã£ã¦ã¯ãããªãæåãå
¥ãã¦ã人ãããã®ã§æ³¨æã§ããããã«ç»åã®ä¸ã®æåãæ¤ç´¢ããããããããã«ãããã
ç»åæ¤ç´¢
巨大ç»åé²è¦§
ã¹ãã¼ããã©ã³ã®UIã使ã£ã¦æ¥½ããè²·ãç©ã§ããããã«
éçºã¯ä»ã¯å ¨é¨æ¥½å¤©ç 究æã®æ¹ã ãéçºãã¦ããã
ä¼æ¥ã¨ãã¦ROMAãªã©ã®æ°è¦æ§ã¯åãããã®ãï¼
- >ãã¡ããåãããã
ROMAã®æ°è¦æ§ã¯ï¼
- >Rubyã§ãã©ã°ã¤ã³ãæ¸ããã¨ãã§ããROMAãæ¡å¼µã§ããã
ããªãç°¡åã«æ¡å¼µã§ããåºç¤ç 究ã«ãããã«ãã¤ã¨èããããã
ROMAã®æ¦è¦
éçºç®ç
æ
å ±ççºãèµ·ãã¦ãã
大éã®ãã¼ã¿ãä¿åããã®ã¯å°é£ã
ãã¼ã¿ãå
¥ããã ãã§ãªããé«éã«ã¢ã¯ã»ã¹ãããã
ã¾ãããã¼ã¿ã®åªå¤±ãåé¿ãããã
å
·ä½ä¾
ã¦ã¼ã¶ã¼ã®é²è¦§å±¥æ´
å¢ãç¶ãããã¼ã¿
- 楽天ã¦ã¼ã¶æ°ã¯7000ä¸äººè¶ (æè¿ã¯æ¥æ¬äººä»¥å¤ããã)ã1ã¶æã«20ä¸äººç¨åº¦å¢å
ãµã¤ãå ¨ä½ã®PVã¨åç¨åº¦ã®ãã¼ã¿æ¸ãè¾¼ã¿
- 楽天ã®PVã¯1æ¥ãããç´1å
ROMAã¨ã¯ï¼
楽天ã§éçºããã¦ããRubyå®è£
ã®åæ£KVS
Rubyã§æ¸ãã¦ãã®ã¯æ¡å¼µããããããã
Rubyã¯ä»ã§ããé
ãã¨è¨ããããJITã³ã³ãã¤ã©ããã®ãã¡ã§ããã°ããããéããªãï¼
ã¾ã¤ãã¨ããã²ãæ°ã¨ã®å
±åç 究ã
Rubyã«ãã大è¦æ¨¡åæ£å¦çã¨ããã£ã¬ã³ã¸ã®ããã«ãä½ã£ã¦ããã
ROMAã®ç¹å¾´
åçã«ã¹ã±ã¼ã«ã¢ã¦ã
- ROMAã«åå ãããã·ã³ãåçã«è¿½å å¯è½
é害èæ§ãé«ã
- å©ç¨è ãåé·åº¦ãèªç±ã«è¨å®
- èªåã«ãã§ã¤ã«ãªã¼ãã¼æ©è½
é«éã§ãmemchashedã«äºæãªãã¼ã¿ã¢ã¯ã»ã¹
ãã©ã°ã¤ã³æ©æ§ã«ããROMAã®æ¡å¼µãå¯è½
- ç¬èªã³ãã³ããã¹ãã¬ã¼ã¸å®è£ ãRubyã§è¿½å ãå·®ãæ¿ãå¯è½
é²è¦§å±¥æ´ã«ROMAã使ç¨
- >ååã«èãããã
ROMAã®ã¢ã¼ããã¯ãã£
è¤æ°ãã·ã³ããæ§æãããPureP2P
Rubyå®è£
ã®åæ£KVS(DHT)
Zero-hope(or one hop)DHT
Consistent Hashing
ROMAã¯è¤æ°ã®ãã¼ããæã¡ããã®ãã¼ãåä½ã§ãã¼ã¿ãæ ¼ç´ç®¡ç
åãã¼ãã¯ã¦ãã¼låºãªããã·ã¥å¤ããã¡ãããã·ã¥ç©ºéãæ§ç¯
- ããã·ã¥å¤ã®è¨ç®ã«ã¯SHA-ï¼ã使ç¨
- ç¯å²ã¯0ã2ï¼¾ï¼ï¼ï¼or 2~64 ãªã©èµ·åæã«å¤æ´å¯è½ï¼
â»ãã¼ãã¯ç©ççãªãã·ã³ãæãã¦ããããã§ã¯ãªã
Zero-hopã§ã®ãã¼ã¿æ¢ç´¢
åãã¼ããå
¨ä½ã®ãã¼ãæ
å ±ãä¿æ
- æ³å®è¦æ¨¡ãé«ã 100å°ç¨åº¦ã®ãã¼ãæ å ±ã§ãããã
ã¯ã©ã¤ã¢ã³ããç°æ å ±ãä¿æãããã¨ãå¯è½
- ROMAã«åãã¦ã¢ã¯ã»ã¹ããéã«ãã¯ã©ã¤ã¢ã³ãã¯ç°æ å ±ãåå¾
- ã¯ã©ã¤ã¢ã³ããæ å½ãã¼ããè¨ç®ãã¦æ å½ãã¼ãã«ç´æ¥ã¢ã¯ã»ã¹
Virtual Nodes
ROMAãæ§æãããã·ã³ã¯è¤æ°ã®virtual nodesã管ç
Virtual nodesãç°ç¶
Replication
ã¯ã©ã¤ã¢ã³ããããã¼ã¿ãPUTãããã¨ããæ
å½ãã¼ãã¯èªå以å¤ã®ãã¼ãã«ããããã³ãã¼
- ROMAãèªåçã«è¡ã
- åé·åº¦ã¯ã¦ã¼ã¶ã¼ãè¨å®
- è² è·ç¶æ³ã«å¿ãã¦ã¯åé·åã«å¤±æãããeventual consistency
é害æã®åä½
- ãã¹ãããã¦ã³ãããããã¨èªåçã«ãã§ã¤ã«ãªã¼ãã¼ãã(ãã«ããã£ã¹ãã使ç¨)
- é害ãã¼ããåãé¢ããæ®ããã¼ãã§ãµã¼ãã¹ãç¶ç¶
- é©åº¦ã«åé·åº¦ã復æ§ãã
ROMAãªã¼ãã³ã½ã¼ã¹ã ããã¿ããªã¤ãã£ã¦ãï¼ï¼