MySQL ã¦ã¼ã¶ã³ã³ãã¡ã¬ã³ã¹ã«è¡ã£ã¦ãã¾ãã (1æ¥ç®)
MySQL ã¦ã¼ã¶ã³ã³ãã¡ã¬ã³ã¹ã«è¡ã£ã¦ãã¾ãããèªåãåè¬ããã»ãã·ã§ã³ã«ã¤ãã¦ãã£ããã¾ã¨ãã¾ãã
â»ããã¾ã§ãç§ã®èãã(ã¤ããã®)å 容ã¨ç§ãæ¸ããã¡ã¢ãå ã«ãªã£ã¦ããã¾ãã®ã§ãå®éã®ã»ãã·ã§ã³ãçºè¨ã¨ã¯ç°ãªãå¯è½æ§ãããã¾ãã
E-1ãã¤ã°ã¬ã¼ã·ã§ã³ã®åºç¤
Oracle ãªã©ãä»ã® DB ãã MySQL ã«ç§»è¡ããéã®æ¦è¦ã«é¢ããã»ãã·ã§ã³ã
ãã¤ã°ã¬ã¼ã·ã§ã³ãã§ãã¯ãªã¹ã
MySQL ã® PS é¨éã使ã£ã¦ãããã§ãã¯ãªã¹ãããããã©ã®ããã移è¡ã大å¤ãã®ç®å®ã«ãªãããã ã
- OLTP ã DWH ã Read-Intensive ãï¼
- ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã®é¸æã«å½±é¿
- æé
- ãã¼ã«
- ETL, ã¹ã¯ãªãã, æåã§ã®æ¸ãæã, PS
- PL/SQL, T-SQL ãªã©ãDB ç¬èªã®æ©è½ã使ã£ã¦ããã¨ç§»è¡ã大å¤
- ãã®å ´åã¯æåã§æ¸ãæãããããªã
- ã©ããªãã¼ã¿ãã¼ã¹ãªãã¸ã§ã¯ãããããï¼
- å¤é¨ã® C ããã°ã©ã ãã©ã®ããããããï¼
- (ãªã¬è¨»: Perl ã¨ãä»ã®ããã°ã©ã ã§ãå½±é¿ããã¨æããªã)
- 帳票ã¯ã©ã®ããããããï¼
- DB ã®ãµã¤ãºã¯ã©ã®ããããï¼
- ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã®é¸æã«å½±é¿
- åæã¦ã¼ã¶æ°
- ãã¹ã¿/ã¹ã¬ã¼ããªã©ãDB ã®ã¢ã¼ããã¯ãã£ã«å½±é¿
- åä½æéãããã®ã¯ã¨ãªé
- 移è¡ããã¤ãã§ã«ãã¼ã¿éãå¢ãããããå¯ç¨æ§ãä¸ããããããï¼
Oracle -> MySQL ã®ç§»è¡
- ãããã©ã¤ã¨ã¿ãªãããªã¼ãã³ã¸ã®ç§»è¡ã¨ããã¡ãªãããããããä¸çªã®ã¡ãªããã¯ã³ã¹ã
- ãã¼ã¿åã¯ã ããããµãã¼ãããã
- ROWID, Interval ã»ãã»ã, TIMESTAMP ãªã©ã¯ãã¡
- LOB, æåå, æ°å¤ã¯åçã®æ©è½ãæã£ããã¼ã¿åã«ç½®ãæãã
- PL/SQL ã¯æåã§ã®æ¸ãæããå¿ è¦
(ãªã¬è¨»: çµæ§å¤§å¤ããã ...)
Migration Toolkit
- MySQL ãæä¾ãã移è¡ãã¼ã«
- GUI ãã¼ã«
- ç´æ¥ãã¼ãã«ãä½æãããã¨ãã§ããããä½æã¹ã¯ãªãããä½ããã¨ãã§ãã
MS SQL Server -> MySQL ã®ç§»è¡
- åºæ¬ãã¼ã¿åã¯å¤§ä½ä½¿ãã
- ã§ãååã®ç½®ãæãã¯å¿ è¦
- T-SQL ã¯æä½æ¥ã§æ¸ãæããå¿ è¦
- Migration Toolkit ã使ãã
Q.A.
- 質åããã¾ããªãã£ãã®ã§ãçºè¡¨è ããé質åã
(çºè¡¨è ) : ããã®ä¸ã§ãä»ã® DB ãã MySQL ã«ç½®ãæããçµé¨ã®ããã²ã¨ã¯ï¼ã
- > ææãã人ã1å
(çºè¡¨è
) : ã©ãã ã£ãï¼
(ææãã人) : çµæ§å¤§å¤ãOracle -> MySQL ã®ç§»è¡ã§ãOracle ã ã¨ããå æ¸ã«ã¤ã³ããã¯ã¹ãå¼µã£ã¦ãããããããã©ã¼ãã³ã¹ãåºãããMySQL ã ã¨ããªããã¥ã¼ãã³ã°ãå¿
è¦ã ã£ã
(çºè¡¨è
) : MySQL ã®ãã¼ã¸ã§ã³ã¯ï¼
(ææãã人) : 4.X
(çºè¡¨è
) : 4.X ã ã¨ä»ããããã©ã¼ãã³ã¹ãè¯ããªã
ææ
ãã¯ããã¤ã°ã¬ã¼ã·ã§ã³ã¯å¤§å¤ããã ãªãã¨ããã®ã第ä¸å°è±¡ãã¨ãã« Oracle ã使ã£ã¦ããå ´åã¯ã³ã¹ãã¡ãªããã¯å¤§ããããã©ãã移è¡èªä½ã«ããªãã³ã¹ããããã£ã¦ãã¾ãã®ã§ã¯ãªãããMigration Toolkit ã¯ã©ãã¾ã§ä½¿ãããæ£ç´çåã
E-2 Memcached and MySQL
- ç«è¦ãåºã¦ããã¿ããªèå³ãããã¿ãã
åºèª
- LiveJournal ã¨ããã¨ããã§ã30GB ã®ãã£ãã·ã¥/æ°TB ã® DB ãå®è£ 使ã£ã¦ããã¨ãã«ä½ã£ããããã
- ä»ã§ã¯ mixi ãªã©ãè²ã ãªæã§ä½¿ããã¦ãã
ã¢ã¼ããã¯ãã£
- ãµã¼ãã¯ã·ã³ãã«
- ã¯ã©ã¤ã¢ã³ãã¯ãµã¼ãã®æ
å ±ãæã¤
- ãã§ã¤ã«ãªã¼ãã¼ãã¯ã©ã¤ã¢ã³ãã§è¡ã
- èªè¨¼ã¯ã§ããªã
- LAN å ã«å ¥ãããã¨
- Consistent Hash ã¨ããããã¿ã使ã£ã¦ããããã
- 詳細㯠Wikipedia
libmemcached
è² è·
- CPU ã¯ãã¾ã使ããªã
- ã»ã¼ 0
ææ°ãªãªã¼ã¹(1.2.5)ã«ã¤ãã¦
- è¤æ°ã®ãããã¯ã¼ã¯ã¤ã³ã¿ã¼ãã§ã¼ã¹ã®ãµãã¼ã
- ãã¼ã«é¡ã®æ´å
- Solaris 対å¿
ä»å¾ã«ã¤ãã¦
- ãã¤ããªãããã³ã«ã®ãµãã¼ã
- google ã® Protocol Buffers ãæèãã¦ãã®ããªï¼
- Consistent Hash 以å¤ã®ã¨ã³ã¸ã³ã®ãµãã¼ã
- ã¨ãã« Queue ããµãã¼ããããããã
Q.A.
Q. ãµã³ãã«ã§ãDB ã®ããªã¬ã¼ã§ memcached ãå©ãã¦ããããè¯ãã®ãï¼ããã¥ã¡ã³ãã«ã¯ NG ã ã¨æ¸ãã¦ãã£ããã
A. åé¡ãªããå®éã«ä½¿ã£ã¦ããä¼æ¥ãããããã ãããªã¬ã¼ã使ãã¨ããã©ã¼ãã³ã¹ãè¯ããªããããç§ãªãæ®éã® select 㨠insert ã使ã
ææ
é£è§£ãªå 容ã ã£ãããããªãèå³æ·±ããã®ã ã£ããæè¿ã®ã¡ã¸ã£ã¼ãª Web ç³»ã®ä¼æ¥ã§ã¯ãè¯ã使ããã¦ããããããä¼æ¥æ¯ã«è²ã ãªæ§æããã£ã¦ãããé¢ç½ãã£ãã
E-3 MySQL Enterprise ãã¼ã«ã®ãç´¹ä»: WorkbenchãQuery AnalyzerãProxy
Enterprise Edition ãè³¼å ¥ããéã«å©ç¨ã§ãããã¼ã«ã«ã¤ãã¦
- Workbench
- Enterprise Edition
- Enterprise Monitor
- Query Analyzer
Workbench
- E-Rå³ã®ä½æãªã©ãè¡ããã¼ã«
- ç¾æç¹ã§ã¯ Windows ç¨
- æ¢å DB ã®ãªãã¼ã¹ã¨ã³ã¸ãã¢ãªã³ã°
- DB ã«ã¢ã¯ã»ã¹ã㦠E-Rå³ãä½æãã
- DB éã®æ¯è¼æ©è½
- ä¾) æ¬çªç°å¢ <=> éçºç°å¢ã®æ¯è¼
- åæå
- æ¯è¼ãã¦å·®åã®ãã£ãé¨åãåæãã
- ã¹ãã¼ãã®ã¿ããã¼ã¿ã¯ã§ããªã
- Freeçã¨æåç($99)ããã
- å©ç¨ã§ããæ©è½ã«å·®ããã
Enterprise Edition ã«ã¤ãã¦
- DB ã®ãµãã¼ã
- æ次ã¢ããã°ã¬ã¼ã
- HotFix etc
- ã¢ãã¿ãã¼ã«
- ãµãã¼ã
- Plutinum, Gold ãªã©
- 1å¹´æ¯ã®å¥ç´
Enterprise Monitor
- Web ãã¼ã¹ã®ã¢ãã¿ãªã³ã°ãã¼ã«
- ã¯ã©ã¤ã¢ã³ãã«ã¯ã¨ã¼ã¸ã§ã³ããã¤ã³ã¹ãã¼ã«ããå¿ è¦ããã
- SlowQuery Log
- æå®ã®æé以ä¸ããã£ã¦ããã¯ã¨ãªãæ¤åº
- ã¤ã³ããã¯ã¹ããªãã¯ã¨ãªãæ¤åº etc.
- Process List
- ç¾å¨ã®ããã»ã¹ãè¦ã
- EXPLAIN
- ã¯ã¨ãªã®åã«ã¤ãã
- truss/strace ã® SQL çã®ãããªæã
- SNMP ãã©ãããå¯è½
Query Analyzer
- ã¯ã¨ãªã®çµ±è¨ã表示ãããã¼ã«
- Enterprise Monitor ã«æè¿çµ±åããã
- MySQL Proxy ä¸ã«æ§æããã¦ãã
- Proxy ã¯éä¿¡ã仲ä»ãã¦ããã®ä¸èº«ã調ã¹ã
- ç»é¢ã¯ãããã¡ã¤ã©ã®ãããªæã
- æéãªã©ãæå®ãã¦ã¢ãã¿ãªã³ã°å¯è½
ææ
Query Analyzer ã¯æç¨ã ã¨æãããEnterprise Edition ãå¿ é ã§ãããããéããããããªãã¨ãã®ãã¥ã¼ãã³ã°ãã©ããããï¼ãã«ã¤ãã¦ã¯ããã¦ãã¦ãæºããªãã¨å°ãã®ã§ã¯ãªãããã¨æã£ãã
E-4 MySQL ã©ã¤ã»ã³ã¹ã®èãæ¹
å製åã¨ã©ã¤ã»ã³ã¹
- Enterprise Edition 㨠Communitiy Server(GPL)ããã
- Enterprise Edition ãããã©ã«ã㯠GPL
- ç¡åã§åç¨ã©ã¤ã»ã³ã¹ã«å¤æ´ã§ãã
- çµè¾¼ã¿ç(Embedded)ã¨ãããã¼ã¸ã§ã³ããã
- Cluster ããã
- å ±æãã£ã¹ã¯ãªãã®ã¯ã©ã¹ã¿
- GPL çã¨åç¨çããã
GPL
- GPL çã¯ãä»è
ã«é
å¸(Distribute)ããå ´åã¯ã½ã¼ã¹ãå
¬éããªããã°ãªããªã
- 社å ã§ã®å©ç¨ãªããä¿®æ£ãã¦ãå ¬éã®ç¾©åã¯ãªã
- ASP, ãã¹ãã£ã³ã°ã®å ´åã社å ã§ã®å©ç¨ã¨åæ§
FAQ
Q. ISV ã¢ããªãä½æãã¦ã¼ã¶ã« Communitiy Edition(GPL)ããã¦ã³ãã¼ããã¦ä½¿ã£ã¦ããããããã¯åé¡ãªãï¼
A. NGãJDBC ã³ãã¯ã¿ãªã©ãã¢ããªã¨ã®æ¥ç¶é¨åã GPL ã®ç¨ä»¶ãæºãããªããåç¨ã©ã¤ã»ã³ã¹ãè³¼å
¥ãã
Q. 社å
ã§å©ç¨ãã¦ããå ´åãã½ã¼ã¹ãä¿®æ£ãã¦ããã³ãã¥ããã£ã«ãã£ã¼ãããã¯ããªãã¦ãè¯ãï¼
A. åé¡ãªããã§ããã£ã¼ãããã¯ãã¦ã»ãã
Q. éçºã Community Server(GPLç)ã§è¡ãããµãã¼ãã欲ããã®ã§ Enterprise Edition ã®ã©ã¤ã»ã³ã¹ãè³¼å
¥ãããããããªã¹ã¯ãããã®ã§ãåç¨çã®ãã¤ããªã¨ç¾è¡ãå
¥ãæããã®ã¯ããããªãããã®å ´åã§ããµãã¼ããåãããããï¼
A. åé¡ãªãã(ãã ããMySQL Cluster ã®å ´åã¯ãã¤ããªã®å
¥ãæããå¿
è¦ãã¯ã©ã¹ã¿ã ã¨è²ã
è¤éãªããããã)
Q. Enterprise Edition ã®ãµãã¹ã¯ãªãã·ã§ã³ãè³¼å
¥ããªãã¨ã½ã¼ã¹ããã¦ã³ãã¼ãã§ããªããããã㯠GPL ä¸åé¡ãªãï¼
A. ãªãããã¤ããªãæä¾ããã顧客ã«ã¯ã½ã¼ã¹ãæä¾ãããããã
Q. ISV ã Community Server(GPLç)ã§ã½ã¼ã¹ãå«ãã¦é¡§å®¢ã«ç´å
¥ãISV <-> 顧客ã®ã©ã¤ã»ã³ã¹ãéGPLãããã¯åé¡ãªãï¼
A. NGãé
å¸ã«ããããããåç¨ã©ã¤ã»ã³ã¹ãè³¼å
¥ããå¿
è¦ããã
Q. 3rd ãã³ãã¼ã MySQL ã®ãã©ã°ã¤ã³ãä½æããå ´åã®ã©ã¤ã»ã³ã¹ã¯ï¼
A. ã±ã¼ã¹ãã¤ã±ã¼ã¹ã(ããªãé£ãããã ã£ã)
Q. Enterprise Edition ã®ã½ã¼ã¹ã(権å©ãæã£ã¦ãã)誰ããã¢ãããã¼ããã¦ã(ã¾ãããã®ã½ã¼ã¹ã使ã£ã¦ã)åé¡ãªãï¼
A. GPL ä¸ã¯åé¡ãªãããã ããSun ã¯è²¬ä»»ãæã¦ãªã(å¤åãµãã¼ããåããããªããªã)
ææ
æå¤ã¨é¢ç½ãã£ãã»ãã·ã§ã³ãèªåã¨ãã¦ããGPL ã«ã¤ãã¦èª¤è§£ãã¦ããé¨åããã£ãã