{"id":8614,"date":"2022-08-25T00:39:37","date_gmt":"2022-08-25T07:39:37","guid":{"rendered":"https:\/\/en.pingcap.com\/?p=8614"},"modified":"2024-12-20T04:04:49","modified_gmt":"2024-12-20T12:04:49","slug":"building-a-web-application-with-spring-boot-and-tidb","status":"publish","type":"post","link":"https:\/\/www.pingcap.com\/ko\/blog\/building-a-web-application-with-spring-boot-and-tidb\/","title":{"rendered":"Building a Web Application with Spring Boot and TiDB"},"content":{"rendered":"<p>Web application developers are on a never-ending quest to build better applications faster and more easily. This post introduces two great tools\u2014Spring Boot and <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/overview\">\ud2f0DB<\/a>\u2014that simplify your development process, enabling you to easily realize your application goals. Spring Boot is a popular open source tool that helps you build standalone production-grade web applications faster and easier. <a href=\"https:\/\/github.com\/pingcap\/tidb\">\ud2f0DB<\/a> is an open source SQL database with a simplified and distributed architecture, elastic scalability, and MySQL compatibility. It helps\u00a0you process and analyze your application data, however large it may be, with ease and in real time.\u00a0<\/p>\n\n\n\n<p>In this article, we\u2019ll use Spring Boot to build a sample game application, with TiDB as the database. In this app, each player has a unique ID. They also have two attributes\u2014coins and goods\u2014that they use to trade with each other.&nbsp;<\/p>\n\n\n\n<p>Now, let\u2019s start to explore how to build this game application. Before we get started, if you\u2019d like to know what the final application looks like, you can find its <a href=\"https:\/\/github.com\/pingcap-inc\/tidb-example-java\">complete source code<\/a> on GitHub.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install_JDK_and_Apache_Maven\"><\/span>Install JDK and Apache Maven&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To get started, install a Java Development Kit (JDK) and <a href=\"https:\/\/maven.apache.org\/what-is-maven.html\">Apache Maven<\/a> to manage the application dependencies. For detailed guidance, refer to the documentation on how to&nbsp;<a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/dev-guide-sample-application-spring-boot#step-2-install-jdk\">Install JDK<\/a> and how to <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/dev-guide-sample-application-spring-boot#step-3-install-maven\">Install Maven<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_and_launch_your_TiDB_cluster\"><\/span>Create and launch your TiDB cluster<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can either create a local TiDB cluster or a <a href=\"\/ko\/tidb-cloud\/\">TiDB Cloud<\/a> free cluster, which is a fully-managed Database-as-a-Service (DBaaS).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To create a local TiDB cluster,&nbsp;see either <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/quick-start-with-tidb#deploy-a-local-test-cluster\">Deploy a local test cluster<\/a> \ub610\ub294 <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/production-deployment-using-tiup\">Deploy a TiDB Cluster Using TiUP<\/a>.<\/li>\n\n\n\n<li>To create a TiDB Cloud free cluster, see <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/dev-guide-build-cluster-in-cloud#step-1-create-a-free-cluster\">Build a TiDB Cluster in TiDB Cloud<\/a>.&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Get_the_application_code\"><\/span>Get the application code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Download or clone the <a href=\"https:\/\/github.com\/pingcap-inc\/tidb-example-java\">sample application repository<\/a> to your local environment, and then navigate to the <code>spring-jpa-hibernate<\/code> directory.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Run_the_application\"><\/span>Run the application<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the blank application you just created, Hibernate creates a <code>player_jpa<\/code> table within the <code>test<\/code> database. When you make requests using the application&#8217;s RESTful API, these requests run <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/dev-guide-transaction-overview\">database transactions<\/a> on the TiDB cluster.<\/p>\n\n\n\n<p>If you use a TiDB Cloud cluster, navigate to the <code>src\/main\/resources<\/code> directory and in the <code>application.yml<\/code> file, set <code>spring.datasource.url<\/code>, <code>spring.datasource.username<\/code>, \uadf8\ub9ac\uace0 <code>spring.datasource.password<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>spring:\n  datasource:\n    url: jdbc:mysql:\/\/localhost:4000\/test\n    username: root\n    #    password: xxx\n    driver-class-name: com.mysql.cj.jdbc.Driver\n  jpa:\n    show-sql: true\n    database-platform: org.hibernate.dialect.TiDBDialect\n    hibernate:\n      ddl-auto: create-drop<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>If you set the password to <code>123456<\/code>, the connection string you get in TiDB Cloud is:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql --connect-timeout 15 -u root -h xxx.tidbcloud.com -P 4000 -p<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Of course, when you create an actual project, we recommend that you use a more secure password.<\/p>\n\n\n\n<p>Next, you can set the parameters as follows:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>spring:\n  datasource:\n    url: jdbc:mysql:\/\/xxx.tidbcloud.com:4000\/test\n    username: root\n    password: 123456\n    driver-class-name: com.mysql.cj.jdbc.Driver\n  jpa:\n    show-sql: true\n    database-platform: org.hibernate.dialect.TiDBDialect\n    hibernate:\n      ddl-auto: create-drop<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>After you make these changes, you can run the application.&nbsp;<\/p>\n\n\n\n<p>Open a terminal session and navigate to the directory:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd &lt;path&gt;\/tidb-example-java\/spring-jpa-hibernate<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Build and run the application with <code>Make<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"HTTP_requests\"><\/span>HTTP requests<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>After the service is up and running, you can send the HTTP requests to the backend application. http:\/\/localhost:8080 is the base URL that provides services. You can use many different HTTP requests such as Postman and cURL requests to use this application. In this tutorial, we use Postman requests to show you how to use this application.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Use Postman requests<\/h3>\n\n\n\n<p>Download this <a href=\"https:\/\/raw.githubusercontent.com\/pingcap-inc\/tidb-example-java\/main\/spring-jpa-hibernate\/Player.postman_collection.json\">configuration file<\/a> and import it into <a href=\"https:\/\/www.postman.com\/\">Postman<\/a> as shown here:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"566\" src=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20013920\/image-125-1024x566.png\" alt=\"\" class=\"wp-image-11722\" srcset=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20013920\/image-125-1024x566.png 1024w, https:\/\/static.pingcap.com\/files\/2023\/04\/20013920\/image-125-300x166.png 300w, https:\/\/static.pingcap.com\/files\/2023\/04\/20013920\/image-125-768x424.png 768w, https:\/\/static.pingcap.com\/files\/2023\/04\/20013920\/image-125.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Create players<\/h3>\n\n\n\n<p>Click on the <strong>Create<\/strong> tab and the <strong>Send<\/strong> button to send a POST request to <code>http:\/\/localhost:8080\/player\/<\/code>. The return value is the number of players added, which is expected to be 1.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"578\" src=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20013947\/image-126.png\" alt=\"\" class=\"wp-image-11724\" srcset=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20013947\/image-126.png 786w, https:\/\/static.pingcap.com\/files\/2023\/04\/20013947\/image-126-300x221.png 300w, https:\/\/static.pingcap.com\/files\/2023\/04\/20013947\/image-126-768x565.png 768w\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Get player information by ID<\/h3>\n\n\n\n<p>Click on the <strong>GetByID<\/strong> tab and the <strong>Send<\/strong> button to send a GET request to http:\/\/localhost:8080\/player\/1. The return value is the information of the player with ID 1.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"561\" src=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014006\/image-127-1024x561.png\" alt=\"\" class=\"wp-image-11725\" srcset=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014006\/image-127-1024x561.png 1024w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014006\/image-127-300x164.png 300w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014006\/image-127-768x421.png 768w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014006\/image-127.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Get player information in bulk by limit<\/h3>\n\n\n\n<p>Click on the <strong>GetByLimit<\/strong> tab and the <strong>Send<\/strong> button to send a GET request to <code>http:\/\/localhost:8080\/player\/limit\/3<\/code>. The return value is a list of information for up to 3 players.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"609\" src=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014019\/image-128-1024x609.png\" alt=\"\" class=\"wp-image-11726\" srcset=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014019\/image-128-1024x609.png 1024w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014019\/image-128-300x178.png 300w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014019\/image-128-768x457.png 768w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014019\/image-128.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Get player information by page<\/h3>\n\n\n\n<p>Click on the <strong>GetByPage<\/strong> tab and the <strong>Send<\/strong> button to send a GET request to <code>http:\/\/localhost:8080\/player\/page?index=0&amp;size=2<\/code>. The return value is the page with index 0, with 2 players per page. The return value also contains the paging information such as the offset, totalPages, and sort order.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"809\" src=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014106\/image-130-1024x809.png\" alt=\"\" class=\"wp-image-11728\" srcset=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014106\/image-130-1024x809.png 1024w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014106\/image-130-300x237.png 300w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014106\/image-130-768x607.png 768w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014106\/image-130.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Count players<\/h3>\n\n\n\n<p>Click the <strong>Count<\/strong> tab and the <strong>Send<\/strong> button to send a GET request to <code>http:\/\/localhost:8080\/player\/count<\/code>. The return value is the number of players.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"498\" src=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014119\/image-131-1024x498.png\" alt=\"\" class=\"wp-image-11729\" srcset=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014119\/image-131-1024x498.png 1024w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014119\/image-131-300x146.png 300w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014119\/image-131-768x373.png 768w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014119\/image-131.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Player trading<\/h3>\n\n\n\n<p>Click on the <strong>Trade<\/strong> tab and the <strong>Send<\/strong> button to send a PUT request to <code>http:\/\/localhost:8080\/player\/trade.<\/code> The request parameters are the seller&#8217;s ID (<code>sellID<\/code>), the buyer&#8217;s ID (<code>buyID<\/code>), the amount of goods purchased , and the number of coins consumed for the purchase price.<\/p>\n\n\n\n<p>The return value indicates whether the transaction succeeded. When the seller doesn\u2019t have enough goods, the buyer doesn\u2019t have enough coins, or there is a database error, the <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/dev-guide-transaction-overview\">database transaction<\/a> guarantees that the trade is not successful and no player&#8217;s coins or goods are lost.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014134\/image-132-1024x556.png\" alt=\"\" class=\"wp-image-11730\" srcset=\"https:\/\/static.pingcap.com\/files\/2023\/04\/20014134\/image-132-1024x556.png 1024w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014134\/image-132-300x163.png 300w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014134\/image-132-768x417.png 768w, https:\/\/static.pingcap.com\/files\/2023\/04\/20014134\/image-132.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Wrapping_Up\"><\/span>Wrapping Up&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this post, you\u2019ve learned how to build a game application with Spring Boot and TiDB, and seen how quickly and easily you can do it. If you want to learn more implementation details about this game, see the <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/dev-guide-sample-application-spring-boot#implementation-details\">Implementation Details<\/a>.&nbsp;<\/p>\n\n\n\n<p>If you encounter problems or have questions, contact us through <a href=\"https:\/\/twitter.com\/PingCAP\">Twitter<\/a> and our <a href=\"https:\/\/slack.tidb.io\/invite?team=tidb-community&amp;channel=everyone&amp;ref=pingcap-blog\">Slack channel<\/a>. You can also join TiDB Internals to share your thoughts and feedback with us.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Keeping reading:&nbsp;<\/strong><br><a href=\"\/ko\/blog\/using-retool-and-tidb-cloud-to-build-a-real-time-kanban-in-30-minutes\/\">Using Retool and TiDB Cloud to Build a Real-Time Kanban in 30 Minutes<\/a><br><a href=\"\/ko\/blog\/analytics-on-tidb-cloud-with-databricks\/\">Analytics on TiDB Cloud with Databricks<\/a><br><a href=\"\/ko\/blog\/build-a-better-github-insight-tool-in-a-week-a-true-story\/\">Build a Better Github Insight Tool in a Week? A True Story<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>This post shows you how to quickly build an application by leveraging Spring Boot and TiDB. <\/p>","protected":false},"author":203,"featured_media":8629,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[18],"tags":[163,111,29],"class_list":["post-8614","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-community","tag-app-developer","tag-tidb","tag-tutorial"],"acf":[],"featured_image_src":"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg","author_info":{"display_name":"Qizhi Wang","author_link":"https:\/\/www.pingcap.com\/ko\/blog\/author\/qizhi-wang\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Building a Web Application with Spring Boot and TiDB | TiDB<\/title>\n<meta name=\"description\" content=\"This post shows you how to quickly build an application by leveraging Spring Boot and TiDB, an open source distributed SQL database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/building-a-web-application-with-spring-boot-and-tidb\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building a Web Application with Spring Boot and TiDB | TiDB\" \/>\n<meta property=\"og:description\" content=\"This post shows you how to quickly build an application by leveraging Spring Boot and TiDB, an open source distributed SQL database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/blog\/building-a-web-application-with-spring-boot-and-tidb\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-25T07:39:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-20T12:04:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2022\/08\/tidb-springboot-scaled.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1340\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Qizhi Wang\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/static.pingcap.com\/files\/2022\/08\/tidb-springboot-scaled.jpeg\" \/>\n<meta name=\"twitter:creator\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Qizhi Wang\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/\"},\"author\":{\"name\":\"Qizhi Wang\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/58795d2dcbbffb6a317ad67d271c4322\"},\"headline\":\"Building a Web Application with Spring Boot and TiDB\",\"datePublished\":\"2022-08-25T07:39:37+00:00\",\"dateModified\":\"2024-12-20T12:04:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/\"},\"wordCount\":878,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg\",\"keywords\":[\"App Developer\",\"TiDB\",\"Tutorial\"],\"articleSection\":[\"Community\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/\",\"url\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/\",\"name\":\"Building a Web Application with Spring Boot and TiDB | TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg\",\"datePublished\":\"2022-08-25T07:39:37+00:00\",\"dateModified\":\"2024-12-20T12:04:49+00:00\",\"description\":\"This post shows you how to quickly build an application by leveraging Spring Boot and TiDB, an open source distributed SQL database.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#primaryimage\",\"url\":\"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg\",\"width\":2560,\"height\":853},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building a Web Application with Spring Boot and TiDB\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pingcap.com\/#website\",\"url\":\"https:\/\/www.pingcap.com\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pingcap.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pingcap.com\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\/\/www.pingcap.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pingcap2015\",\"https:\/\/x.com\/PingCAP\",\"https:\/\/linkedin.com\/company\/pingcap\",\"https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/58795d2dcbbffb6a317ad67d271c4322\",\"name\":\"Qizhi Wang\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg\",\"caption\":\"Qizhi Wang\"},\"description\":\"Principle AI SDE\",\"url\":\"https:\/\/www.pingcap.com\/ko\/blog\/author\/qizhi-wang\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building a Web Application with Spring Boot and TiDB | TiDB","description":"This post shows you how to quickly build an application by leveraging Spring Boot and TiDB, an open source distributed SQL database.","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:\/\/www.pingcap.com\/ko\/blog\/building-a-web-application-with-spring-boot-and-tidb\/","og_locale":"ko_KR","og_type":"article","og_title":"Building a Web Application with Spring Boot and TiDB | TiDB","og_description":"This post shows you how to quickly build an application by leveraging Spring Boot and TiDB, an open source distributed SQL database.","og_url":"https:\/\/www.pingcap.com\/ko\/blog\/building-a-web-application-with-spring-boot-and-tidb\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_published_time":"2022-08-25T07:39:37+00:00","article_modified_time":"2024-12-20T12:04:49+00:00","og_image":[{"width":2560,"height":1340,"url":"https:\/\/static.pingcap.com\/files\/2022\/08\/tidb-springboot-scaled.jpeg","type":"image\/jpeg"}],"author":"Qizhi Wang","twitter_card":"summary_large_image","twitter_image":"https:\/\/static.pingcap.com\/files\/2022\/08\/tidb-springboot-scaled.jpeg","twitter_creator":"@PingCAP","twitter_site":"@PingCAP","twitter_misc":{"Written by":"Qizhi Wang","Est. reading time":"5\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#article","isPartOf":{"@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/"},"author":{"name":"Qizhi Wang","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/58795d2dcbbffb6a317ad67d271c4322"},"headline":"Building a Web Application with Spring Boot and TiDB","datePublished":"2022-08-25T07:39:37+00:00","dateModified":"2024-12-20T12:04:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/"},"wordCount":878,"commentCount":0,"publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg","keywords":["App Developer","TiDB","Tutorial"],"articleSection":["Community"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/","url":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/","name":"Building a Web Application with Spring Boot and TiDB | TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#primaryimage"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg","datePublished":"2022-08-25T07:39:37+00:00","dateModified":"2024-12-20T12:04:49+00:00","description":"This post shows you how to quickly build an application by leveraging Spring Boot and TiDB, an open source distributed SQL database.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#primaryimage","url":"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg","contentUrl":"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg","width":2560,"height":853},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/blog\/building-a-web-application-with-spring-boot-and-tidb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Building a Web Application with Spring Boot and TiDB"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]},{"@type":"Person","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/58795d2dcbbffb6a317ad67d271c4322","name":"Qizhi Wang","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/","url":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","contentUrl":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","caption":"Qizhi Wang"},"description":"Principle AI SDE","url":"https:\/\/www.pingcap.com\/ko\/blog\/author\/qizhi-wang\/"}]}},"grav_blocks":false,"card_markup":"<a class=\"card-resource bg-white\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/building-a-web-application-with-spring-boot-and-tidb\/\"><div class=\"card-resource__image-container\"><img class=\"card-resource__image\" alt=\"spring boot tidb\" src=\"https:\/\/static.pingcap.com\/files\/2022\/08\/spring-boot-tidb-scaled.jpeg\" loading=\"lazy\" width=2560 height=853 \/><\/div><div class=\"card-resource__content-container\"><div class=\"card-resource__content-head\"><div class=\"card-resource__category\">Community<\/div><\/div><h5 class=\"card-resource__title\">Building a Web Application with Spring Boot and TiDB<\/h5><\/div><\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/8614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/203"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/comments?post=8614"}],"version-history":[{"count":15,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/8614\/revisions"}],"predecessor-version":[{"id":24452,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/8614\/revisions\/24452"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media\/8629"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=8614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/categories?post=8614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/tags?post=8614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}