{"id":5352,"date":"2022-03-03T09:37:04","date_gmt":"2022-03-03T17:37:04","guid":{"rendered":"https:\/\/en.pingcap.com\/?p=5352"},"modified":"2024-06-06T21:47:54","modified_gmt":"2024-06-07T04:47:54","slug":"build-a-real-time-analytics-application-with-tidb-cloud","status":"publish","type":"post","link":"https:\/\/www.pingcap.com\/ko\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/","title":{"rendered":"Build a Real-time Analytics Application with TiDB Cloud"},"content":{"rendered":"<p><em>Disclaimer:<\/em><\/p>\n<ul>\n<li><em>PingExpress_DemoCorp is a dummy company. It does NOT reflect or imply any real company.<\/em><\/li>\n<li><em>This tutorial is for demonstration purposes only. Do NOT use any material (including but not limited to code, and commands) from this tutorial in production environments.<\/em><\/li>\n<\/ul>\n<p>PingExpress_DemoCorp is a supply chain management company in the United States. With more people shopping online due to the pandemic,\u00a0 PingExpress_DemoCorp\u2019s business has scaled rapidly. They\u2019re delivering tens of billions of packages a year.<\/p>\n<p>With so many deliveries, a key part of their success is accurate and efficient package tracking. Business managers need to know where packages are so they can identify potential traffic blocks and rearrange delivery routes. Customers need accurate delivery dates so they can plan ahead. Therefore, real-time tracking, status updates, and a detailed dashboard are very important to PingExpress_DemoCorp.<\/p>\n<p>With the current technology infra, PingExpress_DemoCorp is facing growing pains:<\/p>\n<ul>\n<li>PingExpress_DemoCorp uses MySQL. For a real-time dashboard, they need to use both historical data and new data coming in. Data analytics rely on stored procedures. As business roars, more data needs to be stored. The MySQL sharding solution can\u2019t meet their requirements, and the system is hard to scale and maintain.<\/li>\n<li>During peak hours, the performance on a standalone machine is poor. There is also high risk of a single-point failure.<\/li>\n<\/ul>\n<p>PingExpress_DemoCorp considered two options:<\/p>\n<ul>\n<li>Option A: Add a dedicated column store to the existing data stack to separate the OLTP workload from the OLAP workload.<\/li>\n<li>Option B: Replace MySQL database with TiDB, which contains both the row store for daily transactions and the column store for analytical workloads.<\/li>\n<\/ul>\n<p>PingExpress_DemoCorp chose option B. This is because adding another column storage for analysis workload makes the system more complicated. At the same time, data has to be synchronized from the row store to the column store via painful ETL processes over night. This means that choosing option A still does not enable PingExpress_DemoCorp to do real-time analytics.<\/p>\n<p><!--HubSpot Call-to-Action Code --><\/p>\n<p style=\"text-align: center;\"><span id=\"hs-cta-wrapper-1ca968e7-40c5-4aaf-b0c6-976446779a69\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-1ca968e7-40c5-4aaf-b0c6-976446779a69\" class=\"hs-cta-node hs-cta-1ca968e7-40c5-4aaf-b0c6-976446779a69\"><!-- [if lte IE 8]>\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/4466002\/1ca968e7-40c5-4aaf-b0c6-976446779a69\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" id=\"hs-cta-img-1ca968e7-40c5-4aaf-b0c6-976446779a69\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/4466002\/1ca968e7-40c5-4aaf-b0c6-976446779a69.png\" alt=\"Subscribe to Blog\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(4466002, '1ca968e7-40c5-4aaf-b0c6-976446779a69', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><\/p>\n<p><!-- end HubSpot Call-to-Action Code --><\/p>\n<p>On the other hand, switching to TiDB Cloud as the backend database is very attractive to PingExpress_DemoCorp\uff1a<\/p>\n<ul>\n<li>TiDB Cloud is MySQL compatible so it supports all of PingExpress_DemoCorp\u2019s current applications.<\/li>\n<li>TiDB Cloud supports PingExpress_DemoCorp\u2019s large, wide tables and multi-dimensional query analytics, in real-time. This is the highlight of TiDB Cloud since it supports both high-concurrency writes and fast queries.<\/li>\n<li>PingExpress_DemoCorp does not need to worry about the data load coming in any more. TiDB Cloud will auto scale-out or merge the data cluster based on the data load. So, no more sharding. And it supports strong consistency, which is critical for package tracking.<\/li>\n<li>TiDB is a Hybrid Transactional\/Analytical Processing (HTAP) database. It has a row store engine (TiDB server) and a column store engine (TiFlash). Data in TiDB server is replicated to TiFlash synchronously, which enables real time data analysis. This also means there will be no painful ETL process.<\/li>\n<\/ul>\n<p>In this tutorial, you will build a prototype for PingExpress_DemoCorp\u2019s real-time analytics dashboard that runs on a TiDB Cloud Proof-of-Concept (PoC) cluster.<\/p>\n<p>PingExpress_DemoCorp divides a package\u2019s lifecycle into four stages:<\/p>\n<ul>\n<li>\u201c1_pkg_in&#8221;: The package is collected by the company.<\/li>\n<li>&#8220;2_ori&#8221;: The package arrives at the processing center of the origin state.<\/li>\n<li>&#8220;3_des&#8221;: The package reaches the processing center of the destination state.<\/li>\n<li>&#8220;4_pkg_out&#8221;: The package is delivered to the end user.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Before_you_begin\"><\/span><a id=\"beforeyoubegin\"><\/a>Before you begin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You should have the following software and packages installed:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.python.org\/downloads\/\">Python<\/a> (v. 3+)<\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-connector-python\">MySQL connector for Python<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/sqlalchemy\/sqlalchemy\">SQLAlchemy<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pingcap\/sqlalchemy-tidb\">sqlalchemy-tidb<\/a><\/li>\n<li><a href=\"https:\/\/www.metabase.com\/docs\/latest\/operations-guide\/installing-metabase.html\">Metabase<\/a><\/li>\n<\/ul>\n<p><strong>Note:<\/strong> It is recommended to use <code>pip3<\/code> to install packages, such as SQLAlchemy. We also suggest NOT to use the Mac application version for Metabase. It is gradually being phased out. You may use the jar version instead.<\/p>\n<p><!--HubSpot Call-to-Action Code --><\/p>\n<p style=\"text-align: center;\"><span id=\"hs-cta-wrapper-dc83a601-b365-4d6a-82ad-8ba52e45dc0e\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-dc83a601-b365-4d6a-82ad-8ba52e45dc0e\" class=\"hs-cta-node hs-cta-dc83a601-b365-4d6a-82ad-8ba52e45dc0e\"><!-- [if lte IE 8]>\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/4466002\/dc83a601-b365-4d6a-82ad-8ba52e45dc0e\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" id=\"hs-cta-img-dc83a601-b365-4d6a-82ad-8ba52e45dc0e\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/4466002\/dc83a601-b365-4d6a-82ad-8ba52e45dc0e.png\" alt=\"Try TiDB Cloud for Free\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(4466002, 'dc83a601-b365-4d6a-82ad-8ba52e45dc0e', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><\/p>\n<p><!-- end HubSpot Call-to-Action Code --><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Create_a_TiDB_PoC_Cluster\"><\/span>Create a TiDB PoC Cluster<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><a href=\"https:\/\/tidbcloud.com\/\">Log in<\/a> to your TiDB Cloud account.<br \/>\nIf you do not have a TiDB Cloud account, click &#8220;Try TiDB Cloud for Free&#8221; above to sign up for an account.<\/li>\n<li>Click <strong>Create a Cluster<\/strong> to go to the plan selection page.<\/li>\n<li>Click <strong>apply for a PoC Cluster<\/strong>. It usually takes 24 ~ 48 hours to approve your request.<\/li>\n<li>On the <strong>Create a Cluster<\/strong> page, set up <strong>Cluster Name<\/strong> and <strong>Root Password<\/strong>. (In this tutorial, we will call our cluster <strong>PingExpressDB<\/strong>).<\/li>\n<li>Select the your favourate region. We recommend you to choose <strong>US West (Oregon)<\/strong>, as the pre-generated data is in a S3 bucket from this region.<\/li>\n<li>Click <strong>Next<\/strong>.<\/li>\n<li>On the second page of set one TiDB node, three TiKV nodes, and one TiFlash node.<\/li>\n<li>Click <strong>Next<\/strong>.<\/li>\n<li>On the third page, review your settings, and click <strong>Create Cluster<\/strong>.<\/li>\n<\/ol>\n<p>Your TiDB Cloud cluster will be created in approximately 5 to 10 minutes.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Connect_to_TiDB_Cloud\"><\/span>Connect to TiDB Cloud<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>Go to <a href=\"https:\/\/tidbcloud.com\/console\/clusters\">https:\/\/tidbcloud.com\/console\/clusters<\/a> and sign in to your cluster.<\/li>\n<li>On the TiDB Cloud console, in the upper right of the pane, click <strong>Connect<\/strong>.<br \/>\nThe <strong>Connect to TiDB<\/strong> dialog displays.<\/li>\n<li>Create the traffic filter for the cluster.\n<ol>\n<li>Click <strong>Allow Access from Anywhere<\/strong> in Step 1.<\/li>\n<li>Click <strong>Create Filter<\/strong>.<br \/>\n<strong>Note:<\/strong> For production environments, do not enable Allow Access from Anywhere. Note the information between the -h and -P parameters; you&#8217;ll need this for a later step. For example: <code>mysql -u root -h <strong>tidb.xxx.xxxxx.us-west-prod.aws.tidbcloud.com<\/strong> -P 4000 -p<\/code>.<\/li>\n<\/ol>\n<\/li>\n<li>Click the <strong>Web SQL Shell<\/strong> tab.<\/li>\n<li>Click Open SQL Shell and enter the password for the cluster.<\/li>\n<\/ol>\n<p>You are now able to write SQL commands.<\/p>\n<p><!--HubSpot Call-to-Action Code --><\/p>\n<p style=\"text-align: center;\"><span id=\"hs-cta-wrapper-eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\" class=\"hs-cta-node hs-cta-eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\"><!-- [if lte IE 8]>\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/4466002\/eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" id=\"hs-cta-img-eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\" class=\"hs-cta-img aligncenter\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/4466002\/eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1.png\" alt=\"Request a Demo\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(4466002, 'eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><\/p>\n<p><!-- end HubSpot Call-to-Action Code --><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Import_the_sample_data\"><\/span>Import the sample data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>Create a database.\n<pre><code>CREATE DATABASE PingExpressDB;<\/code><\/pre>\n<\/li>\n<li>Create a user of the database. The user name is <code>'PingExpress_client'<\/code>, and you should set your own password to replace <code>'&lt;pwd&gt;'<\/code>, such as <code>'123'<\/code>.\n<pre><code>CREATE USER 'PingExpress_client' IDENTIFIED BY '&lt;pwd&gt;';<\/code><\/pre>\n<\/li>\n<li>Grant all privileges to the user you just created.\n<pre><code>GRANT ALL PRIVILEGES ON PingExpressDB.* TO 'PingExpress_client';<\/code><\/pre>\n<\/li>\n<li>Navigate to the TiDB Cloud Clusters page and find your cluster.<\/li>\n<li>In the upper right corner of the pane, click <strong>Import<\/strong>.<br \/>\nThe<strong> Data Import Task<\/strong> page is displayed.<\/li>\n<li>Enter the following information, and click <strong>Import<\/strong> to import the sample data:\n<ul>\n<li>Data Source Type: Select <strong>AWS S3<\/strong><\/li>\n<li>Bucket URL: <code>s3:\/\/pingexpress-na\/backup_dumpling2\/<\/code><\/li>\n<li>Bucket Region: <strong>US West (Oregon)<\/strong><\/li>\n<li>Data Format: Select <strong>TiDB Dumpling<\/strong><\/li>\n<li>Setup Credentials: <code>arn:aws:iam::577523860935:role\/pingexpress-na-1g<\/code><\/li>\n<li>Target Database:\n<ul>\n<li>Username: root.<\/li>\n<li>Password: Enter your root password.<\/li>\n<\/ul>\n<\/li>\n<li>DB\/Tables Filter: Leave this field blank.<br \/>\nThe data import process takes about 5 minutes. When the data import progress bar shows <strong>Success<\/strong>, you have successfully imported the sample data and the database schema in your database.<br \/>\n<strong>Warning<\/strong>: Do not manipulate the data until the importing process finishes. Otherwise, the importing process fails.<\/li>\n<\/ul>\n<\/li>\n<li>Check the imported data.\n<ol>\n<li>Open <strong>Web SQL Shell<\/strong> and enter the cluster password. (Hint: On the TiDB Cloud console, in the upper right of the pane, click <strong>Connect<\/strong>, then click the <strong>Web SQL Shell<\/strong> tab.)<\/li>\n<li>Switch to PingExpressDB.\n<pre><code>USE PingExpressDB;<\/code><\/pre>\n<\/li>\n<li>Check the number of records\n<pre><code>SELECT COUNT(*) FROM packages;<\/code><\/pre>\n<p>The result should be <code>13000000<\/code>.<\/li>\n<\/ol>\n<\/li>\n<li>Create TiFlash replicas for the table packages.\n<pre><code>ALTER TABLE packages SET TiFlash REPLICA 1;<\/code><\/pre>\n<p>Wait for a few minutes and then run the following query to check whether the TiFlash node is ready.<\/p>\n<pre><code>SELECT * FROM information_schema.TIFLASH_REPLICA;<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>When the TiFlash node is ready, the values of the \u201cAVAILABLE\u201d and \u201cPROGRESS\u201d columns turn to 1.<\/p>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5362 size-full\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2022\/03\/TiFlash-status.png\" alt=\"\" width=\"1600\" height=\"183\" srcset=\"https:\/\/static.pingcap.com\/files\/2022\/03\/TiFlash-status.png 1600w, https:\/\/static.pingcap.com\/files\/2022\/03\/TiFlash-status-300x34.png 300w, https:\/\/static.pingcap.com\/files\/2022\/03\/TiFlash-status-1024x117.png 1024w, https:\/\/static.pingcap.com\/files\/2022\/03\/TiFlash-status-768x88.png 768w, https:\/\/static.pingcap.com\/files\/2022\/03\/TiFlash-status-1536x176.png 1536w, https:\/\/static.pingcap.com\/files\/2022\/03\/TiFlash-status-1440x165.png 1440w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/>\n<p><!--HubSpot Call-to-Action Code --><\/p>\n<p style=\"text-align: center;\"><span id=\"hs-cta-wrapper-dc83a601-b365-4d6a-82ad-8ba52e45dc0e\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-dc83a601-b365-4d6a-82ad-8ba52e45dc0e\" class=\"hs-cta-node hs-cta-dc83a601-b365-4d6a-82ad-8ba52e45dc0e\"><!-- [if lte IE 8]>\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/4466002\/dc83a601-b365-4d6a-82ad-8ba52e45dc0e\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" id=\"hs-cta-img-dc83a601-b365-4d6a-82ad-8ba52e45dc0e\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/4466002\/dc83a601-b365-4d6a-82ad-8ba52e45dc0e.png\" alt=\"Try TiDB Cloud for Free\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(4466002, 'dc83a601-b365-4d6a-82ad-8ba52e45dc0e', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><\/p>\n<p><!-- end HubSpot Call-to-Action Code --><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Connect_to_TiDB_Cloud_via_Metabase\"><\/span>Connect to TiDB Cloud via Metabase<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In this section, we walk you through the process of connecting to TiDB Cloud via Metabase. For more information, see <a href=\"https:\/\/en.pingcap.com\/blog\/how-to-connect-tidb-cloud-to-metabase\">How to Connect TiDB Cloud to Metabase<\/a>.<\/p>\n<ol>\n<li>Start the Metabase application and click <strong>Let\u2019s get started<\/strong>.<\/li>\n<li>Select your preferred language and click <strong>Next<\/strong>.<\/li>\n<li>Enter your information and account details in Step 2 and click <strong>Next<\/strong>.<\/li>\n<li>In the Add your data step, click the <strong>Database type<\/strong> drop down menu and select <strong>MySQL<\/strong>.<\/li>\n<li>Specify the following settings:\n<ul>\n<li>Name: <code>PingExpressDB<\/code><\/li>\n<li>Host: <code>&lt;your_tidb_cloud_ip_address_obtained_previously&gt;<\/code><\/li>\n<li>Port: <code>4000<\/code><\/li>\n<li>Database name: <code>PingExpressDB<\/code><\/li>\n<li>Username: <code>root<\/code><\/li>\n<li>Password: <code>&lt;password_of_your_tidb_cluster&gt;<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Scroll down to the bottom and click <strong>Next<\/strong>.<\/li>\n<li>For the Usage data preference step, change your preference if needed and click <strong>Next<\/strong>.<\/li>\n<li>Click <strong>Take me to Metabase<\/strong>.<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Build_your_dashboards_in_Metabase\"><\/span>Build your dashboards in Metabase<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This section shows you how to build a Metabase dashboard. The dashboard contains five figures (or \u201cquestions\u201d in Metabase terminology). We include the instructions to build the whole dashboard. However, building the first three of them is enough for the purpose of this tutorial. The last two figures are optional. The following figure shows the real-time Metabase dashboard for PingExpress_DemoCorp.<\/p>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5363 size-full\" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2022\/03\/Metabase-dashboard-overview.png\" alt=\"\" width=\"1600\" height=\"676\" srcset=\"https:\/\/static.pingcap.com\/files\/2022\/03\/Metabase-dashboard-overview.png 1600w, https:\/\/static.pingcap.com\/files\/2022\/03\/Metabase-dashboard-overview-300x127.png 300w, https:\/\/static.pingcap.com\/files\/2022\/03\/Metabase-dashboard-overview-1024x433.png 1024w, https:\/\/static.pingcap.com\/files\/2022\/03\/Metabase-dashboard-overview-768x324.png 768w, https:\/\/static.pingcap.com\/files\/2022\/03\/Metabase-dashboard-overview-1536x649.png 1536w, https:\/\/static.pingcap.com\/files\/2022\/03\/Metabase-dashboard-overview-1440x608.png 1440w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/>\n<ol>\n<li>Create a dashboard.\n<ol>\n<li>In the top right corner of the dashboard, click the <strong>+<\/strong> sign, and then choose <strong>New Dashboard<\/strong>.<\/li>\n<li>Enter the name as <strong>PingExpress_dashboard<\/strong>.<\/li>\n<li>Click <strong>Create<\/strong>.<\/li>\n<\/ol>\n<\/li>\n<li>Add a question.\n<ol>\n<li>In the top right corner, click <strong>Ask a question<\/strong> on the top right corner, and then choose <strong>Native query<\/strong>.<\/li>\n<li>Select <strong>PingExpressDB<\/strong> as the database.<\/li>\n<li>Display the total number of packages delivered. Enter the following query and click the right side of the screen to run it:\n<pre><code>SELECT COUNT(*) FROM packages WHERE transaction_kind=\"4_pkg_out\";<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<li>Save the question.\n<ol>\n<li>In the upper right corner, click <strong>Save<\/strong>.<\/li>\n<li>Enter the name <strong>Total packages delivered<\/strong>.<\/li>\n<li>When being asked if you would like to add this question to the dashboard, click <strong>Yes please!<\/strong>, and choose <strong>PingExpress_dashboard<\/strong>.<br \/>\nThe result will now appear on the dashboard.<\/li>\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol>\n<\/li>\n<li>Repeat steps 2 and 3 for the second question, \u201cNumber of packages on the way.\u201d This is the query to use:\n<pre><code>SELECT COUNT(*) FROM packages WHERE transaction_kind != \"4_pkg_out\";<\/code><\/pre>\n<\/li>\n<li>Visualize the <strong>Number of packages in process in each state<\/strong>.\n<ol>\n<li>Repeat step 3 and use the following query instead.\n<pre><code>SELECT start_state, COUNT(package_id)<\/code> <code>FROM packages <\/code> <code>WHERE transaction_kind = \"1_pkg_in\"<\/code> <code>GROUP BY start_state<\/code> <code>UNION<\/code> <code>SELECT destination_state, COUNT(package_id)<\/code> <code>FROM packages <\/code> <code>WHERE transaction_kind = \"3_des\"<\/code> <code>GROUP BY destination_state<\/code><\/pre>\n<\/li>\n<li>After getting the result, click the <strong>Visualization<\/strong> button, and then choose <strong>Map<\/strong>. For the map options:\n<ul>\n<li>Map Type: Region map<\/li>\n<li>Region Map: United States<br \/>\nLeave everything else as default.<\/li>\n<\/ul>\n<\/li>\n<li>Repeat step 4 and add this question to the dashboard.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5364 \" src=\"https:\/\/en.pingcap.com\/wp-content\/uploads\/2022\/03\/Add-questions-to-dashboard.png\" alt=\"\" width=\"586\" height=\"459\" srcset=\"https:\/\/static.pingcap.com\/files\/2022\/03\/Add-questions-to-dashboard.png 1394w, https:\/\/static.pingcap.com\/files\/2022\/03\/Add-questions-to-dashboard-300x235.png 300w, https:\/\/static.pingcap.com\/files\/2022\/03\/Add-questions-to-dashboard-1024x802.png 1024w, https:\/\/static.pingcap.com\/files\/2022\/03\/Add-questions-to-dashboard-768x602.png 768w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/li>\n<\/ol>\n<\/li>\n<li>(Optional) Repeat the previous steps to add two more queries:\n<ul>\n<li>Number of packages in each stage (pie chart):\n<pre><code>SELECT transaction_kind, count(*) <\/code> <code>FROM packages <\/code> <code>WHERE transaction_kind != \"4_pkg_out\"<\/code> <code>GROUP BY transaction_kind<\/code><\/pre>\n<\/li>\n<li>Number of new packages per day (line chart):\n<pre><code>SELECT DATE(start_time), count(*) <\/code> <code>FROM packages <\/code> <code>WHERE transaction_kind = \"1_pkg_in\"<\/code> <code>AND start_time &gt; DATE(NOW()) - INTERVAL 30 DAY<\/code> <code>GROUP BY DATE(start_time)<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><!--HubSpot Call-to-Action Code --><\/p>\n<p style=\"text-align: center;\"><span id=\"hs-cta-wrapper-eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\" class=\"hs-cta-node hs-cta-eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\"><!-- [if lte IE 8]>\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/4466002\/eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" id=\"hs-cta-img-eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1\" class=\"hs-cta-img aligncenter\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/4466002\/eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1.png\" alt=\"Request a Demo\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(4466002, 'eadb4c3a-ea3a-4f3d-82d1-ea29facc1db1', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><\/p>\n<p><!-- end HubSpot Call-to-Action Code --><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Execute_the_program\"><\/span>Execute the program<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>Clone the program to your local machine, or any virtual machines provided by your cloud vendor.\n<pre><code>git clone https:\/\/github.com\/pingcap\/education.git<\/code><\/pre>\n<\/li>\n<li>Go to the directory for PingExpress_DemoCorp.\n<pre><code>cd PingExpress_DemoCorp<\/code><\/pre>\n<\/li>\n<li>Update the connection string in the main method of <code>PingExpress_client.py<\/code>. The connection string is in the format:\n<pre><code>tidb:\/\/&lt;client_name&gt;:&lt;pwd&gt;@xxx.xxxx.xxxx.xxxx.prod.aws.tidbcloud.com:4000\/&lt;DB_name&gt;<\/code><\/pre>\n<p>For example, if the client name is <code>PingExpress_client<\/code>,\u00a0 the password is <code>123<\/code>, and the database name is <code>PingExpressDB<\/code>, the connection string is:<\/p>\n<pre><code>tidb:\/\/PingExpress_client:123@xxx.xxxx.xxxx.xxxx.prod.aws.tidbcloud.com:4000\/PingExpressDB<\/code><\/pre>\n<p>You can find the host address for TiDB Cloud in <strong>Connect to TiDB<\/strong> &#8211; <strong>Standard Connection<\/strong> &#8211; <strong>Step 2<\/strong> in the TiDB Console, in the format: <code>xxx.xxxx.xxxx.xxxx.prod.aws.tidbcloud.com<\/code>.<\/li>\n<li>Update the timestamp to match the current date:\n<pre><code>python3 PingExpress_client.py --update_timestamp<\/code><\/pre>\n<p>It may take 5 ~ 10 minutes.<\/li>\n<li>Execute the program:\n<pre><code>python3 PingExpress_client.py --execute --clients 50 --duration 100<\/code><\/pre>\n<p>The command assumes there will be 50 clients, and the program runs for 200 seconds.<\/li>\n<li>Observe the results. When the program starts running, you can navigate to the Metabase dashboard and observe the dashboard being updated in real time.<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Want_to_learn_more\"><\/span>Want to learn more?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Ready to <a href=\"http:\/\/tidbcloud.com\/free-trial\/\" target=\"_blank\" rel=\"noopener\">give TiDB Cloud a try<\/a>? TiDB Cloud <a href=\"https:\/\/pingcap.com\/blog\/tidb-cloud-introduces-developer-tier\">Developer Tier<\/a> is now available! It lets you run a TiDB cluster for free for one year on Amazon Web Services. Make sure to follow us on <a href=\"https:\/\/twitter.com\/PingCAP\">Twitter<\/a> to stay updated on TiDB Cloud news!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With more people shopping online due to the pandemic, PingExpress_DemoCorp\u2019s business has scaled rapidly. Real-time tracking, status updates, and a detailed dashboard are very important to their business. In this tutorial, you will build a prototype for PingExpress_DemoCorp\u2019s real-time analytics dashboard that runs on TiDB Cloud Developer Tier.<\/p>","protected":false},"author":171,"featured_media":4590,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[13],"tags":[153,11,31,29],"class_list":["post-5352","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-product","tag-how-to","tag-real-time-analytics","tag-tidb-cloud","tag-tutorial"],"acf":[],"featured_image_src":"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","author_info":{"display_name":"Chenhao Huang","author_link":"https:\/\/www.pingcap.com\/ko\/blog\/author\/chenhao-huang\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Build a Real-time Analytics Application with TiDB Cloud | TiDB<\/title>\n<meta name=\"description\" content=\"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post &quot;Build a Real-time Analytics Application with TiDB Cloud&quot; here.\" \/>\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\/build-a-real-time-analytics-application-with-tidb-cloud\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build a Real-time Analytics Application with TiDB Cloud | TiDB\" \/>\n<meta property=\"og:description\" content=\"With more people shopping online due to the pandemic, PingExpress_DemoCorp\u2019s business has scaled rapidly. Real-time tracking, status updates, and a detailed dashboard are very important to their business. In this tutorial, you will build a prototype for PingExpress_DemoCorp\u2019s real-time analytics dashboard that runs on TiDB Cloud Developer Tier.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/\" \/>\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-03-03T17:37:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-07T04:47:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1499\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Chenhao Huang\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:description\" content=\"With more people shopping online due to the pandemic, PingExpress_DemoCorp\u2019s business has scaled rapidly. Real-time tracking, status updates, and a detailed dashboard are very important to their business. In this tutorial, you will build a prototype for PingExpress_DemoCorp\u2019s real-time analytics dashboard that runs on TiDB Cloud Developer Tier.\" \/>\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=\"Chenhao Huang\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/\"},\"author\":{\"name\":\"Chenhao Huang\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/a00531795b5242fa32aa210fb66fc890\"},\"headline\":\"Build a Real-time Analytics Application with TiDB Cloud\",\"datePublished\":\"2022-03-03T17:37:04+00:00\",\"dateModified\":\"2024-06-07T04:47:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/\"},\"wordCount\":1726,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\",\"keywords\":[\"How-to\",\"Real-time analytics\",\"TiDB Cloud\",\"Tutorial\"],\"articleSection\":[\"Product\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/\",\"url\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/\",\"name\":\"Build a Real-time Analytics Application with TiDB Cloud | TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\",\"datePublished\":\"2022-03-03T17:37:04+00:00\",\"dateModified\":\"2024-06-07T04:47:54+00:00\",\"description\":\"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post \\\"Build a Real-time Analytics Application with TiDB Cloud\\\" here.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#primaryimage\",\"url\":\"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\",\"width\":1499,\"height\":500},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build a Real-time Analytics Application with TiDB Cloud\"}]},{\"@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\/a00531795b5242fa32aa210fb66fc890\",\"name\":\"Chenhao Huang\",\"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\":\"Chenhao Huang\"},\"description\":\"Developer Relations\",\"url\":\"https:\/\/www.pingcap.com\/ko\/blog\/author\/chenhao-huang\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Build a Real-time Analytics Application with TiDB Cloud | TiDB","description":"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post \"Build a Real-time Analytics Application with TiDB Cloud\" here.","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\/build-a-real-time-analytics-application-with-tidb-cloud\/","og_locale":"ko_KR","og_type":"article","og_title":"Build a Real-time Analytics Application with TiDB Cloud | TiDB","og_description":"With more people shopping online due to the pandemic, PingExpress_DemoCorp\u2019s business has scaled rapidly. Real-time tracking, status updates, and a detailed dashboard are very important to their business. In this tutorial, you will build a prototype for PingExpress_DemoCorp\u2019s real-time analytics dashboard that runs on TiDB Cloud Developer Tier.","og_url":"https:\/\/www.pingcap.com\/ko\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_published_time":"2022-03-03T17:37:04+00:00","article_modified_time":"2024-06-07T04:47:54+00:00","og_image":[{"width":1499,"height":500,"url":"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","type":"image\/jpeg"}],"author":"Chenhao Huang","twitter_card":"summary_large_image","twitter_description":"With more people shopping online due to the pandemic, PingExpress_DemoCorp\u2019s business has scaled rapidly. Real-time tracking, status updates, and a detailed dashboard are very important to their business. In this tutorial, you will build a prototype for PingExpress_DemoCorp\u2019s real-time analytics dashboard that runs on TiDB Cloud Developer Tier.","twitter_creator":"@PingCAP","twitter_site":"@PingCAP","twitter_misc":{"Written by":"Chenhao Huang","Est. reading time":"10\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#article","isPartOf":{"@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/"},"author":{"name":"Chenhao Huang","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/a00531795b5242fa32aa210fb66fc890"},"headline":"Build a Real-time Analytics Application with TiDB Cloud","datePublished":"2022-03-03T17:37:04+00:00","dateModified":"2024-06-07T04:47:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/"},"wordCount":1726,"commentCount":0,"publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","keywords":["How-to","Real-time analytics","TiDB Cloud","Tutorial"],"articleSection":["Product"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/","url":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/","name":"Build a Real-time Analytics Application with TiDB Cloud | TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#primaryimage"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","datePublished":"2022-03-03T17:37:04+00:00","dateModified":"2024-06-07T04:47:54+00:00","description":"Learn about the benefits of TiDB and the TiDB Cloud solutions from PingCAP. Read our latest post \"Build a Real-time Analytics Application with TiDB Cloud\" here.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#primaryimage","url":"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","contentUrl":"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg","width":1499,"height":500},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Build a Real-time Analytics Application with TiDB Cloud"}]},{"@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\/a00531795b5242fa32aa210fb66fc890","name":"Chenhao Huang","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":"Chenhao Huang"},"description":"Developer Relations","url":"https:\/\/www.pingcap.com\/ko\/blog\/author\/chenhao-huang\/"}]}},"grav_blocks":false,"card_markup":"<a class=\"card-resource bg-white\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/build-a-real-time-analytics-application-with-tidb-cloud\/\"><div class=\"card-resource__image-container\"><img class=\"card-resource__image\" alt=\"TiDB Cloud Demo App\" src=\"https:\/\/static.pingcap.com\/files\/2022\/01\/Getting-started-with-TiDB-Cloud-using-Python-and-Flask.jpg\" loading=\"lazy\" width=1499 height=500 \/><\/div><div class=\"card-resource__content-container\"><div class=\"card-resource__content-head\"><div class=\"card-resource__category\">Product<\/div><\/div><h5 class=\"card-resource__title\">Build a Real-time Analytics Application with TiDB Cloud<\/h5><\/div><\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/5352","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\/171"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/comments?post=5352"}],"version-history":[{"count":48,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/5352\/revisions"}],"predecessor-version":[{"id":17560,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/5352\/revisions\/17560"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media\/4590"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=5352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/categories?post=5352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/tags?post=5352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}