ã¯ããã«
ãCloud SQLï¼SQLï¼ã¨Bigtableï¼NoSQLï¼ã®ã³ã¼ãè¨è¿°ããã³å¦çã¹ãã¼ããæ¯è¼ã¯ä»¥ä¸ã®æ¡ä»¶ã§è¡ã£ã¦ãã¾ãã
ã³ã¼ãè¨è¿°
ãJavaè¨èªããã®ã¢ã¯ã»ã¹ã§ãCloud SQLã§ã¯MySQLã®åçSQLã使ç¨ããBigtableã§ã¯Low-Level APIã使ç¨ãã¦ãã¾ããBigtableã¢ã¯ã»ã¹ç¨ã®APIã¨ãã¦ã¯ãã®ä»ã«ãæ¥æ¬çºã®ãªã¼ãã³ã½ã¼ã¹ãã¬ã¼ã ã¯ã¼ã¯ã®Slim3ãJDOï¼Java Data Objectsï¼ãJPAï¼Java Persistence APIï¼ãªã©ãããã¾ãããã¢ã¯ã»ã¹ããã©ã¼ãã³ã¹ã§ã¯ãããã§ä½¿ç¨ããLow-Level APIãæãåªãã¦ããã¯ãã§ãã
å¦çã¹ãã¼ãæ¯è¼
ãå¦çã¹ãã¼ãã®æ¯è¼ã¯ãã¢ã¤ãã ãã¹ã¿ã®CRUDå¦çï¼ç»é²ã»åç §ã»æ´æ°ã»åé¤ï¼ãããããåãç»é¢å 容ããã®ã¢ã¯ã»ã¹ã§ãBigtableã¯ã¯ã©ã¦ãç°å¢ã§ãCloud SQLã§ã¯ã¯ã©ã¦ãã¨ãã¼ã«ã«ã®ä¸¡æ¹ã§æ¸¬å®ãè¡ã£ã¦ãã¾ããå¦çæéã®æ¸¬å®ã§ã¯è©²å½ã®ã¡ã½ãããå¼ã³åºãããç¬éããç»é²ãªã©ã®å¦çå®äºç´å¾ã¾ã§ã®æéããããããã®å¦çãã¿ã¼ã³ã§è¨5åé£ç¶ãã¦æ¸¬å®ãã¦ãã¾ãã
対象ã¦ã¼ã¶
- Google App Engine for Javaã«èå³ãããæ¹
- ã¯ã©ã¦ãã§ã®RDBï¼ãªã¬ã¼ã·ã§ãã«ãã¼ã¿ãã¼ã¹ï¼ä½¿ç¨ã«èå³ã®ããæ¹
å¿ è¦ãªç°å¢
ãEclipse 3.5ï¼Galileoï¼ã3.6 ï¼Heliosï¼ã3.7 ï¼Indigoï¼ã®ããããã
ãã¹ãã·ã¹ãã ã®æ§æã¨ç»é¢
ãä»åã®ããã©ã¼ãã³ã¹æ¯è¼ã¯å³1ã®ã·ã¹ãã æ§æã§è¡ããã¦ãã¾ããå³1ã§ã¯ããã©ã¦ã¶ããã®å ¥åãã¼ã¿ãjQueryã®éåæéä¿¡ã§ãµã¼ãã¬ããã«éä¿¡ãããµã¼ãã¬ããã¯åä¿¡ãã¼ã¿ããå¦çã¢ã¼ããå¤æãã¦å¯¾å¿ãããã¼ã³ãºã¡ã½ãããå¼ã³ã ãã¾ãã
ããã¼ã³ãºã«ã¯ããã®è¨äºã§ä½¿ç¨ããã¦ããCloud SQLããã³Bigtableç¨ã®ãã¹ã¦ã®å¦çã«ã¼ãã³ãã¡ã½ããã¨ãã¦ç¨æããã¦ããããªã¯ã¨ã¹ãã«å¿ãã¦MySQLã¾ãã¯Bigtableã«ã¢ã¯ã»ã¹ããè¦ããå¦çæéãè¿ãããã«ãªã£ã¦ãã¾ãã
ãç¾å¨ã®GAEã§ã¯ãæ°ãã«ä½æããã¢ããªã±ã¼ã·ã§ã³ã®ãã¼ã¿ã¹ãã¢ã¯ãããã©ã«ãã§HRDï¼High Replication Datastoreï¼ã使ç¨ããã¾ããHRDã¯SDK 1.4.1ãããµãã¼ãããã¦ãããå¾æ¥ã®Master/Slaveãã¼ã¿ã¹ãã¢ã«æ¯ã¹ã¦ãã¼ã¿ã®èªã¿è¾¼ã¿ã»æ¸ãè¾¼ã¿ã§ã®å¯ç¨æ§ãé«ããªã£ã¦ãã¾ãããæ¸ãè¾¼ã¿ã«è¦ããæéã¯ããé ããªãã¾ãã
ãã¼ã«ã«ç°å¢ã§ã®ã¤ã³ã¹ã¿ã³ã¹é¸æ
ãä»åã®ããã©ã¼ãã³ã¹ãã¹ãã§ã¯ãEclipseã使ç¨ãããã¼ã«ã«ç°å¢ã§ã®å®è¡é度ã測å®ãã¦ãã¾ãã
- ãã¼ã«ã«ç°å¢ã§Cloud SQLãå®è¡ããå ´åã¯ãMySQLãµã¼ããEclipseã®å¤ã§èµ·åãã¦ããå¿ è¦ãããã¾ãããçè ã®å ´åã¯ãããªã¼ã½ããã®XAMPPã使ç¨ãã¦ãã¾ãã
- ãã¼ã«ã«ç°å¢ã§ã¯MySQLã¤ã³ã¹ã¿ã³ã¹ã¨Google Cloud SQLã¤ã³ã¹ã¿ã³ã¹ã®ã©ã¡ãããé¸æãã¦å®è¡ãã¾ãããMySQLã¤ã³ã¹ã¿ã³ã¹ãé¸æããå ´åã®æ¹ãé¥ãã«ããã©ã¼ãã³ã¹ã®è¯ãå¦çé度ã測å®ããã¦ãã¾ãã
ããã ããMySQLã¤ã³ã¹ã¿ã³ã¹ã§ã¯ãã¼ã«ã«ç°å¢ã®MySQLã«ã¢ã¯ã»ã¹ããã®ã«å¯¾ãã¦ãGoogle Cloud SQLã¤ã³ã¹ã¿ã³ã¹ã§ã¯ãã¼ã«ã«ç°å¢ã§ãGAEã¯ã©ã¦ãä¸ã®MySQLãã¢ã¯ã»ã¹ãã¦ãã¾ããå¾ã£ã¦ãããã¯ã¼ã¯ã¬ã¤ãã³ã·ãããªãç°ãªã£ã¦ãããããã©ã¼ãã³ã¹ã®å·®ç°ã«ããªãå½±é¿ãã¦ããã¯ãã§ãã
ãã¤ã³ã¹ã¿ã³ã¹ã®é¸æã¯æ¬¡ã®ãããªæé ã§è¡ãã¾ãã
- Eclipseã®Project Explorerãã対象ã¨ãªãããã¸ã§ã¯ããå³ã¯ãªãã¯ãã¦ãªã¹ãã表示ããæä¸é¨ã«ããPropertiesãé¸æãã¦Propertiesç»é¢ã表示ãã¾ãï¼ãAlt+Enterãã§ã表示å¯è½ï¼ã
- 表示ãããPropertiesç»é¢ããGoogle -> App Engineã¨é¸æããã¨å³2ã®ãããªè¡¨ç¤ºã«å¤ããã®ã§ããã®ç»é¢ä¸é¨ã®ãGoogle Cloud SQLãã§ã¤ã³ã¹ã¿ã³ã¹ã®è¨å®ãè¡ãã¾ãã
- Google Cloud SQL㧠ãEnable Google Cloud SQLãããã§ãã¯ãããã¯Cloud SQL使ç¨ãã¦ããå ´åã¯ãã§ãã¯ãã¦ããã¯ãã§ããããã§å³ã®ãMy Instances..ããã¯ãªãã¯ããã¨ãååç´¹ä»ããã¯ã©ã¦ãä¸ã®Cloud SQLã管çãããGoogle APIs Consoleãç»é¢ã表示ããã¾ãã
- 次ã«ãéçºç°å¢ã§ã®SQLã¤ã³ã¹ã¿ã³ã¹ãé¸æãã¾ãããããã¯MySQLã¤ã³ã¹ã¿ã³ã¹ããã³Google Cloud SQLã¤ã³ã¹ã¿ã³ã¹ã®ã©ã¡ãã使ç¨ãããã¨ãã§ãã¾ãã