ãã®ãããFalconã®æ©èœã®äžéšïŒä»¥äžãç¡æ翻蚳ïŒïŒ
- ã¹ãã³ããã¯ã®æ¬ åŠã Falconã¯ã¹ãã³ããã¯ã䜿çšããŸããã ãªãœãŒã¹ã䜿çšã§ããªãå Žåããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã匷å¶çã«ã¹ã¿ã³ãã€ã¢ãŒãã«ç§»è¡ãããç¬èªã®ããã¯ã¡ã«ããºã ã䜿çšããŸãã ãããäœã«ã€ãªããããèŠãŠã¿ãŸãããããè€æ°ã®ããã»ããµããµããŒããããŠããOSã®æ¡ä»¶äžã§ã¯ãããã€ãã®çš®é¡ã®ããã¯ã«å¯ŸããŠãè€æ°ã®ç«¶åãçºçããå¯èœæ§ãããå Žåãã¹ãã³ããã¯ã䜿çšããå¿
èŠããããŸãã çŸåšãããã€ãã®ã©ãããããã«ãè€æ°ã®ããã»ããµãã€ã³ã¹ããŒã«ãããŠãããããã¹ãã³ããã¯ã1ã€ã®CPUã®CPUæéãç¡é§ã«äœ¿çšããŠããç¶æ³ãå®çšçãªã¡ãªãããªãã«å¿ããããšãã§ããŸãã åæã«ãã¹ãã³ããã¯ã¯è³¢æã«äœ¿çšããå¿
èŠããããŸãã
- æååããã£ãã·ã¥ããŸãã Falconã§ã¯ãããŒãã«ã®åã
ã®è¡ããã£ãã·ã¥ã§ããããã ããã¯ãåãéã®RAMã§ããå€ãã®ããŒã¿ãä¿åã§ããããšãæå³ããŸãã 8ã16 KBã®ããŒãžãã1è¡ã ãããã£ãã·ã¥ããå¿
èŠãããå ŽåããããŸãããããŒãžã¬ãã«ã§ãã£ãã·ã¥ãããšãããŒãžå
šäœãä¿åããå¿
èŠããããŸãã ã€ãŸãããããããæ°ããããŒãžã«ãã1000åã®100ãã€ãè¡ããã£ãã·ã¥ã«ãã£ãã·ã¥ããå¿
èŠãããå ŽåãFalconã§ã¯8ã16 MBã§ã¯ãªã100 KBãå²ãåœãŠãã ãã§æžã¿ãŸãã å®éã«ã¯ãããŒãžãã£ãã·ã³ã°ãæé©åã§ããç¹å¥ãªææ³ããããŸãããã®ãããå®éã«ã¯ã²ã€ã³ã¯ãããã«å°ãªããªããŸãã
- åºå®ãã£ãã·ã¥ããªã¥ãŒã ã®ä»£ããã«ãç¯å²ã ææ§ãªããšã«å ããŠããã€ããŒãã§ã³ãžã Vryatã§ã¯ãFalconã¯åºå®å€ã§ã¯ãªãããã£ãã·ã¥ã«å²ãåœãŠãããã¡ã¢ãªéã®æå°ãŸãã¯æ倧å¶éã䜿çšããŠããããšãããããŸãã 8 GBã®RAMãããããã£ãã·ã¥ã«4 GBãå²ãåœãŠãããšã«ããå ŽåãmySQLããããã®ã®ã¬ãã€ããã©ã®ããã«ç®¡çããããæ°ã«ããŸããïŒ ãã®å Žåããã£ãã·ã³ã°ãå¯èœãªéãå¹ççã«ãªãããã«ã3 GBãŸãã¯3.8 GBã®ç¯å²ãèšå®ããå¿
èŠããããŸããïŒ éãã¯äœã§ããïŒ æå°å€ãšæ倧å€ãäºãã«è¿ãã«èšå®ãããšãã¡ã¢ãªã¯ãªãŒãã³ã°ãé »ç¹ã«éå§ãããªããªããŸããïŒ ãã®ä»¶ã«é¢ããããã¥ã¡ã³ãã«ã¯å
·äœçãªèª¬æã¯ãããŸããã
- å°æ°ã®èšå®ã ããããããã¯åã®æ®µèœãšã¯å€å°çžåãããã®ã§ãããå¹³åçãªãŠãŒã¶ãŒã§ã¯ãªããå®éšè
ã®èŠ³ç¹ããèŠãŠã¿ãŸãããã ããŒã¿ããŒã¹ã®åäœãèªåã®ããŒãºã«åãããŠã«ã¹ã¿ãã€ãºããããã®èšå®ãå¢ããããã§ãã ç§ã¯ã管çãå¿
èŠãšããªãããšããååã倧奜ãã§ãããŒã¿ããŒã¹ãç§ã®ããã«ããããããšãããŠãããããšãæã¿ãŸããããŸãããããç§ãããããŸãããããšã蚌æããå¿
èŠããããŸãããããŠç§ãèªåã®æã§èªåã§äœã£ããã®ã ãããŸã§ããã¹ãŠã®ãµãŒããŒè² è·ã¢ãŒãã«é©ããèªåæ§æãèŠãããšã¯ãããŸããããæšæºãã¢ãŒãã§ã¯åé¡ãªãå®è¡ã§ããŸãããmySQLã§é »ç¹ã«çºçããéæšæºã¢ãŒãã§äœæ¥ããå Žåã¯å¹æããããŸããã
- å°ããªã€ã³ããã¯ã¹ã ã¹ããŒã¹ãã»ãšãã©å æããªãã€ã³ããã¯ã¹ã¯åªããŠããŸãã äžæ¹ã巚倧ãªã€ã³ããã¯ã¹ã¯ãInnoDBã®é«ãããã©ãŒãã³ã¹ã®éµã§ãã ãããã£ãŠãå®éã«ã¯ãã€ã³ããã¯ã¹ãã©ã®çšåºŠãå°ãããªããããã·ã¹ãã ããã©ãŒãã³ã¹ãã©ãã ãäœäžãããïŒãŸãã¯ã©ãã ãå©çãåŸããããïŒã確èªããå¿
èŠããããŸãã Falconããã¹ããããªãªãŒã¹ã§ã¯ãSHOW TABLE STATUSã³ãã³ãã¯ã€ã³ããã¯ã¹ã®ãµã€ãºã衚瀺ããªãããããã®ã€ãããŒã·ã§ã³ãè©äŸ¡ããããšã¯å°é£ã§ãã
- USING INDEXã³ãã³ãããããŸããã Falconã¯ãéžæãã€ã³ããã¯ã¹ã«å«ãŸããããŒã¿ã®ã¿ãååŸããå Žåã§ããè¡ã®ã³ã³ãã³ããåžžã«è¡šç€ºããããã«åŒ·å¶ãããŸãã ããã¯å€§ããªåé¡ã ãšæããŸã ãã€ã³ããã¯ã¹ã®ã«ããŒãïŒã€ã³ããã¯ã¹ã®ã«ããŒïŒã«ãããå€ãã®ã¯ãšãªã®ããã©ãŒãã³ã¹ã倧å¹
ã«åäžããŸãã
- ããŒã¿ã®æŽç¶ãšããèªã¿åãã ã€ã³ããã¯ã¹ãã¹ã«åŸã£ãŠããŒã¿ãèªã¿åãä»ã®ãšã³ãžã³ãšã¯å¯Ÿç
§çã«ãFalconã¯æåã«ã€ã³ããã¯ã¹å
šäœãïŒããããã€ã³ããã¯ã¹ãçµã¿åãããŠïŒåŠçãããã®åŸã«é åºä»ããããããŒã¿ãèªã¿åãããšã§ããã®ããã»ã¹ãæé©åã§ããŸãã ããã¯ãããŒãã«ãã倧éã®ããŒã¿ãéžæããå¿
èŠãããå Žåã«éåžžã«åœ¹ç«ã¡ãŸãã ãã ãããã®ãããªå¯èœæ§ã¯mySQLãšã³ãžã³ã®ã¬ãã«ïŒã¹ãã¬ãŒãžãšã³ãžã³ã¬ãã«ïŒãããé«ãããå¿
èŠããããšèããŠããŸããã»ãšãã©ã®ã¿ã€ãã®ãšã³ãžã³ããããŠç¢ºãã«MyISAMãšInnoDBã«ç©ççãªå Žæã®é åºã§è¡ãèªã¿èŸŒãããšãã§ããŸãã ãã®ãããªèšç»ã¯ãã°ããåã«èãããã®ãèŠããŠããŸããããã®æ¹åã§äœããè¡ãããŠãããã©ããã¯ããããŸããã
- ã€ã³ããã¯ã¹ã¯ã©ã¹ã¿ãªã³ã°ã®ãµããŒãã®æ¬ åŠã InnoDBãšã¯ç°ãªããFalconã¯ãã©ã€ããªã€ã³ããã¯ã¹ãŸãã¯ãã®ä»ã®ã€ã³ããã¯ã¹ã«ãã£ãŠããŒã¿ãã°ã«ãŒãåããŸããã å Žåã«ãã£ãŠã¯ãããã¯è¯ãããšãããã°ãæªãå ŽåããããŸãã å€ãã®æ¢åã®ã¢ããªã±ãŒã·ã§ã³ã¯InnoDBã®ãã®æ©èœã«äŸåããŠããããããã®æ©èœã¯æ°ãããšã³ãžã³ã®ãã€ãã¹é¢ã«ãªããããã§ãã ç§ã®æèŠã§ã¯ããã®æ©èœã¯ãªãã·ã§ã³ã«ããå¿
èŠããããŸãïŒããšãã°ãInnoDBã§æ¢ã«å®è¡ãããŠãããããé衚瀺ã®äž»ããŒãäœæã§ããŸãïŒãããã®æ©èœã¯ç§»æ€æ§ãäœããªããŸãã äž»ããŒãªã©ãåé€ããå¿
èŠããããŸãã äžéšã®ãã¬ãŒã³ããŒã·ã§ã³ã§ã¯ãFalconã¯ã¯ã©ã¹ã¿ãªã³ã°ã®ã€ã³ããã¯ã¹ãäœæããå¿
èŠããªããšäž»åŒµããŠããŸãã ããããèªããšãã«ç¹å¥ãªæé©åã䜿çšããŸãã ãã ããããã§ã¯ãããŸããã InnoDBã®äž»ããŒã®å°ããéšåãèªã¿åãå¿
èŠãããå ŽåãmySQLã¯æ°ããŒãžã®ã¿ãåç
§ããŸãããFalconïŒè¡ãç°ãªãæéã«è¿œå ãããã€ã³ããã¯ã¹ã«ãã£ãŠãåæ£ããããå ŽåïŒã¯ãããã«å€ãã®ããŒãžãèªã¿åãå¿
èŠããããŸãã ããšãã°ãInnoDBã§ã®ã¯ã©ã¹ã¿ãªã³ã°ã®å
žåçãªã±ãŒã¹ãèããŠã¿ãŠãã ãã-ã¯ã©ã¹ã¿ãŒåãããããŒïŒuser_idãmessage_idïŒãæã€ããŒãã«å
ã®ãŠãŒã¶ãŒã¡ãŒã«ããã¯ã¹ã
- è¡å§çž® Falconã¯ãè¡åäœã§ã®é«éããŒã¿å§çž®ã®ããã®ã¡ã«ããºã ãå®è£
ããŠããŸãã ããšãã°ãæŽæ°å€ã«å¿
èŠãªã ãã®ãã€ãæ°ã䜿çšãïŒæ倧å€ã«å²ãåœãŠãããŠãããã€ãæ°ã§ã¯ãªãïŒãããã©ã«ãå€ãšçããå Žåã¯åã«å€ãä¿åããŸããã ããã¯å€§ããªé©æ°ã§ãããããã€ãã®å°é£ãåŒãèµ·ããå¯èœæ§ããããŸãïŒããšãã°ãåã®ããã©ã«ãå€ãå€æŽããå ŽåãFalconã¯ã¡ã¿ããŒã¿ãå€æŽããã ãã§ãªããããŒãã«å
šäœãåæ§ç¯ããå¿
èŠããããŸãïŒãã ãããã®æ©èœãå®è£
ãããŠããŸããïŒ mySQLã§ïŒã InnoDBã«å®è£
ãããééçãªgzipå§çž®ãšæ¯èŒããFalconã®ããã©ãŒãã³ã¹ãšå§çž®ã®æ¯çãèŠãã®ã¯éåžžã«èå³æ·±ãã§ãããã
- ããŒã¿ããŒã¹ã¬ãã«ã®ããŒãã«ã¹ããŒã¹ã çŸåšã®ãªãªãŒã¹ã§æ°ã¥ãããããããŸããããFalconã¯ããŒã¿ããŒã¹ããšã«åå¥ã®ããŒãã«ã¹ããŒã¹ãšç¬èªã®ãã°ãäœæããŸãã ããŒãã«ããšã«åå¥ã®ãã£ã¬ã¯ããªãäœæããæšæºã®mySQLã¢ãããŒãã§ã¯ãããã«ããç¹å®ã®å°é£ãçããå¯èœæ§ããããŸãïŒãã©ã³ã¶ã¯ã·ã§ã³ãè€æ°ã®ããŒã¿ããŒã¹ãçæããå Žåãã³ãããããããšãïŒã€ãŸããã³ãããããããšãïŒãããã€ãã®ãã°ãæŽæ°ããå¿
èŠããããŸãã ããã«ãè€æ°ã®ããŒã¿ããŒã¹ã®ãã©ã³ã¶ã¯ã·ã§ã³åºå®ãåæããã«ã¯ã XAãã©ã³ã¶ã¯ã·ã§ã³ ïŒéåžžã«ãªãœãŒã¹ãæ¶è²»ããïŒã䜿çšããå¿
èŠããããŸãããŸãã¯ãããããŒã¿ããŒã¹ã§ãã©ã³ã¶ã¯ã·ã§ã³ãã³ãããããããå¥ã®ããŒã¿ããŒã¹ã§ã¯ã³ããããããªãå ŽåããããŸãã å¥ã®åé¡ã¯ããµãŒããŒã®ã·ãŒã±ã³ã·ã£ã«ãã¹ãããã·ã§ããããããŒã¿ããŒã¹å
ã§ã®ã¿ã·ãŒã±ã³ã·ã£ã«ã«ãªããããããŒã¿ããŒã¹Aã«ã¢ã¯ã»ã¹ããå°ãåŸã«ããŒã¿ããŒã¹Bã«ã¢ã¯ã»ã¹ãããã©ã³ã¶ã¯ã·ã§ã³ãéå§ãããšãããŒã¿ããŒã¹Bã«æ¬¡ã®è¡ã衚瀺ãããããšã§ãããã©ã³ã¶ã¯ã·ã§ã³ã®éå§åŸã«è¿œå /æŽæ°ãããŸããã
- åé¢ã¢ãŒãã Falconã¯çŸåšãéåžžã«éãããã¯ãšãªåé¢ã»ããããµããŒãããŠããŸãïŒSELECT FOR UPDATEã¯ãšãªããµããŒãããŠããŸããïŒã Falconãšã³ãžã³ã¯ã競åã¢ã¯ã»ã¹ã®ããOptimisticããã¯ã¢ãã«ã䜿çšããŸããããã«ãããããã¯ãè¡ã¬ãã«ã§è§£æŸããããŸã§åŸ
ããªããã°ãªããªãå€æ°ã®UPDATEã¯ãšãªããããµãŒããŒã®ç¶æ
ã§åé¡ãçºçããå¯èœæ§ããããŸãã ããã«ããã©ã³ã¶ã¯ã·ã§ã³ãUPDATEã¯ãšãªã§å®äºããã®ããšã³ãžã³ãåŸ
æ©ããŠãããšãã«ãããšã©ãŒ1020ïŒHY000ïŒïŒããŒãã« 't'ã§æåŸã«èªã¿åãããŠããã¬ã³ãŒããå€æŽãããŸãããïŒãã¬ã³ãŒãã¯ããŒãã«ã®æåŸã®èªã¿åã以éã«å€æŽãããŸãã "ïŒã ããã¯ããšã³ãžã³ã®ãã®åäœãInnoDBã®å Žåãããæªããšããããšã§ã¯ãªããç°ãªããããFalconã«åºã¥ããŠã¢ããªã±ãŒã·ã§ã³ãéçºãããšãã«èæ
®ããªããã°ãªããŸããã ãã®åé¡ã«é¢ããããã¥ã¡ã³ããååã§ã¯ãããŸããã
- ããŒãžãžã®éšåçãªæžã蟌ã¿ã«å¯Ÿããä¿è·ã¯ãããŸããã ããã¯ããã®ããŒãžã®ãšã³ããªãã¢ãããã¯ã§ãªãå Žåãã€ãŸã ããŒãžã®äžéšãå€æŽãããå ŽåãããŒãžã®å¥ã®éšåãå€ããŸãŸã§ãããšãããŒãã«ã修埩äžå¯èœãªã»ã©æå·ããå¯èœæ§ããããŸãã InnoDBãäºéæžã蟌ã¿ãããã¡ãŒã䜿çšããã®ã¯ãã®ããã§ãïŒ æ³šïŒInnoDBã¯æåã«ããããããŒãã«é åã®é£æ¥ã»ã¯ã·ã§ã³ã«æžã蟌ãã§ãããã¡ã€ã«ã«ããŒãžãæžã蟌ã¿ãŸãããããã£ãŠããªã«ããªäžã®é害ã®åŸãInnoDBã¯é£æ¥ã»ã¯ã·ã§ã³ã®ããŒã¿ã®ã³ããŒãèŠã€ããããšãã§ããŸã ïŒã ãžã ã¯ãããé倧ãªåé¡ãšã¯èããŠããŸããããäºéæžã蟌ã¿ãããã¡ãŒãå°å
¥ããåã«InnoDBãšã³ãžã³ã䜿çšãããšãã«äœåºŠãééããŸããã PostgreSQLãšOracleã®éçºè
ãšè©±ãããšãããç§ã¯åœŒãå
šå¡ããã®åé¡ãèªèããŠãããç¬èªã®å¯ŸåŠæ¹æ³ãæã£ãŠãããšããçµè«ã«éããŸããããã®ãããJimããããããŸãä¿¡ããªãçç±ãããããŸããã
- ãã£ã¹ã¯äžã®ããŒã¿ã¯ããã©ã³ã¶ã¯ã·ã§ã³ãã³ããããããåŸã«ã®ã¿å€æŽãããŸãã InnoDBãšã³ãžã³ã¯ããã®ãããªã³ãã³ããçºè¡ãããçŽåŸã«ãã¡ã€ã«å
ã®ããŒã¿ãå€æŽããŸããäžæ¹ãFalconã¯ãã³ãããåŸã«ã®ã¿å€æŽããŸãã ãã®ç¬éã«ã¯ããã©ã¹ã®åŽé¢ïŒããšãã°ã倧èŠæš¡ãªãã©ã³ã¶ã¯ã·ã§ã³ã®é·ãããŒã«ããã¯ããªãããšïŒãšãã€ãã¹ã®åŽé¢ïŒRAMéã®èŠä»¶ã®å¢å ïŒã®äž¡æ¹ããããŸãã ã»ãšãã©ã®ãã©ã³ã¶ã¯ã·ã§ã³ã¯å°ããããšã«åæããŸãããããšãã°äœãããããåŠçããå Žåã¯ãã¡ã¢ãªã®éãå¢ãããããã©ã³ã¶ã¯ã·ã§ã³ãããé »ç¹ã«ã³ãããããããã«ãªã¯ãšã¹ããæžãæããå¿
èŠããããŸãã
- ã¿ã€ãBLOBã®ããŒã¿ã䜿çšããäœæ¥ã®æé©åã Jimã¯BLOBãèªåã®åäŸãšããŠæããŠãããããFalconã¯BLOBãæ±ãããã«æé©åãããŠããŸããããšãã°ãããŒã¿ããŒã¹ãžã®BLOBã®çŽæ¥æžã蟌ã¿ãå®è£
ãããŠããŸãã ãã®æé©åã®çµæãå®éã«èŠãã®ã¯é¢çœãã§ãããã
ããã¥ã¡ã³ãã§æ å ±ãèŠã€ãããªãã£ããã1ã€ã®èå³æ·±ãç¹ã¯ãæçååŠçã§ããè¡ãæŽæ°ãããšã©ããªããŸãã-æŽæ°ãããè¡ã¯åãå Žæã«ä¿åãããŸããããããšãæ°ããè¡ã«ä¿åãããŸããïŒ MyISAMã®å Žåã®ããã«ãè¡ã¯ããã€ãã®éšåã«åå²ãããŠããŸããããããšãåžžã«ã³ã³ãã¯ãã«æ ŒçŽãããŠããŸããïŒ ãããã¯ããšã³ãžã³ã®I / Oããã©ãŒãã³ã¹ã«é¢ããéåžžã«éèŠãªè³ªåã§ãã
PS翻蚳è ããã®PSïŒçŸåšããšã³ãžã³ã¯4幎以äžéçºãããŠãããããŒã¿çã¯ãŸã ç²æ«ãªãããFalconã¯ãç¥ç¶æ¯ãInnoDBã ãã§ãªãMyISAMã«å¯ŸããŠãã»ãšãã©ãã¹ãŠã®ãã¹ãã倱ããŸãã åæã«ãMariaãšã³ãžã³ã¯éåžžã«é«éã«éçºãããŠããŸãïŒãã®ãšã³ãžã³ã¯InnoDBã§ã¯ãªãMyISAMã®éçºã§ãããå®å šã«ãã©ã³ã¶ã¯ã·ã§ã³åã§ããããã¹ãŠã®ACIDããããã£ãåããŠããŸãïŒãæ©äŒã