{"id":46767,"date":"2023-07-08T00:00:00","date_gmt":"2023-07-08T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/"},"modified":"2025-11-13T12:56:39","modified_gmt":"2025-11-13T20:56:39","slug":"building-url-shortener-api-using-java-spring-boot-griddb","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/","title":{"rendered":"Building URL Shortener API using Java Spring-Boot &#038; GridDB"},"content":{"rendered":"<p>Are you tired of long and cumbersome URLs? Do you find it challenging to share them with your friends and colleagues? If yes, then you are not alone. Long URLs can be frustrating and challenging to manage. Fortunately, there is a solution to this problem &#8211; URL shorteners. In this article, we will discuss how to build a simple URL shortener using Java Spring-Boot and GridDB.<\/p>\n<h2>What is a URL Shortener?<\/h2>\n<p>Url Shortener is a service that creates a short link from a very long URL. Clicking on a sort URL, the user will be redirected to the original URL.<br \/>\nFor example, the long URL https:\/\/developers.googleblog.com\/2018\/03\/transitioning-google-url-shortener.html can be shortened to goo.gl. The shortened URL is easier to share, and it takes up less space.<\/p>\n<h2>Why Build a URL Shortener?<\/h2>\n<p>There are several reasons why you might want to build a URL shortener.<br \/>\n1. It can help you manage long URLs more efficiently.<br \/>\n2. It can help you track clicks and user engagement.<br \/>\n3. It can help you brand your URLs. For example, you can use your brand name in the shortened URL.<\/p>\n<h2>Features<\/h2>\n<p>Before we dive into the technical details, let&#8217;s take a look at some of the features that we want to implement in our URL shortener service:<br \/>\n1. The service should be REST API accessible<br \/>\n2. Given a long URL should generate a unique Short URL<br \/>\n3. Given a short URL should redirect to the original URL<br \/>\n4. Service should provide analytics features (most visited links, how many times the URL was visited)<\/p>\n<h2>System Design<\/h2>\n<p>The most important thing to keep in mind here is that our system will be read-heady. The number of reading requests will be 1000 times more than the number of write requests.<\/p>\n<h3>Encoding actual URL<\/h3>\n<ul>\n<li>Compute a unique ID of the given URL. In this tutorial I use TSID.<\/li>\n<li>Use base62 encoding ([A-Z, a-z, 0\u20139]) to encode ID into unique string. We take the first 7 characters as the short URL.<\/li>\n<\/ul>\n<h2>SQL or NoSQL Database<\/h2>\n<p>One of the key decisions that we need to make when building our URL shortener service is which database to use. There are two main types of databases: SQL and NoSQL databases.<\/p>\n<p>SQL databases are relational databases that store data in tables with predefined schemas. They are good for handling structured data and transactions.<\/p>\n<p>NoSQL databases, on the other hand, are non-relational databases that store data in a flexible, schema-less format. They are good for handling unstructured data and scaling horizontally.<\/p>\n<p>For our URL shortener service, we will be using a NoSQL database. It is a good fit for our use case because we don&#8217;t really need a relationship among data, but we need fast read and write speed.<\/p>\n<p>In this tutorial we will use GridDB: a highly scalable in memory, NoSQL time-series database optimized for IoT and big data applications.<\/p>\n<p>The Key Container model allows high-speed access to data through Java and C APIs. Data in GridDB is also queried through TQL, a custom SQL-like query language. Basic search through the WHERE command and high-speed conditional search operations through indexing offers a great advantage for applications that rely on faster search. GridDB supports transactions, including those with plural records from the application. Transactions in GridDB guarantee ACID (Atomicity, Consistency, Isolation, and Durability) at the container level.<\/p>\n<p>In this tutorial, we just need 2 tables, one for storing URLs and the other for storing metrics.<\/p>\n<h2>Setting up Java application<\/h2>\n<p>In this tutorial, we will be using the following stack:<br \/>\n* Java OpenJDK 17<br \/>\n* Docker 23.0.1<br \/>\n* Spring Boot 3.0.5<br \/>\n* apache-maven-3.8.7<\/p>\n<h3>GridDB Instance<\/h3>\n<p>Before creating the API endpoint, we need to acquire a connection between the application and the cluster database of GridDB. Here we create an instance of GridStore class.<\/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>Create dataset for storing URLs<\/h3>\n<p>We set the Id column as primary key.<\/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>Create dataset for storing metrics of URLs<\/h3>\n<p>For timeseries data we need a primary key in timestamp format.<\/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>Create a Container for managing the Rows<\/h3>\n<p>After setting up the DB connection, we can use it to create the container. We are using the Collection container to store URLs. We are using the shortUrl field as an index because this field will be used in the condition of the WHERE query.<\/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>For the URL metrics, we are using the TimeSeries container because we need to manage rows with the occurrence time.<\/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 Endpoints<\/h2>\n<p>We will create the following endpoints for our application:<br \/>\n1. POST <code>\/api\/urls<\/code>. Create a new short URL resource.<\/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>We are using the Java API to put the URL data into GridDB.<\/p>\n<p>Payload example:<\/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>Success Response:<\/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>This endpoint will return a JSON value containing the short URL generated by the service class, or throw an exception in case an error occurred.<\/p>\n<ol>\n<li>GET <code>\/api\/urls\/{shorUrl}<\/code>. Find the original URL by short URL.<\/li>\n<\/ol>\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>In the first part, we try to query the URL by shortUrl. If the row is not found, we throw an exception. If we found the row, here we need to increment the count of clicks. After that, we are committing the transaction.<\/p>\n<p>Success Response:<\/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<ol>\n<li>GET <code>\/api\/urls<\/code>. List all URLs with the information about how many times the URL has been visited<\/li>\n<\/ol>\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>This code is for fetching all the URLs in the collection.<\/p>\n<p>Success Response:<\/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<ol>\n<li>GET <code>\/api\/metrics<\/code>. List all url metrics<\/li>\n<\/ol>\n<p>Success Response:<\/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>Scaling the API<\/h2>\n<p>These items are the things that must be considered for making a production-ready system:<br \/>\n* High availability: the API should be highly available. URL redirection and response time should happen in real-time with minimal latency.<br \/>\n* Caching for improved latency: we can improve the response time of our API by caching frequently accessed short ULRs or the top 10% of daily searches.<br \/>\n* Load balancing: determines which server is available to handle which request. The load balancer also serves as a single point of contact for all of our users.<br \/>\n* Data capacity: to understand how much data we might have to insert into our system, and calculate the storage of data for 5 or 10 years.<br \/>\n* Security: the API should be designed to prevent malicious users from generating short links to phishing or malware sites, and protect against DDoS attacks and brute force attacks.<\/p>\n<h2>Conclusion<\/h2>\n<p>In conclusion, building a simple URL shortener using Java Spring-Boot and GridDB is a straightforward process. By following the steps outlined in this article, you can create a URL shortener that is easy to manage and track.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you tired of long and cumbersome URLs? Do you find it challenging to share them with your friends and colleagues? If yes, then you are not alone. Long URLs can be frustrating and challenging to manage. Fortunately, there is a solution to this problem &#8211; URL shorteners. In this article, we will discuss how [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":29673,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46767","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Building URL Shortener API using Java Spring-Boot &amp; GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Are you tired of long and cumbersome URLs? Do you find it challenging to share them with your friends and colleagues? If yes, then you are not alone. Long\" \/>\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\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building URL Shortener API using Java Spring-Boot &amp; GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Are you tired of long and cumbersome URLs? Do you find it challenging to share them with your friends and colleagues? If yes, then you are not alone. Long\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/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-13T20:56:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.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=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Building URL Shortener API using Java Spring-Boot &#038; GridDB\",\"datePublished\":\"2023-07-08T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:56:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/\"},\"wordCount\":1054,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/\",\"name\":\"Building URL Shortener API using Java Spring-Boot & GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/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-13T20:56:39+00:00\",\"description\":\"Are you tired of long and cumbersome URLs? Do you find it challenging to share them with your friends and colleagues? If yes, then you are not alone. Long\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/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:\/\/www.griddb.net\/en\/#website\",\"url\":\"https:\/\/www.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:\/\/www.griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/www.griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.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:\/\/www.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:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.griddb.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:\/\/www.griddb.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building URL Shortener API using Java Spring-Boot & GridDB | GridDB: Open Source Time Series Database for IoT","description":"Are you tired of long and cumbersome URLs? Do you find it challenging to share them with your friends and colleagues? If yes, then you are not alone. Long","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\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/","og_locale":"en_US","og_type":"article","og_title":"Building URL Shortener API using Java Spring-Boot & GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"Are you tired of long and cumbersome URLs? Do you find it challenging to share them with your friends and colleagues? If yes, then you are not alone. Long","og_url":"https:\/\/griddb.net\/en\/blog\/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-13T20:56:39+00:00","og_image":[{"width":1920,"height":1920,"url":"https:\/\/www.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":{"Written by":"griddb-admin","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Building URL Shortener API using Java Spring-Boot &#038; GridDB","datePublished":"2023-07-08T07:00:00+00:00","dateModified":"2025-11-13T20:56:39+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/"},"wordCount":1054,"commentCount":2,"publisher":{"@id":"https:\/\/www.griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2023\/07\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/","url":"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/","name":"Building URL Shortener API using Java Spring-Boot & GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/www.griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/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-13T20:56:39+00:00","description":"Are you tired of long and cumbersome URLs? Do you find it challenging to share them with your friends and colleagues? If yes, then you are not alone. Long","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/building-url-shortener-api-using-java-spring-boot-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/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:\/\/www.griddb.net\/en\/#website","url":"https:\/\/www.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:\/\/www.griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/www.griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.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:\/\/www.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:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.griddb.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:\/\/www.griddb.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46767"}],"version-history":[{"count":1,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46767\/revisions"}],"predecessor-version":[{"id":51433,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46767\/revisions\/51433"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media\/29673"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}