Upgrade to Pro — share decks privately, control downloads, hide ads and more …

サーバーを超えて: 開発者のために作られたTiDB ServerlessとChat2Query

PingCAP-Japan
September 29, 2023

サーバーを超えて: 開発者のために作られたTiDB ServerlessとChat2Query

イベント開催日:2023年09月23日

サーバーレス・データベースの未来は、クラウドとAIテクノロジーの融合を受け入れる態勢が整いつつあります。デジタル時代へのさらなる進展に伴い、企業や開発者はデータを管理するために、より効率的でスケーラブルかつインテリジェントなソリューションを常に求めています。サーバーレスデータベースは、従来のデータベースシステムに代わる強力な選択肢としてすでに勢いを増しており、その可能性は今後数年でさらに高まることが予想されます。

アーカイブ動画:https://youtu.be/_BsyUburQaI

※このスライドは英語資料になります。

PingCAP-Japan

September 29, 2023
Tweet

More Decks by PingCAP-Japan

Other Decks in Technology

Transcript

  1. Momento Confidential Agenda • Brief introduction of PingCAP & TiDB

    • The journey of building TiDB Serverless • Example: AI powered OSSInsight.io on TiDB Serverless • TiDB Serverless key capabilities • Developer resources
  2. Momento Confidential Silicon Valley Amsterdam Beijing Tokyo The creators of

    TiDB Founded in 2015 Based in Sunnyvale, CA More than 550+ employees globally Over $600M in total funding Mission: Empower engineers and enterprises to innovate with speed, agility, and scale Singapore
  3. Momento Confidential The most advanced, open source, distributed SQL database

    for modern applications. Scalable. Versatile. Titanium (Ti) Reliable. 35K+ GitHub Stars 800+ Contributors Trusted By FlipKart Pinterest
  4. Momento Confidential “How about offering a free database for every

    developer?” Is it possible? Is it affordable? Let's do some math
  5. Momento Confidential 26.9 million clusters Even we provide a tiny

    tidb (aws t2.nano) cluster. For each year it will cost: 26.9 million * 4 vCPUs (3 storage node+ 1 compute node + 1 placement driver) * (0.003 * 365 * 24) = $2.83 billion / year Really? what a shocking number!
  6. Momento Confidential ELB ~ 30$ for each cluster/year, we need

    another $807 million. We need total $3.6 billion/year. Oh, I forget to mention ELB, storage, HA and more…
  7. Momento Confidential ELB ~ 30$ for each cluster/year, we need

    another $807 million. We need total $3.6 billion/year. Let’s forget about the cost of the storage, monitoring system and so on, that’s too scary to calculate. What’s more, AI transforms individuals into developers. The number could be 10x larger in the next few years. Oh, I forget to mention ELB, storage, HA and more…
  8. Momento Confidential Why Not Shut Down the Cluster When It's

    Not in Use? Well, let’s try one more step
  9. Momento Confidential To Make it possible • Reuse as many

    spot instances as we can. ~70% off discount • 80/20 theory. 80% of the cluster are not active. 80% off Quick math in your mind: $3.6 billion/year * 30% * 20% One more thing
  10. Momento Confidential Load balancer Isolated SQL Layer Shared Disk Cache

    Layer Object storage Gateway Gateway Row Engine Row Engine Shared Storage( Amazon S3, Google Cloud Storage…) Resource Pool Virtual Cluster - Tenant n Micro Services Compression Analyze DDL Virtual Cluster - Tenant 1
  11. Momento Confidential Tell me more about • lightweight compute ◦

    Read/Write a few records or indexes ◦ Small OLTP transactions • heavy compute ◦ Adding index ◦ Change/Remove a column from a table ◦ Collect table statistics(Analyze table) ◦ Scan a whole table or lots of records ◦ Compression ◦ And more
  12. Momento Confidential Tell me more about • lightweight compute ◦

    Read/Write a few records or indexes ◦ Small OLTP transactions (e.g. primary key lookup) • heavy compute (offload to dynamic micro services) ◦ Adding index ◦ Change/Remove a column from a table ◦ Collect table statistics(Analyze table) ◦ Scan a whole table or lots of records ◦ Compression ◦ And more
  13. Momento Confidential Results of Lightweight compute • 2x better cpu

    utilization ( Saved 50% money, again! ) • Lower latency for lightweight compute, less spike Now it’s $100 million per year. Wow, it’s close to $3.7 per developer per year.
  14. Momento Confidential It is possible! We made it. Wow, It’s

    hard to believe. Innovation changed everything
  15. Momento Confidential Separation of compute and compute • Better user

    experience ( after offload heavy compute) ◦ 100x Faster adding index (WIP) ◦ Fast table statistics collection (Done. leverage the distributed architecture) ◦ Backup large clusters in seconds (Done. e.g., hundreds of TBs, with the help of S3) • Higher Durability & Availability ◦ Leverage the durability of S3 ◦ Recover from a failed server faster by loading data from S3 concurrently
  16. Momento Confidential TiDB Serverless Architecture Offload Compute : Virtual Cluster

    - Tenant 1 SQL SQL Storage S3 / Blob / Cloud Storage Virtual Cluster - Tenant n SQL SQL DDL worker MPP Compute service Data Ingestion service Storage Storage Isolated SQL Layer (For OLTP) Storage Cache Layer (For OLTP) Shared Storage Pool …
  17. Momento Confidential Example: OSSInsight.io https://github.com/pingcap/ossinsight OSSInsight is a powerful open-source

    tool that gives detailed and up-to-date information about the open source world by analyzing over 6 billion GitHub events. OSS Insight's Data Explorer makes exploring GitHub data easy. Simply ask a question in natural language, and Data Explorer will create a SQL, execute the SQL, and show you the results visually.
  18. Momento Confidential OSSInsight on TiDB Serverless Data Volume - 12

    TBs, over 6 Billion rows of data - all growing in real-time. Random Mixed Workloads - Serving online transactions plus analytical queries generated by AI Unpredictable Traffic Spikes - Featured on HackerNews with 7x traffic in one day. 72.7% Cost Reduction Zero Manual Intervention During Spikes 5X Development Efficiency for LLM Data Apps https://github.com/pingcap/ossinsight
  19. Momento Confidential TiDB Serverless Lalency Time Workload Peak 100 Time

    PVs Automatically scale in and out to meet workload demands in real-time Resource Pool Real-time elasticity
  20. Momento Confidential Sysbench Scale out from 0 to ~1.3M QPS

    After the peak, scale back to zero. Within 30 mins Without any configuration or tuning 🎉
  21. Momento Confidential 12,491ms vs 187.5ms 67x Faster with HTAP Versatile

    to run Hybrid Transactional and Analytical (HTAP) workloads with smart optimizer and two distinct storage layers
  22. Momento Confidential Pay as you go Start free, then only

    pay for the storage and data processing you use - and never overspend with a spending limit
  23. Momento Confidential AI-Assisted Enhancements With OpenAI powered features like Chat2Query

    and TiDB-Bot, it’s designed to boost developer productivity
  24. Momento Confidential Developer Resources TiDB Cloud CLI VS Code @TiDB_Developer

    Partner integrations to meet where developers are Comprehensive docs to learn about TiDB Cloud Resource hub and online courses for developers
  25. Momento Confidential AJU Center of Independent Living & TiDB Serverless

    AJU migrated some websites below (built with Wordpress) to TiDB Serverless: 1) こころの絆創膏    2) ゲートキーパー研修    3) なごや食育ひろば (coming soon) AJU Center for Independent Living is an association run by colleagues of wheelchair users in Aichi Prefecture.