{"id":50864,"date":"2023-07-08T00:00:00","date_gmt":"2023-07-08T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/"},"modified":"2025-11-14T07:56:16","modified_gmt":"2025-11-14T15:56:16","slug":"building-url-shortener-api-using-java-spring-boot-griddb","status":"publish","type":"post","link":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/","title":{"rendered":"Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b"},"content":{"rendered":"<p>\u9577\u304f\u3066\u9762\u5012\u306aURL\u306b\u3046\u3093\u3056\u308a\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u53cb\u4eba\u3084\u540c\u50da\u3068URL\u3092\u5171\u6709\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u611f\u3058\u307e\u305b\u3093\u304b\uff1f\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u3042\u306a\u305f\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u9577\u3044URL\u306f\u30a4\u30e9\u30a4\u30e9\u3055\u305b\u308b\u3057\u3001\u7ba1\u7406\u3082\u96e3\u3057\u3044\u3067\u3059\u3002\u5e78\u3044\u306a\u3053\u3068\u306b\u3001\u3053\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306fJava Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u7c21\u5358\u306aURL\u77ed\u7e2e\u30c4\u30fc\u30eb\u3092\u4f5c\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>URL\u77ed\u7e2e\u30c4\u30fc\u30eb\u3068\u306f\uff1f<\/h2>\n<p>URL\u77ed\u7e2e\u30c4\u30fc\u30eb\u306f\u3001\u975e\u5e38\u306b\u9577\u3044URL\u304b\u3089\u77ed\u3044\u30ea\u30f3\u30af\u3092\u4f5c\u6210\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002\u77ed\u3044URL\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u5143\u306eURL\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u9577\u3044URL https:\/\/developers.googleblog.com\/2018\/03\/transitioning-google-url-shortener.html \u3092 goo.gl \u306e\u3088\u3046\u306b\u77ed\u7e2e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u77ed\u7e2e\u3055\u308c\u305fURL\u306f\u5171\u6709\u3057\u3084\u3059\u304f\u3001\u30b9\u30da\u30fc\u30b9\u3082\u53d6\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2>\u306a\u305cURL\u77ed\u7e2e\u30c4\u30fc\u30eb\u3092\u4f5c\u308b\u306e\u304b\uff1f<\/h2>\n<p>URL\u77ed\u7e2e\u30c4\u30fc\u30eb\u3092\u4f5c\u308a\u305f\u3044\u7406\u7531\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002 1. \u9577\u3044URL\u3092\u3088\u308a\u52b9\u7387\u7684\u306b\u7ba1\u7406\u3067\u304d\u307e\u3059\u3002 2. \u30af\u30ea\u30c3\u30af\u6570\u3084\u30e6\u30fc\u30b6\u30fc\u306e\u30a8\u30f3\u30b2\u30fc\u30b8\u30e1\u30f3\u30c8\u3092\u8ffd\u8de1\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002 3. URL\u306e\u30d6\u30e9\u30f3\u30c7\u30a3\u30f3\u30b0\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u77ed\u7e2eURL\u306b\u30d6\u30e9\u30f3\u30c9\u540d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u7279\u5fb4<\/h2>\n<p>\u6280\u8853\u7684\u306a\u8a73\u7d30\u306b\u5165\u308b\u524d\u306b\u3001URL\u77ed\u7e2e\u30b5\u30fc\u30d3\u30b9\u306b\u5b9f\u88c5\u3057\u305f\u3044\u6a5f\u80fd\u306e\u3044\u304f\u3064\u304b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff1a 1. REST API\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u3067\u3042\u308b\u3053\u3068 2. \u9577\u3044URL\u304c\u4e0e\u3048\u3089\u308c\u305f\u5834\u5408\u3001\u30e6\u30cb\u30fc\u30af\u306a\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308b\u3053\u3068 3. \u77ed\u7e2eURL\u304c\u4e0e\u3048\u3089\u308c\u305f\u5834\u5408\u3001\u5143\u306eURL\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u3053\u3068 4. \u30b5\u30fc\u30d3\u30b9\u306f\u5206\u6790\u6a5f\u80fd\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\uff08\u6700\u3082\u8a2a\u554f\u3055\u308c\u305f\u30ea\u30f3\u30af\u3001URL\u304c\u4f55\u56de\u8a2a\u554f\u3055\u308c\u305f\u304b\uff09<\/p>\n<h2>\u30b7\u30b9\u30c6\u30e0\u8a2d\u8a08<\/h2>\n<p>\u3053\u3053\u3067\u7559\u610f\u3059\u3079\u304d\u6700\u3082\u91cd\u8981\u306a\u3053\u3068\u306f\u3001\u6211\u3005\u306e\u30b7\u30b9\u30c6\u30e0\u306fread-heavy\u3067\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u8aad\u307f\u8fbc\u307f\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u6570\u306f\u3001\u66f8\u304d\u8fbc\u307f\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u6570\u306e1000\u500d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u5b9f\u969b\u306eURL\u306e\u30a8\u30f3\u30b3\u30fc\u30c9<\/h3>\n<ul>\n<li>\u4e0e\u3048\u3089\u308c\u305fURL\u306e\u4e00\u610f\u306aID\u3092\u8a08\u7b97\u3059\u308b\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306fTSID\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/li>\n<li>Base62\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff08[A-Z, a-z, 0-9]\uff09\u3092\u4f7f\u7528\u3057\u3066\u3001ID\u3092\u4e00\u610f\u306e\u6587\u5b57\u5217\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u307e\u3059\u3002\u6700\u521d\u306e7\u6587\u5b57\u3092\u77ed\u3044URL\u3068\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<h2>SQL \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b NoSQL \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b<\/h2>\n<p>URL\u77ed\u7e2e\u30b5\u30fc\u30d3\u30b9\u3092\u69cb\u7bc9\u3059\u308b\u969b\u306b\u6c7a\u5b9a\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u91cd\u8981\u306a\u3053\u3068\u306e1\u3064\u306f\u3001\u3069\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u306f\u4e3b\u306b2\u3064\u306e\u30bf\u30a4\u30d7\u304c\u3042\u308a\u307e\u3059\u3002SQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068NoSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3059\u3002<\/p>\n<p>SQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u3001\u3042\u3089\u304b\u3058\u3081\u5b9a\u7fa9\u3055\u308c\u305f\u30b9\u30ad\u30fc\u30de\u3092\u6301\u3064\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3059\u308b\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3059\u3002\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u3084\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u51e6\u7406\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e00\u65b9\u3001NoSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u3001\u67d4\u8edf\u3067\u30b9\u30ad\u30fc\u30de\u306e\u306a\u3044\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3059\u308b\u975e\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3059\u3002\u975e\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u3092\u6271\u3044\u3001\u6c34\u5e73\u65b9\u5411\u306b\u62e1\u5f35\u3059\u308b\u306e\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u79c1\u305f\u3061\u306eURL\u77ed\u7e2e\u30b5\u30fc\u30d3\u30b9\u3067\u306f\u3001NoSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002\u79c1\u305f\u3061\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306f\u3001\u30c7\u30fc\u30bf\u9593\u306e\u95a2\u4fc2\u306f\u5fc5\u8981\u3068\u3057\u3066\u304a\u3089\u305a\u3001\u4e00\u65b9\u3067\u9ad8\u901f\u306a\u8aad\u307f\u53d6\u308a\u3068\u66f8\u304d\u8fbc\u307f\u901f\u5ea6\u304c\u5fc5\u8981\u306a\u305f\u3081\u3001NoSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001GridDB\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002GridDB\u306f\u3001IoT\u3084\u30d3\u30c3\u30b0\u30c7\u30fc\u30bf\u30fb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5411\u3051\u306b\u6700\u9069\u5316\u3055\u308c\u305f\u3001\u62e1\u5f35\u6027\u306e\u9ad8\u3044\u30a4\u30f3\u30e1\u30e2\u30ea\u30fcNoSQL\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3059\u3002<\/p>\n<p>\u30ad\u30fc\u30fb\u30b3\u30f3\u30c6\u30ca\u30fb\u30e2\u30c7\u30eb\u306b\u3088\u308a\u3001Java\u3084C\u306eAPI\u3092\u901a\u3058\u3066\u30c7\u30fc\u30bf\u306b\u9ad8\u901f\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001GridDB\u306e\u30c7\u30fc\u30bf\u306f\u3001\u30ab\u30b9\u30bf\u30e0SQL\u30e9\u30a4\u30af\u306a\u30af\u30a8\u30ea\u8a00\u8a9e\u3067\u3042\u308bTQL\u3092\u901a\u3058\u3066\u30af\u30a8\u30ea\u3055\u308c\u307e\u3059\u3002WHERE\u30b3\u30de\u30f3\u30c9\u306b\u3088\u308b\u57fa\u672c\u7684\u306a\u691c\u7d22\u3084\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u4f5c\u6210\u306b\u3088\u308b\u9ad8\u901f\u306a\u6761\u4ef6\u691c\u7d22\u64cd\u4f5c\u306f\u3001\u9ad8\u901f\u306a\u691c\u7d22\u3092\u5fc5\u8981\u3068\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5927\u304d\u306a\u30e1\u30ea\u30c3\u30c8\u3092\u3082\u305f\u3089\u3057\u307e\u3059\u3002GridDB\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u306e\u8907\u6570\u30ec\u30b3\u30fc\u30c9\u3092\u542b\u3080\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002GridDB\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306f\u3001\u30b3\u30f3\u30c6\u30ca\u30ec\u30d9\u30eb\u3067ACID\uff08Atomicity\u3001Consistency\u3001Isolation\u3001Durability\uff09\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001URL\u3092\u683c\u7d0d\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3068\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u683c\u7d0d\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306e2\u3064\u3060\u3051\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<h2>Java\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30b9\u30bf\u30c3\u30af\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>Java OpenJDK 17 <\/li>\n<li>Docker 23.0.1 <\/li>\n<li>Spring Boot 3.0.5 <\/li>\n<li>apache-maven-3.8.7<\/li>\n<\/ul>\n<h3>GridDB\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9<\/h3>\n<p>API\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u524d\u306b\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068GridDB\u306e\u30af\u30e9\u30b9\u30bf\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306e\u63a5\u7d9a\u3092\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001GridStore\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">    @Bean\n    public GridStore gridStore() throws GSException {\n        \/\/ Acquiring a GridStore instance\n        Properties properties = new Properties();\n        properties.setProperty(\"notificationMember\", \"griddbserver:10001\");\n        properties.setProperty(\"clusterName\", \"dockerGridDB\");\n        properties.setProperty(\"user\", \"admin\");\n        properties.setProperty(\"password\", \"admin\");\n        GridStore store = GridStoreFactory.getInstance().getGridStore(properties);\n        return store;\n    }<\/code><\/pre>\n<\/div>\n<h3>URL\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u4f5c\u6210<\/h3>\n<p>id\u30ab\u30e9\u30e0\u3092\u4e3b\u30ad\u30fc\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">    @Data\n    public class UrlModel {\n        @RowKey\n        Long id;\n        String shortUrl;\n        String originalUrl;\n        int clicks;\n    }<\/code><\/pre>\n<\/div>\n<h3>URL\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u4f5c\u6210<\/h3>\n<p>\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u306f\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5f62\u5f0f\u306e\u4e3b\u30ad\u30fc\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">    @Data\n    public class UrlMetricModel {\n        @RowKey\n        Date timestamp;\n        String shortUrl;\n        String userAgent;\n        String ipAddress;\n    }<\/code><\/pre>\n<\/div>\n<h3>\u884c\u3092\u7ba1\u7406\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u306e\u4f5c\u6210<\/h3>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u3092\u8a2d\u5b9a\u3057\u305f\u3089\u3001\u305d\u308c\u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001Collection \u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u7528\u3057\u3066 URL \u3092\u683c\u7d0d\u3057\u307e\u3059\u3002\u3053\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306f WHERE \u30af\u30a8\u30ea\u306e\u6761\u4ef6\u3067\u4f7f\u7528\u3055\u308c\u308b\u305f\u3081\u3001shortUrl \u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3068\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">    @Bean\n    public Collection&lt;Long, UrlModel&gt; urlCollection(GridStore gridStore) throws GSException {\n        Collection&lt;Long, UrlModel&gt; urlCollection = gridStore.putCollection(\"urls\", UrlModel.class);\n        urlCollection.createIndex(\"shortUrl\");\n        return urlCollection;\n    }<\/code><\/pre>\n<\/div>\n<p>URL \u30e1\u30c8\u30ea\u30af\u30b9\u3067\u306f\u3001\u767a\u751f\u6642\u523b\u3092\u6301\u3064\u884c\u3092\u7ba1\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001TimeSeries \u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">@Bean\npublic TimeSeries&lt;UrlMetricModel&gt; urlMetricContainer(GridStore gridStore) throws GSException {\n    return gridStore.putTimeSeries(\"urlmetrics\", UrlMetricModel.class);\n}<\/code><\/pre>\n<\/div>\n<h2>REST API\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8<\/h2>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u7528\u306b\u4ee5\u4e0b\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>1&#46;  POST <code>\/api\/urls<\/code> : \u65b0\u3057\u3044\u77ed\u7e2eURL\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\"> public ShortUrlResponse create(UrlPayload payload) {\n        UrlModel model = new UrlModel();\n        model.setId(nextId());\n        model.setOriginalUrl(payload.getUrl());\n        model.setShortUrl(generateShortUrl(model.getId()));\n        try {\n            urlCollection.setAutoCommit(false);\n            urlCollection.put(model.getId(), model);\n            urlCollection.commit();\n        } catch (GSException e) {\n            e.printStackTrace();\n            throw new UrlShortenerException(\"Please try again\");\n        }\n        return SHORT_URL_MAPPER_INSTANCE.mapEntityToResponse(model);\n    }<\/code><\/pre>\n<\/div>\n<p>URL \u30c7\u30fc\u30bf\u3092 GridDB \u306b\u683c\u7d0d\u3059\u308b\u305f\u3081\u306b Java API \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30da\u30a4\u30ed\u30fc\u30c9\u306e\u4f8b\uff1a<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">\n      \"url\": \"https:\/\/www.javacodegeeks.com\/2023\/05\/what-are-events-relation-to-api-calls.html\"\n    <\/code><\/pre>\n<\/div>\n<p>\u6210\u529f\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\uff1a<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\"> {\n      \"url\": \"https:\/\/www.javacodegeeks.com\/2023\/05\/what-are-events-relation-to-api-calls.html\",\n      \"shortUrl\": \"HjlQjET\"\n    }\n    <\/code><\/pre>\n<\/div>\n<p>\u3053\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u305f\u77ed\u3044URL\u3092\u542b\u3080JSON\u5024\u3092\u8fd4\u3059\u304b\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306b\u4f8b\u5916\u3092\u6295\u3052\u307e\u3059\u3002<\/p>\n<p>2&#46;  GET <code>\/api\/urls\/{shortUrl}<\/code> : \u5143\u306eURL\u3092\u77ed\u7e2eURL\u3067\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Query&lt;UrlModel&gt; query;\ntry {\n    urlCollection.setAutoCommit(false);\n    query = urlCollection.query(\"select * where shortUrl = '\" + shortUrl + \"'\");\n    RowSet&lt;UrlModel&gt; rs = query.fetch(true);\n    if (!rs.hasNext()) {\n        throw new UrlShortenerException(String.format(\"%s not found\", shortUrl));\n    }\n    while (rs.hasNext()) {\n        UrlModel model = rs.next();\n        model.setClicks(model.getClicks() + 1);\n        rs.update(model);\n        urlCollection.commit();\n        return SHORT_URL_MAPPER_INSTANCE.mapEntityToResponse(model);\n    }\n} catch (GSException e) {\n    e.printStackTrace();\n    throw new UrlShortenerException(\"Please try again\");\n}\n<\/code><\/pre>\n<\/div>\n<p>\u6700\u521d\u306e\u90e8\u5206\u3067\u306f\u3001shortUrl\u3067URL\u3092\u7167\u4f1a\u3057\u3088\u3046\u3068\u3057\u307e\u3059\u3002\u884c\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u4f8b\u5916\u3092\u6295\u3052\u307e\u3059\u3002\u884c\u304c\u898b\u3064\u304b\u3063\u305f\u5834\u5408\u306f\u3001\u30af\u30ea\u30c3\u30af\u6570\u3092\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u30b3\u30df\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<p>\u6210\u529f\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\uff1a<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">{\n      \"url\": \"https:\/\/www.javacodegeeks.com\/2023\/05\/what-are-events-relation-to-api-calls.html\",\n      \"shortUrl\": \"HjlQjET\"\n    }\n    <\/code><\/pre>\n<\/div>\n<p>3&#46;  GET <code>\/api\/urls<\/code> : \u3059\u3079\u3066\u306eURL\u3092\u3001\u305d\u306eURL\u306b\u4f55\u56de\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u304b\u306e\u60c5\u5831\u3068\u3068\u3082\u306b\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">public List&lt;UrlModel&gt; getUrls() {\n    List&lt;UrlModel&gt; urls = new ArrayList&lt;&gt;();\n    Query&lt;UrlModel&gt; query;\n    try {\n        query = urlCollection.query(\"select * from urls\");\n        RowSet&lt;UrlModel&gt; rs = query.fetch();\n        while (rs.hasNext()) {\n            UrlModel model = rs.next();\n            urls.add(model);\n        }\n    } catch (GSException e) {\n        e.printStackTrace();\n    }\n    return urls;\n}\n    <\/code><\/pre>\n<\/div>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5185\u306e\u3059\u3079\u3066\u306eURL\u3092\u30d5\u30a7\u30c3\u30c1\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u6210\u529f\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\uff1a<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">    {    \n        \"data\":[\n            {\n              \"id\": 435224999694707071\n              \"shortUrl\": \"GjuWlGRgHH\",\n              \"originalUrl\": \"https:\/\/developers.googleblog.com\/2018\/03\/transitioning-google-url-shortener.html\"\n              \"clicks\": 7\n            }\n        ]\n    }\n    <\/code><\/pre>\n<\/div>\n<p>4&#46;  GET <code>\/api\/metrics<\/code> : \u3059\u3079\u3066\u306e url \u30e1\u30c8\u30ea\u30af\u30b9\u3092\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n<p>\u6210\u529f\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\uff1a<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">    {\n      \"data\":[\n        {\n          \"timestamp\": \"2023-05-21T18:56:08.656+00:00\",\n          \"shortUrl\": \"HgUsO2Cj7d\",\n          \"userAgent\": \"vscode-restclient\",\n          \"ipAddress\": \"172.23.0.1\"\n        }\n      ]\n    }\n    <\/code><\/pre>\n<\/div>\n<h2>API\u306e\u62e1\u5f35<\/h2>\n<p>\u3053\u308c\u3089\u306e\u9805\u76ee\u306f\u3001\u672c\u756a\u7a3c\u52d5\u53ef\u80fd\u306a\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u308b\u305f\u3081\u306b\u8003\u616e\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3053\u3068\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u9ad8\u3044\u53ef\u7528\u6027: API\u306f\u9ad8\u3044\u53ef\u7528\u6027\u3092\u6301\u3064\u3079\u304d\u3067\u3059\u3002URL\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306f\u3001\u6700\u5c0f\u306e\u30ec\u30a4\u30c6\u30f3\u30b7\u30fc\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u884c\u308f\u308c\u308b\u3079\u304d\u3067\u3059\u3002 <\/li>\n<li>\u5f85\u3061\u6642\u9593\u3092\u6539\u5584\u3059\u308b\u305f\u3081\u306e\u30ad\u30e3\u30c3\u30b7\u30e5: \u983b\u7e41\u306b\u30a2\u30af\u30bb\u30b9\u3055\u308c\u308b\u77ed\u3044ULR\u30841\u65e5\u306e\u691c\u7d22\u306e\u4e0a\u4f4d10\uff05\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3053\u3068\u3067\u3001API\u306e\u5fdc\u7b54\u6642\u9593\u3092\u6539\u5584\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 <\/li>\n<li>\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b7\u30f3\u30b0: \u3069\u306e\u30b5\u30fc\u30d0\u30fc\u304c\u3069\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3067\u304d\u308b\u304b\u3092\u6c7a\u5b9a\u3057\u307e\u3059\u3002\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u30fc\u306f\u3001\u5168\u30e6\u30fc\u30b6\u30fc\u306e\u7a93\u53e3\u306e\u5f79\u5272\u3082\u679c\u305f\u3057\u307e\u3059\u3002 <\/li>\n<li>\u30c7\u30fc\u30bf\u5bb9\u91cf\uff1a\u30b7\u30b9\u30c6\u30e0\u306b\u633f\u5165\u3059\u308b\u30c7\u30fc\u30bf\u91cf\u3092\u628a\u63e1\u3057\u30015\u5e74\u307e\u305f\u306f10\u5e74\u9593\u306e\u30c7\u30fc\u30bf\u4fdd\u5b58\u3092\u8a08\u7b97\u3059\u308b\u3002 <\/li>\n<li>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3: API\u306f\u3001\u60aa\u610f\u306e\u3042\u308b\u30e6\u30fc\u30b6\u30fc\u304c\u30d5\u30a3\u30c3\u30b7\u30f3\u30b0\u30b5\u30a4\u30c8\u3084\u30de\u30eb\u30a6\u30a7\u30a2\u30b5\u30a4\u30c8\u3078\u306e\u30b7\u30e7\u30fc\u30c8\u30ea\u30f3\u30af\u3092\u751f\u6210\u3059\u308b\u306e\u3092\u9632\u304e\u3001DDoS\u653b\u6483\u3084\u7dcf\u5f53\u305f\u308a\u653b\u6483\u304b\u3089\u4fdd\u8b77\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u308b\u3079\u304d\u3067\u3059\u3002<\/li>\n<\/ul>\n<h2>\u7d50\u8ad6<\/h2>\n<p>Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u30b7\u30f3\u30d7\u30eb\u306aURL\u77ed\u7e2e\u30c4\u30fc\u30eb\u3092\u4f5c\u308b\u306e\u306f\u305d\u308c\u307b\u3069\u96e3\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u306e\u8a18\u4e8b\u3067\u8aac\u660e\u3057\u305f\u30b9\u30c6\u30c3\u30d7\u306b\u5f93\u3046\u3053\u3068\u3067\u3001\u7ba1\u7406\u3068\u8ffd\u8de1\u304c\u7c21\u5358\u306aURL\u77ed\u7e2e\u30c4\u30fc\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9577\u304f\u3066\u9762\u5012\u306aURL\u306b\u3046\u3093\u3056\u308a\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u53cb\u4eba\u3084\u540c\u50da\u3068URL\u3092\u5171\u6709\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u611f\u3058\u307e\u305b\u3093\u304b\uff1f\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u3042\u306a\u305f\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u9577\u3044URL\u306f\u30a4\u30e9\u30a4\u30e9\u3055\u305b\u308b\u3057\u3001\u7ba1\u7406\u3082\u96e3\u3057\u3044\u3067\u3059\u3002\u5e78\u3044\u306a\u3053\u3068\u306b\u3001\u3053\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u65b9 [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":49554,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1005],"tags":[],"class_list":["post-50864","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>Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"\u9577\u304f\u3066\u9762\u5012\u306aURL\u306b\u3046\u3093\u3056\u308a\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u53cb\u4eba\u3084\u540c\u50da\u3068URL\u3092\u5171\u6709\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u611f\u3058\u307e\u305b\u3093\u304b\uff1f\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u3042\u306a\u305f\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u9577\u3044URL\u306f\u30a4\u30e9\u30a4\u30e9\u3055\" \/>\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\/building-url-shortener-api-using-java-spring-boot-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"\u9577\u304f\u3066\u9762\u5012\u306aURL\u306b\u3046\u3093\u3056\u308a\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u53cb\u4eba\u3084\u540c\u50da\u3068URL\u3092\u5171\u6709\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u611f\u3058\u307e\u305b\u3093\u304b\uff1f\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u3042\u306a\u305f\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u9577\u3044URL\u306f\u30a4\u30e9\u30a4\u30e9\u3055\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/building-url-shortener-api-using-java-spring-boot-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=\"2023-07-08T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-14T15:56:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb.net\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1920\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"griddb-admin\" \/>\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=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u5206\" \/>\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\/building-url-shortener-api-using-java-spring-boot-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b\",\"datePublished\":\"2023-07-08T07:00:00+00:00\",\"dateModified\":\"2025-11-14T15:56:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/\"},\"wordCount\":133,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/\",\"url\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/\",\"name\":\"Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"datePublished\":\"2023-07-08T07:00:00+00:00\",\"dateModified\":\"2025-11-14T15:56:16+00:00\",\"description\":\"\u9577\u304f\u3066\u9762\u5012\u306aURL\u306b\u3046\u3093\u3056\u308a\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u53cb\u4eba\u3084\u540c\u50da\u3068URL\u3092\u5171\u6709\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u611f\u3058\u307e\u305b\u3093\u304b\uff1f\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u3042\u306a\u305f\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u9577\u3044URL\u306f\u30a4\u30e9\u30a4\u30e9\u3055\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"contentUrl\":\"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"width\":1920,\"height\":1920},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/griddb.net\/ja\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b | GridDB: Open Source Time Series Database for IoT","description":"\u9577\u304f\u3066\u9762\u5012\u306aURL\u306b\u3046\u3093\u3056\u308a\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u53cb\u4eba\u3084\u540c\u50da\u3068URL\u3092\u5171\u6709\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u611f\u3058\u307e\u305b\u3093\u304b\uff1f\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u3042\u306a\u305f\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u9577\u3044URL\u306f\u30a4\u30e9\u30a4\u30e9\u3055","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\/building-url-shortener-api-using-java-spring-boot-griddb\/","og_locale":"ja_JP","og_type":"article","og_title":"Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b | GridDB: Open Source Time Series Database for IoT","og_description":"\u9577\u304f\u3066\u9762\u5012\u306aURL\u306b\u3046\u3093\u3056\u308a\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u53cb\u4eba\u3084\u540c\u50da\u3068URL\u3092\u5171\u6709\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u611f\u3058\u307e\u305b\u3093\u304b\uff1f\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u3042\u306a\u305f\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u9577\u3044URL\u306f\u30a4\u30e9\u30a4\u30e9\u3055","og_url":"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/building-url-shortener-api-using-java-spring-boot-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2023-07-08T07:00:00+00:00","article_modified_time":"2025-11-14T15:56:16+00:00","og_image":[{"width":1920,"height":1920,"url":"https:\/\/griddb.net\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","type":"image\/jpeg"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"\u57f7\u7b46\u8005":"griddb-admin","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"2\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b","datePublished":"2023-07-08T07:00:00+00:00","dateModified":"2025-11-14T15:56:16+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/"},"wordCount":133,"commentCount":0,"publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/","url":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/","name":"Java Spring-Boot\u3068GridDB\u3092\u4f7f\u3063\u3066\u77ed\u7e2eURL\u3092\u751f\u6210\u3059\u308bAPI\u3092\u69cb\u7bc9\u3059\u308b | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","datePublished":"2023-07-08T07:00:00+00:00","dateModified":"2025-11-14T15:56:16+00:00","description":"\u9577\u304f\u3066\u9762\u5012\u306aURL\u306b\u3046\u3093\u3056\u308a\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u53cb\u4eba\u3084\u540c\u50da\u3068URL\u3092\u5171\u6709\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u611f\u3058\u307e\u305b\u3093\u304b\uff1f\u3082\u3057\u305d\u3046\u306a\u3089\u3001\u3042\u306a\u305f\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u9577\u3044URL\u306f\u30a4\u30e9\u30a4\u30e9\u3055","inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","contentUrl":"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","width":1920,"height":1920},{"@type":"WebSite","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/griddb.net\/ja\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/comments?post=50864"}],"version-history":[{"count":1,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50864\/revisions"}],"predecessor-version":[{"id":51690,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50864\/revisions\/51690"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/media\/49554"}],"wp:attachment":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/media?parent=50864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/categories?post=50864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/tags?post=50864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}