{"id":50673,"date":"2018-03-07T00:00:00","date_gmt":"2018-03-07T08:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/"},"modified":"2025-11-14T07:53:38","modified_gmt":"2025-11-14T15:53:38","slug":"migrating-from-mysql-to-griddb","status":"publish","type":"post","link":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/","title":{"rendered":"MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c"},"content":{"rendered":"<h2 id=\"intro\">\u306f\u3058\u3081\u306b<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u79fb\u884c\u4f5c\u696d\u306f\u3001\u3068\u304d\u306b\u975e\u5e38\u306b\u96e3\u3057\u304f\u624b\u9593\u3084\u6642\u9593\u304c\u304b\u304b\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u591a\u304f\u306e\u4f01\u696d\u304c\u79fb\u884c\u306b\u95a2\u5fc3\u304c\u3042\u308a\u306a\u304c\u3089\u3082\u5148\u9001\u308a\u3057\u3066\u3057\u307e\u3044\u304c\u3061\u3067\u3059\u3002\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u79fb\u884c\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u5411\u4e0a\u3068\u30b3\u30b9\u30c8\u306e\u524a\u6e1b\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u304c\u3001\u79fb\u884c\u4f5c\u696d\u3092\u884c\u3046\u306b\u3042\u305f\u3063\u3066\u306f\u691c\u8a0e\u3059\u3079\u304d\u4e8b\u9805\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002\u901a\u5e38\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u79fb\u884c\u3092\u884c\u3046\u969b\u306b\u958b\u767a\u62c5\u5f53\u8005\u304c\u61f8\u5ff5\u3059\u308b\u306e\u306f\u3001\u65e2\u5b58\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30b9\u30ad\u30fc\u30de\u3092NoSQL\u30e2\u30c7\u30eb\u306b\u5408\u308f\u305b\u3066\u6b63\u3057\u304f\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u3082\u30461\u3064\u306f\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3057\u3066\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u518d\u914d\u7f6e\u3059\u308b\u65b9\u6cd5\u3092\u898b\u3064\u3051\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u554f\u984c\u306b\u5bfe\u51e6\u3059\u308b\u958b\u767a\u62c5\u5f53\u8005\u306e\u65b9\u3005\u306e\u305f\u3081\u306b\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u3001\u4ee3\u8868\u7684\u306a\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3042\u308bMySQL\u304b\u3089NoSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3042\u308bGridDB\u3078\u306e\u79fb\u884c\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h3 id=\"example\">\u592a\u967d\u5149\u767a\u96fb\u30b5\u30a4\u30c8\u306b\u304a\u3051\u308b\u4e8b\u4f8b<\/h3>\n<p>\u3053\u308c\u304b\u3089\u3054\u7d39\u4ecb\u3059\u308b\u79fb\u884c\u306b\u95a2\u3059\u308b\u30c7\u30fc\u30bf\u306f\u3001\u592a\u967d\u5149\u767a\u96fb(Photovoltaic) \u30b5\u30a4\u30c8\u3001\u901a\u79f0<b> PV\u30b5\u30a4\u30c8<\/b>\u306e\u4fdd\u5b88\u306b\u95a2\u9023\u3059\u308b\u3082\u306e\u3067\u3059\u3002 PV\u30b5\u30a4\u30c8\u306f\u3001\u6570\u767e\u304b\u3089\u6570\u5343\u306e\u30bd\u30fc\u30e9\u30fc\u30d1\u30cd\u30eb\u3092\u5099\u3048\u305f\u7523\u696d\u7528\u30b5\u30a4\u30c8\u3067\u3001\u96fb\u529b\u3092\u96c6\u3081\u3066\u96fb\u529b\u7db2\u306b\u9001\u308a\u307e\u3059\u3002 PV\u30b5\u30a4\u30c8\u306f<b>\u30bd\u30fc\u30e9\u30fc\u30d5\u30a1\u30fc\u30e0<\/b>\u3068\u3057\u3066\u3082\u77e5\u3089\u308c\u3001\u3053\u306e\u30d7\u30ed\u30bb\u30b9\u306b\u306f\u6570\u5343\u3082\u306e\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u5bfe\u5fdc\u30bb\u30f3\u30b5\u30fc\u304c\u95a2\u4e0e\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30bb\u30f3\u30b5\u304b\u3089\u3001\u96fb\u5727\u6e2c\u5b9a\u5024\u3084\u30a2\u30e9\u30fc\u30c8\u306a\u3069\u306e\u6e2c\u5b9a\u5024\u304c\u30c7\u30fc\u30bf\u30ec\u30dd\u30fc\u30c8\u3068\u3057\u3066\u9001\u3089\u308c\u3066\u304d\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u5de5\u696d\u7528\u30b5\u30a4\u30c8\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u30b5\u30a4\u30ba\u306b\u62e1\u5f35\u3067\u304d\u3001\u3055\u307e\u3056\u307e\u306a\u7a2e\u985e\u306e\u30c7\u30d0\u30a4\u30b9\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002\u9ad8\u6027\u80fd\u3001\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u3001\u67d4\u8edf\u6027\u3092\u5099\u3048\u305fGridDB\u306f\u3001\u3053\u306ePV\u30b5\u30a4\u30c8\u306b\u79fb\u884c\u3059\u308b\u305f\u3081\u306e\u6700\u826f\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3042\u308b\u3068\u3044\u3048\u307e\u3059\u3002<\/p>\n<p class=\"ta-c\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/newja\/wp-content\/uploads\/2019\/03\/pv_site_resize.png\" alt=\"\" width=\"688\" height=\"780\" class=\"aligncenter size-full wp-image-21893\"><\/p>\n<h3 id=\"new-schema\"> MySQL\u30b9\u30ad\u30fc\u30de\u3092GridDB\u30b9\u30ad\u30fc\u30de\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5<\/h3>\n<p>\u3053\u306e\u30b5\u30a4\u30c8\u306eMySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u306f\u3001<b> 4\u3064\u306e\u30c6\u30fc\u30d6\u30eb<\/b>\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e4\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u30014\u3064\u306e<a href=\"https:\/\/griddb.net\/newja\/docs\/documents\/5-1-6_container-schema.php\" title=\"Schema Creation in GridDB\">\u30b3\u30f3\u30c6\u30ca\u30b9\u30ad\u30fc\u30de<\/a>\u3092GridDB\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30b9\u30ad\u30fc\u30de\u306f\u3001Java\u3067\u79fb\u884c\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u30014\u3064\u306eJava\u30af\u30e9\u30b9\u3068\u3057\u3066\u5b9f\u88c5\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u8868\u3068\u305d\u306eGridDB\u30b9\u30ad\u30fc\u30de\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<ol id=\"schemas\">\n<li><b>Facilities:<\/b> Contains information and specifications for the facilities of the PV site.<\/li>\n<div style=\"display:\" block;\"=\"\">\n<div style=\"width: 50%; float: left;\">\n<div style=\"text-align: center;width: 90%\"><b>MySQL Facilities Table<\/b><\/div>\n<pre class=\"prettyprint\" style=\"width: 90%;\">CREATE TABLE IF NOT EXISTS facilities (\n   facilityId VARCHAR(40) NOT NULL,\n   name VARCHAR(60) NOT NULL,\n   specifications BLOB,\n   PRIMARY KEY (facilityId)\n);        \n<\/pre>\n<\/div>\n<div style=\"width: 50%; float: left;\">\n<div style=\"width: 90%; text-align: center;\"><b>GridDB Facility Container Schema<\/b><\/div>\n<pre class=\"prettyprint\" style=\"width: 90%;\">public class Facility{\n    @RowKey\n    public String facilityId;\n    public String name;\n    public Blob specifications;\n}\n<\/pre>\n<\/div>\n<div style=\"clear: both;\">&nbsp;<\/div>\n<\/div>\n<li><b>Sensor:<\/b> Stores general information like <i>sensor-type<\/i> and name on the PV site&#8217;s sensors<\/li>\n<div style=\"display: block;\">\n<div style=\"width: 50%;float: left;\">\n<div style=\"text-align:center; width: 90%;\"><b>MySQL Sensor Table<\/b><\/div>\n<pre class=\"prettyprint\" style=\"width: 90%;\">CREATE TABLE IF NOT EXISTS sensors (\n   sensorId VARCHAR(40) PRIMARY KEY (sensorId),\n   facilityId VARCHAR(40) NOT NULL,\n   name VARCHAR(60) NOT NULL,\n   type VARCHAR(30) NOT NULL,\n   FOREIGN KEY(facilityId) REFERENCES facilities(facilityId) \n     ON DELETE CASCADE ON UPDATE CASCADE\n);\n<\/pre>\n<\/div>\n<div style=\"width: 50%; float:left;\">\n<div style=\"text-align: center;width: 90%;\"><b>GridDB Sensor Container Schema<\/b><\/div>\n<pre class=\"prettyprint\" style=\"width: 90%;\">\/\/Row schema class similar to the 'Sensors' table\npublic class Sensor {\n    @RowKey\n    public String sensorId;\n\n    public String name;\n    public String type;\n}\n<\/pre>\n<\/div>\n<div style=\"clear: both;\">&nbsp;<\/div>\n<\/div>\n<li><b>Readings:<\/b> Stores the timestamps and values of the measurements recorded by the PV site&#8217;s sensors<\/li>\n<div style=\"display: block;\">\n<div style=\"width: 50%;float: left;\">\n<div style=\"text-align: center; width: 90%;\"><b>MySQL Reading Table<\/b><\/div>\n<pre class=\"prettyprint\" style=\"width: 90%;\">CREATE TABLE IF NOT EXISTS readings (\n   record_id INT AUTO_INCREMENT PRIMARY KEY(record_id),\n   sensorId VARCHAR(40) NOT NULL,\n   tstamp TIMESTAMP NOT NULL,\n   value DECIMAL(19,4) NOT NULL,\n   status VARCHAR(255) NOT NULL,\n   FOREIGN KEY (sensorId) REFERENCES sensors(sensorId) \n     ON DELETE CASCADE ON UPDATE CASCADE\n);\n<\/pre>\n<\/div>\n<div style=\"width: 50%;float: left;\">\n<div style=\"text-align: center;width: 90%;\"><b>GridDB Reading Container Schema<\/b><\/div>\n<pre class=\"prettyprint\" style=\"width: 90%;\">\/\/Row schema class similar to the 'Readings' table\npublic class Reading {\n    @RowKey\n    public Date tstamp;\n\n    public double value;\n\n    public String status;\n}\n<\/pre>\n<\/div>\n<div style=\"clear: both;\">&nbsp;<\/div>\n<\/div>\n<li><b>Alerts:<\/b> Stores information related to alerts and notification sent by the sensors<\/li>\n<div style=\"display: block;\">\n<div style=\"width: 50%;float: left;\">\n<div style=\"text-align: center;width: 90%;\"><b>MySQL Alerts Table<\/b><\/div>\n<pre class=\"prettyprint\" style=\"width: 90%;\">CREATE TABLE IF NOT EXISTS alerts (\n  id INT AUTO_INCREMENT PRIMARY KEY (id),\n  tstamp TIMESTAMP NOT NULL,\n  facilityId VARCHAR(40) NOT NULL,\n  sensorId VARCHAR(40) NOT NULL,\n  level INT NOT NULL,\n  detail VARCHAR(255) NOT NULL,\n  FOREIGN KEY (facilityId) REFERENCES facilities(facilityId) \n     ON DELETE CASCADE ON UPDATE CASCADE,\n  FOREIGN KEY (sensorId) REFERENCES sensors(sensorId) \n     ON DELETE CASCADE ON UPDATE CASCADE\n);\n<\/pre>\n<\/div>\n<div style=\"width: 50%;float: left;\">\n<div style=\"text-align: center;width: 90%;\"><b>GridDB Alerts Container Schema<\/b><\/div>\n<pre class=\"prettyprint\" style=\"width: 90%;\">\/\/Row schema class similar to 'alerts' table\npublic class Alert {\n    @RowKey\n    public int alertId;\n    \n    public String facilityId;\n    public String sensorId;\n  \n    public Date tstamp;\n    public int level;\n    public String detail;\n}\n<\/pre>\n<\/div>\n<div style=\"clear: both;\">&nbsp;<\/div>\n<\/div>\n<\/ol>\n<p>MySQL\u306e<code> 'pv' <\/code>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u79fb\u884c\u5f8c\u306eGridDB\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30b9\u30ad\u30fc\u30de\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u306e\u56f3\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2018\/03\/migration_2-1024x374.png\" alt=\"\" width=\"1024\" height=\"374\" class=\"aligncenter size-large wp-image-22523\"><\/p>\n<h4 id=\"data-modeling\"> GridDB\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u30e2\u30c7\u30ea\u30f3\u30b0<\/h4>\n<p>MySQL\u306f<b>\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb<\/b>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3042\u308b\u305f\u3081\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u8a08\u306b\u306f<i>\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30e2\u30c7\u30eb<\/i>\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 \u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u8a2d\u8a08\u306e\u5f37\u307f\u306f\u3001\u30c7\u30fc\u30bf\u30ec\u30b3\u30fc\u30c9\u9593\u3067<code> \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3 <\/code>\u3092\u8b58\u5225\u3057\u3066\u4f5c\u6210\u3059\u308b\u3053\u3068\u306b\u3042\u308a\u307e\u3059\u3002 <b> PV\u30b5\u30a4\u30c8<\/b>\u306e\u5834\u5408\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f<code> FOREIGN KEYS <\/code>\u3067\u8a2d\u5b9a\u3055\u308c\u305f\u8907\u6570\u306e<code>\u4e00\u5bfe\u591a<\/code>\u306e\u95a2\u4fc2\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 2\u3064\u306e\u4f8b\u306f\u3001<i>\u30bb\u30f3\u30b5\u30fc\u3068\u65bd\u8a2d<\/i>\u3068\u306e\u95a2\u4fc2\u3068<i>\u6e2c\u5b9a\u5024\u3068\u30bb\u30f3\u30b5\u30fc<\/i>\u306e\u95a2\u4fc2\u3067\u3059\u3002<\/p>\n<p>GridDB\u306f\u3001\u95a2\u9023\u3059\u308b\u30c7\u30fc\u30bf\u306e<code> \u30ad\u30fc\u30b3\u30f3\u30c6\u30ca<\/code>\u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u3088\u308a\u9ad8\u3044\u67d4\u8edf\u6027\u3092\u6301\u3064NoSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3059\u3002<a href=\"https:\/\/griddb.net\/newja\/docs\/documents\/3-2_key-container-model.php\" title=\"More about the Key-Container Model\">\u30ad\u30fc\u30b3\u30f3\u30c6\u30ca<\/a> \u30e2\u30c7\u30eb\u306b\u304a\u3044\u3066\u30011\u3064\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u683c\u7d0d\u3055\u308c\u305f\u884c\u306f\u3001GridDB\u5185\u306e\u4ed6\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u5bfe\u3057\u3066<code>keys<\/code> \u3068\u3057\u3066\u4f7f\u7528\u3067\u304d\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6301\u3064\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 <b> PV\u30b5\u30a4\u30c8<\/b>\u3067\u306f\u3001\u3059\u3079\u3066\u306e<code>Sensor<\/code>\u306e\u884c\u306f\u3001<code> Facility <\/code> <i>\u30af\u30e9\u30b9<\/i>\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u4e00\u81f4\u3059\u308b<b>\u30ad\u30fc<\/b>\u3092\u6301\u3064<a href=\"https:\/\/griddb.net\/newja\/docs\/documents\/3-2_key-container-model.php#sec-1.1\" title=\"Collection Containers\">Collection<\/a> \u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\u3055\u3089\u306b\u3059\u3079\u3066\u306e<code>Reading<\/code>\u306e\u884c\u306f\u3001\u30ad\u30fc\u304c<code> Sensor <\/code> <i>\u30af\u30e9\u30b9<\/i>\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u4e00\u81f4\u3059\u308b<a href=\"https:\/\/griddb.net\/newja\/docs\/documents\/3-2_key-container-model.php#sec-1.2\" title=\"TimeSeries containers\">TimeSeries<\/a> \u30b3\u30f3\u30c6\u30ca\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30bf\u30a4\u30d7\u306e\u30e2\u30c7\u30eb\u306f\u3001\u4efb\u610f\u306e\u6df1\u3055\u306b\u62e1\u5f35\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u542b\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3 id=\"migration\">\u79fb\u884c\u306e\u5b9f\u884c<\/h3>\n<p>\u3053\u3053\u307e\u3067\u3067GridDB\u306e\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\u3068\u30b9\u30ad\u30fc\u30de\u3092\u4f5c\u6210\u3057\u3001\u30c7\u30fc\u30bf\u79fb\u884c\u306e\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002 \u79fb\u884c\u306b\u3042\u305f\u3063\u3066\u306f\u3001MySQL\u306e\u5404\u30c6\u30fc\u30d6\u30eb\u306e\u3059\u3079\u3066\u306e\u884c\u3092<code> SELECT <\/code>\u3057\u3001GridDB\u3067\u65b0\u3057\u3044\u884c\u3092\u4f5c\u6210\u3057\u3001GridDB\u30b3\u30f3\u30c6\u30ca\u306b\u633f\u5165\u3059\u308b\u65b9\u6cd5\u3092\u63a1\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a<a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/jdbc\/basics\/connecting.html\" title=\"Connect  to MySQL using JDBC\">JDBC \u30c9\u30e9\u30a4\u30d0<\/a>\u3092\u4f7f\u3044\u3001MySQL <code>'pv'<\/code> \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002\u6b21\u306b<a href=\"https:\/\/github.com\/griddb\/griddb_nosql\" title=\"GridDB Java API Source Code\">GridDB Java API<\/a>\u3092\u4f7f\u3044\u3001<a href=\"https:\/\/griddb.net\/newja\/docs\/documents\/5-1-5_connection.php\" title=\"Connect to GridDB using Java\">GridDB \u30af\u30e9\u30b9\u30bf\u3078\u63a5\u7d9a<\/a>\u3057\u307e\u3059\u3002<\/p>\n<h4 id=\"migrate-facilities\">\u65bd\u8a2d\u30c7\u30fc\u30bf\u306e\u79fb\u884c<\/h4>\n<p>MySQL\u304b\u3089\u79fb\u884c\u3059\u308b\u6700\u521d\u306e\u30c6\u30fc\u30d6\u30eb\u306f<code> facilities <\/code>\u30c6\u30fc\u30d6\u30eb\u3067\u3001\u540c\u3058\u540d\u524d\u306eGridDB <code> Collection <\/code>\u306b\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001MySQL\u30c6\u30fc\u30d6\u30eb\u3068\u540c\u69d8\u306e\u30b9\u30ad\u30fc\u30de\u3092\u6301\u3061\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u306e\u79fb\u884c\u3092\u958b\u59cb\u3059\u308b\u306b\u306f\u3001MySQL\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u3059\u3079\u3066\u306e\u884c\u3092<code> SELECT <\/code>\u3057\u307e\u3059\u3002 \u6b21\u306b\u3001\u5404\u884c\u3092GridDB\u306e<code> Facility class<\/code>\u30b9\u30ad\u30fc\u30de\u306b\u518d\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u3092\u5411\u4e0a\u3055\u305b\u308b\u65b9\u6cd5\u3068\u3057\u3066\u3001 MySQL\u306e<code>sensors<\/code>\u30c6\u30fc\u30d6\u30eb\u306e\u3088\u3046\u306a\u30b9\u30ad\u30fc\u30de\u3092\u6301\u3064<code> Collection <\/code> (<i>facility id<\/i>\u3067\u540d\u79f0\u3092\u4ed8\u3051\u308b)\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u306e<i>facility<\/i>\u30b3\u30f3\u30c6\u30ca\u306f\u3001\u305d\u306e\u65bd\u8a2d\u306e\u30bb\u30f3\u30b5\u30fc\u306e\u683c\u7d0d\u3092\u62c5\u5f53\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e00\u65b9\u3001MySQL\u304b\u3089GridDB\u3078\u306e<i> Blob <\/i>\u578b\u306e\u5909\u63db\u306f\u3001\u305d\u308c\u307b\u3069\u76f4\u611f\u7684\u306b\u5206\u304b\u308a\u3084\u3059\u304f\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067MySQL Blob\u3092\u51e6\u7406\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u30b9\u30cb\u30da\u30c3\u30c8\u3067\u3001<b>Facility class<\/b>\u306e<b>specification column<\/b>\u3092<b> specifications attribute<\/b>\u306b\u5909\u63db\u3059\u308b\u4f8b\u3092\u8a73\u3057\u304f\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h5 id=\"blob-conversion\"> MySQL Blob\u30c7\u30fc\u30bf\u306e\u51e6\u7406<\/h5>\n<p>\u307e\u305a\u3001Blob <i>bytes<\/i>\u3092MySQL\u304b\u3089\u66f8\u304d\u51fa\u3059\u305f\u3081\u306e<code> ByteArrayOutputStream <\/code>\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u6b21\u306b\u3001MySQL Blob\u306e\u30d0\u30a4\u30c8\u3092\u683c\u7d0d\u3059\u308b<code> BufferedInputStream <\/code>\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002 MySQL\u306e\u884c\u304b\u3089MySQL Blob\u30d0\u30a4\u30c8\u30c7\u30fc\u30bf\u307e\u305f\u306f<i> binary data <\/i>\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001Blob\u5217\uff08<i>specification<\/i>\uff09\u3067<code> .getBinaryStream <\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002 \u305d\u3053\u304b\u3089\u30d0\u30a4\u30ca\u30ea\u30b9\u30c8\u30ea\u30fc\u30e0\uff08<i> BufferedInputStream <\/i>\uff09\u306e\u30d0\u30a4\u30c8\u30c7\u30fc\u30bf\u306e\u914d\u5217\u3092<b> ByteArrayOutputStream <\/b>\u306b\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p><b> ByteArrayOutputStream <\/b>\u3078\u306e\u66f8\u304d\u8fbc\u307f\u304c\u7d42\u308f\u3063\u305f\u3089\u3001<i> GridDB Blob <\/i>\u3092\u4f5c\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 GridDB Blob\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u3059\u3079\u3066\u306e\u30c7\u30fc\u30bf\u3092<code>byte array<\/code>\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 <code> ByteArrrayOutputStream <\/code>\u306e<code> .toByteArray\uff08\uff09<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u30d0\u30a4\u30c8\u914d\u5217\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002 \u6700\u5f8c\u306b\u3001\u51fa\u529b\u30b9\u30c8\u30ea\u30fc\u30e0\u306ebyte array\u306e<code> SerialBlob <\/code>\u306b<i>specifications<\/i>\u306e\u5217\u307e\u305f\u306f\u5c5e\u6027\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001GridDB\u884c\u306e<i>Blob<\/i>\u5217\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<i>Blob<\/i><br \/>\n\u3053\u308c\u3067Blob\u578b\u304c\u51e6\u7406\u3055\u308c\u305f\u306e\u3067\u3001\u65b0\u3057\u3044\u884c\u3092GridDB\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b<i>\u633f\u5165<\/i>\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"prettyprint\">Collection&lt;String,Facility&gt; collection = gridstore.putCollection(\"facilities\",Facility.class);\n\nStatement statement = connection.createStatement();\nResultSet resultSet = statement.executeQuery(\"SELECT * FROM pv.facilities\");\n\n\/\/ Iterate every row in the 'facilites' table in MySQL\nwhile(resultSet.next()){\n    Facility facility = new Facility();\n    \n    facility.facilityId = resultSet.getString(\"faciltiyId\");\n    facility.name = resultSet.getString(\"name\");\n    \n    \/\/ Create a Sensor Collection for storing sensors in a facility\n    gridstore.putCollection(facility.facilityId,Sensor.class);\n\n    \/\/Translate MySQL Blob to GridDB\n    ByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n    InputStream inputStream = new BufferedInputStream(resultSet.getBinaryStream(\"specifications\"));\n\n    byte buffer[] = new byte[1024];    \n    while(inputStream.read(buffer) != -1)\n        byteStream.write(buffer);\n    inputStream.close();\n\n    \/\/ Set the GridDB Blob column to the binary data obtained from MySQL\n    facility.specifications = new SerialBlob(byteStream.toByteArray());\n        \n    collection.put(facility.facilityId,facility);\n}\n<\/pre>\n<h4 id=\"sensor-migration\">\u30bb\u30f3\u30b5\u30fc\u30c7\u30fc\u30bf\u306e\u79fb\u884c<\/h4>\n<p>2\u756a\u76ee\u306b\u79fb\u884c\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306f\u3001MySQL\u306e<code> sensors <\/code>\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u304b\u3089\u3059\u3079\u3066\u306e\u884c\u3092\u9078\u629e\u3057\u3001GridDB\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u633f\u5165\u3059\u308b\u884c\u3092\u4e26\u3079\u66ff\u3048\u308b\u3001\u5148\u307b\u3069\u3068\u540c\u3058\u30d7\u30ed\u30bb\u30b9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8868\u306e\u5404\u884c\u306b\u306f<code> facilityId <\/code>\u5217\u3068<code> FOREIGN KEY <\/code>\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u5217\u306f\u3001\u30bb\u30f3\u30b5\u30fc\u304c\u3069\u306e\u65bd\u8a2d\u306b\u5c5e\u3059\u308b\u304b\u3092\u8868\u3057\u307e\u3059\u3002 \u3053\u306e\u884c\u3092GridDB\u306b\u79fb\u884c\u3059\u308b\u3068\u3001\u305d\u306e\u5217\u306e\u5024\u304c\u884c\u304b\u3089\u53d6\u5f97\u3055\u308c\u3001\u305d\u306e\u6a5f\u80fd\u306b\u5bfe\u5fdc\u3059\u308b\u9069\u5207\u306a<code> Collection <\/code>\u30b3\u30f3\u30c6\u30ca\u304c\u53d6\u5f97\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001MySQL\u884c\u306e\u6b8b\u308a\u306e\u5217\u5024\u304b\u3089\u65b0\u3057\u3044<code> Sensor <\/code>\u884c\u3092\u4f5c\u6210\u3057\u3001GridDB\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30b3\u30f3\u30c6\u30ca\u306b\u633f\u5165\u3057\u307e\u3059\u3002<\/p>\n<p>\u5404\u30bb\u30f3\u30b5\u30fc\u306f\u3001\u30bb\u30f3\u30b5\u30fc\u306e\u6e2c\u5b9a\u5024\u3092\u683c\u7d0d\u3059\u308b\u72ec\u81ea\u306e<code> TimeSeries <\/code>\u30b3\u30f3\u30c6\u30ca\u3082\u53d6\u5f97\u3057\u307e\u3059\u3002 \uff08\u30bb\u30f3\u30b5\u30fc\u306e<i>sensor id<\/i>\u306f\u3001Timeseries\u306e\u540d\u524d\/\u30ad\u30fc\u306b\u306a\u308a\u307e\u3059\uff09\u3002 \u30b3\u30f3\u30c6\u30ca\u306b\u306f<code> Reading class<\/code>\u30b9\u30ad\u30fc\u30de\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint\">ResultSet resultSet = statement.executeQuery(\"SELECT * FROM pv.sensors\");\n\n\/\/ Iterate all sensors in the MySQL 'sensor' table\nwhile(resultSet.next()){\n    String facilityId = resultSet.get(\"facilityId\");\n    Collection&lt;String,Sensor&gt; collection = gridstore.getCollection(facilityId,Sensor.class);\n    \n    Sensor sensor = new Sensor();\n    \n    sensor.sensorId = resultSet.getString(\"sensorId\");\n    gridstore.putTimeSeries(sensor.sensorId,Reading.class);\n\n    sensor.name = resultSet.getString(\"name\");\n    sensor.type = resultSet.getString(\"type\");\n\n    collection.put(sensor.sensorId,sensor);\n}\n<\/pre>\n<h4 id=\"readings-migrate\">\u30bb\u30f3\u30b5\u5024\u306e\u79fb\u884c<\/h4>\n<p>3\u756a\u76ee\u306b\u79fb\u884c\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306f\u3001<code>readings<\/code> \u30c6\u30fc\u30d6\u30eb\u3067\u3001<a href=\"https:\/\/griddb.net\/newja\/blog\/time-series-data-griddb\/\" title=\"What is Timeseries Data?\">\u6642\u7cfb\u5217(Timeseries) \u30c7\u30fc\u30bf<\/a>\u3092\u542b\u3081\u308b\u3053\u3068\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305a\u306f<code>java.sql.Timestamp<\/code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u683c\u7d0d\u3055\u308c\u3066\u3044\u308bMySQL \u306e<i>TIMESTAMP<\/i>\u3092\u3001<code>java.util.Date<\/code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u683c\u7d0d\u3055\u308c\u308bGridDB <i>Timestamp<\/i>\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint\">Date parseTimestamp(Timestamp timestamp){\n    Date date = new Date(timestamp.getTime());\n    return date;\n}\n<\/pre>\n<p><i>readings<\/i> MySQL\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u53d6\u5f97\u3057\u305f\u3059\u3079\u3066\u306e\u884c\u3092\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3059\u308b\u3068\u304d\u3001MySQL\u306e\u884c\u306e<code> sensorId <\/code>\u5217\u306e\u5024\u3092\u4f7f\u7528\u3057\u3066\u3001<code> TimeSeries <\/code> \u65b0\u3057\u3044GridDB <code>Reading<\/code>\u304c\u306b\u633f\u5165\u3055\u308c\u307e\u3059\u3002 \u307b\u304b\u306e\u3059\u3079\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u540c\u69d8\u306b\u3001GridDB\u306e\u65b0\u3057\u3044<i> Reading <\/i>\u884c\u306e\u4ed6\u306e\u3059\u3079\u3066\u306e\u30ab\u30e9\u30e0\u5024\u3092MySQL\u306e\u884c\u306e\u30ab\u30e9\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u304b\u3089\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint\">ResultSet resultSet = statement.executeQuery(\"SELECT * FROM pv.readings ORDER BY tstamp\");\n\n\/\/ Iterate through every row retrieved from 'readings' table\nwhile(resultSet.next()){\n    String sensorId = resultSet.getString(\"sensorId\");\n    TimeSeries&lt;Reading&gt; timeseries = gridstore.getTimeSeries(sensorId,Reading.class);\n\n    Timestamp timestamp = resultSet.getTimestamp(\"tstamp\");\n    Date rowKey = parseTimestamp(timestamp);\n\n    Reading reading = new Reading();\n    reading.tstamp = rowKey;\n    reading.value = resultSet.getDouble(\"value\");\n    reading.status = resultSet.getString(\"status\");\n\n    timeseries.put(reading.tstamp,reading);\n}\n<\/pre>\n<h4 id=\"migrate-alerts\">\u30a2\u30e9\u30fc\u30c8\u30c6\u30fc\u30d6\u30eb\u306e\u79fb\u884c<\/h4>\n<p>\u6700\u5f8c\u306b\u79fb\u884c\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306f<code>alerts<\/code>\u3067\u3059\u3002 \u3053\u306e\u79fb\u884c\u65b9\u6cd5\u306f\u3001<code> facilities <\/code>\u30c6\u30fc\u30d6\u30eb\u306e\u79fb\u884c\u65b9\u6cd5\u306b\u4f3c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u30a2\u30e9\u30fc\u30c8\u901a\u77e5\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e<code> Collection <\/code>\u30b3\u30f3\u30c6\u30ca\u3092GridDB\u306b\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u306e\u30b3\u30f3\u30c6\u30ca\u304c<code> Alert <\/code>\u30b9\u30ad\u30fc\u30de\u3092\u4fdd\u6301\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u304b\u3089\u3001<b>alerts<\/b>\u30c6\u30fc\u30d6\u30eb\u306e\u3059\u3079\u3066\u306e\u884c\u3092\u7e70\u308a\u8fd4\u3057\u3066\u3001\u5404\u884c\u3092<code> Alert <\/code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db\u3057\u3066GridDB\u306b\u884c\u3068\u3057\u3066\u633f\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint\">ResultSet resultSet = statement.executeQuery(\"SELECT * FROM pv.alerts\");\nCollection&lt;Integer,Alert&gt; collection = gridstore.putCollection(\"alerts\",Alert.class);\n\n\/\/ Iterate through every row in the 'alerts' table\nwhile(resultSet.next()){\n    Alert alert = new Alert();\n\n    Timestamp timestamp = resultSet.getTimestamp(\"tstamp\");\n    alert.tstamp = parseTimestamp(timestamp);\n\n    alert.alertId = resultSet.getInt(\"id\");\n    alert.facilityId = resultSet.getString(\"facilityId\");\n    alert.sensorId = resultSet.getString(\"sensorId\");\n    alert.level = resultSet.getInt(\"level\");\n    alert.detail = resultSet.getString(\"detail\");\n\n    collection.put(alert.alertId,alert);\n}\n<\/pre>\n<h2 id=\"conclusion\">\u307e\u3068\u3081<\/h2>\n<p>\u3053\u308c\u3067\u79fb\u884c\u4f5c\u696d\u304c\u5b8c\u4e86\u3057\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u3059\u3079\u3066\u306e\u30c7\u30fc\u30bf\u304cGridDB\u306b\u79fb\u884c\u3055\u308c\u307e\u3057\u305f\u3002 \u3053\u306e\u5f8c\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u524a\u9664\u3057\u3066\u3001\u3088\u308a\u9ad8\u901f\u3067<a href=\"https:\/\/griddb.net\/newja\/blog\/your-database-is-really-scalable\/\" title=\"Scaling with GridDB\">\u3088\u308a\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u306a<\/a> GridDB\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u304a\u4f7f\u3044\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>MySQL\u306f\u3001\u30d3\u30b8\u30cd\u30b9\u30a4\u30f3\u30c6\u30ea\u30b8\u30a7\u30f3\u30b9\u3001Web\u958b\u767a\u3001\u30de\u30fc\u30b1\u30c3\u30c8\u30d7\u30ec\u30a4\u30b9\u3001\u5728\u5eab\u7ba1\u7406\u306b\u3088\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3059\u3002 \u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001<b> CentOS 7 <\/b>\u306e<b> MySQL Version 5.7 <\/b>\u3092\u4f7f\u7528\u3057\u3066\u521d\u671f\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002 GridDB\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u306f\u3001<a href=\"https:\/\/github.com\/griddb\/griddb_nosql\/releases\/download\/v3.0.1\/griddb_nosql-3.0.1-1.linux.x86_64.rpm\" title=\"Download GridDB CE\">GridDB Community Edition Build 3.0.1<\/a>\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u79fb\u884c\u306e\u4e8b\u4f8b\u3068\u3057\u3066\u3001\u592a\u967d\u5149\u767a\u96fb\u30b5\u30a4\u30c8\u306e\u4e8b\u4f8b\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002\u305d\u306e\u4ed6\u306e IoT\u696d\u754c\u3067\u306eGridDB\u306e\u4f7f\u7528\u4e8b\u4f8b\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/griddb.net\/newja\/blog\/three-examples-griddb-iot-industry\/\">\u3053\u306e\u30d6\u30ed\u30b0<\/a>\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u79fb\u884c\u4f5c\u696d\u306f\u3001\u3068\u304d\u306b\u975e\u5e38\u306b\u96e3\u3057\u304f\u624b\u9593\u3084\u6642\u9593\u304c\u304b\u304b\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u591a\u304f\u306e\u4f01\u696d\u304c\u79fb\u884c\u306b\u95a2\u5fc3\u304c\u3042\u308a\u306a\u304c\u3089\u3082\u5148\u9001\u308a\u3057\u3066\u3057\u307e\u3044\u304c\u3061\u3067\u3059\u3002\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u79fb\u884c\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u5411\u4e0a\u3068\u30b3 [&hellip;]<\/p>\n","protected":false},"author":123,"featured_media":49050,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1005],"tags":[],"class_list":["post-50673","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1005"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"\u306f\u3058\u3081\u306b\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/migrating-from-mysql-to-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"\u306f\u3058\u3081\u306b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/migrating-from-mysql-to-griddb\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-07T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-14T15:53:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2018\/02\/blog_title_22.png\" \/>\n\t<meta property=\"og:image:width\" content=\"870\" \/>\n\t<meta property=\"og:image:height\" content=\"490\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Joshua Pascascio\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joshua Pascascio\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/\"},\"author\":{\"name\":\"Joshua Pascascio\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/ca72185e9a3778df765a76313f789fd8\"},\"headline\":\"MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c\",\"datePublished\":\"2018-03-07T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:53:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/\"},\"wordCount\":31,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2018\/02\/blog_title_22.png\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/\",\"url\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/\",\"name\":\"MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2018\/02\/blog_title_22.png\",\"datePublished\":\"2018-03-07T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:53:38+00:00\",\"description\":\"\u306f\u3058\u3081\u306b\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2018\/02\/blog_title_22.png\",\"contentUrl\":\"\/wp-content\/uploads\/2018\/02\/blog_title_22.png\",\"width\":870,\"height\":490},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/ca72185e9a3778df765a76313f789fd8\",\"name\":\"Joshua Pascascio\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/872ef8be79cb5117c256feb4c279ac41b954bfba599d647db925185c449aff1c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/872ef8be79cb5117c256feb4c279ac41b954bfba599d647db925185c449aff1c?s=96&d=mm&r=g\",\"caption\":\"Joshua Pascascio\"},\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/author\/joshua\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c | GridDB: Open Source Time Series Database for IoT","description":"\u306f\u3058\u3081\u306b","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/migrating-from-mysql-to-griddb\/","og_locale":"ja_JP","og_type":"article","og_title":"MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c | GridDB: Open Source Time Series Database for IoT","og_description":"\u306f\u3058\u3081\u306b","og_url":"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/migrating-from-mysql-to-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2018-03-07T08:00:00+00:00","article_modified_time":"2025-11-14T15:53:38+00:00","og_image":[{"width":870,"height":490,"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2018\/02\/blog_title_22.png","type":"image\/png"}],"author":"Joshua Pascascio","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"\u57f7\u7b46\u8005":"Joshua Pascascio"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/"},"author":{"name":"Joshua Pascascio","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/ca72185e9a3778df765a76313f789fd8"},"headline":"MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c","datePublished":"2018-03-07T08:00:00+00:00","dateModified":"2025-11-14T15:53:38+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/"},"wordCount":31,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2018\/02\/blog_title_22.png","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/","url":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/","name":"MySQL\u304b\u3089GridDB\u3078\u306e\u79fb\u884c | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2018\/02\/blog_title_22.png","datePublished":"2018-03-07T08:00:00+00:00","dateModified":"2025-11-14T15:53:38+00:00","description":"\u306f\u3058\u3081\u306b","inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/migrating-from-mysql-to-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2018\/02\/blog_title_22.png","contentUrl":"\/wp-content\/uploads\/2018\/02\/blog_title_22.png","width":870,"height":490},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/ca72185e9a3778df765a76313f789fd8","name":"Joshua Pascascio","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/872ef8be79cb5117c256feb4c279ac41b954bfba599d647db925185c449aff1c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/872ef8be79cb5117c256feb4c279ac41b954bfba599d647db925185c449aff1c?s=96&d=mm&r=g","caption":"Joshua Pascascio"},"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/author\/joshua\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/posts\/50673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/users\/123"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/comments?post=50673"}],"version-history":[{"count":1,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/posts\/50673\/revisions"}],"predecessor-version":[{"id":51516,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/posts\/50673\/revisions\/51516"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/media\/49050"}],"wp:attachment":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/media?parent=50673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/categories?post=50673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/tags?post=50673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}