SlideShare a Scribd company logo
Introducing TiDB
(For those coming from MySQL..)
Make Data Creative
Morgan Tocker (@pingcap; @morgo)
October, 2018
● History and Community
● Technical Walkthrough
● Use Case with Mobike
● Live Demo: TiDB on GKE
● MySQL Compatibility
● Q&A
Agenda
● Sr Product / Community Manager
● ~15+ years MySQL Experience
○ MySQL AB, Sun Microsystems, Percona, Oracle
● Previously Product Manager for MySQL Server
A Little About Me...
A Little About PingCAP...
● Founded in April 2015 by 3 infrastructure engineers
● Offices in China and North America
● Remote Friendly!
○ I work from here ➡
Recent News
Recent News
Our Product is The TiDB Platform
● TiDB platform: (Ti = Titanium)
○ TiDB (stateless SQL layer compatible with MySQL)
○ TiKV (distributed transactional key-value store)
○ TiSpark (Apache Spark plug-in on top of TiKV)
● Open source from Day 1
○ GA 1.0: October 2017
○ GA 2.0: April 2018
TiDB is a NewSQL Database
● 1960s: First Gen Databases
● 1970s: Relational Model + SQL
● 2000s: Sharding + Memcached
● 2010s: NoSQL
● 2010s+: NewSQL
Inspired by Google Spanner / F1
MySQL Compatible
● Hybrid OLTP & OLAP (Minimize ETL)
● Horizontal Scalability
● MySQL Compatible
● Distributed Transaction (ACID Compliant)
● High Availability
● Cloud-Native
TiDB Core Features
Architecture
SparkSQL
TiDB
TiDB
Worker
Spark
Driver
TiKV Cluster (Storage)
Metadata
TiKV TiKV
TiKV
Data location
Job
TiSpark
DistSQL API
TiKV
TiDB
TSO/Data location
Worker
Worker
Spark Cluster
TiDB Cluster
TiDB
DistSQL API
PD
PD Cluster
TiKV TiKV
TiDB
KV API
MySQL
MySQL
PD
PD
2018 PingCAP
Stars
● TiDB: 15,000+
● TiKV: 3700+
Contributors
● TiDB: 200+
● TiKV: 100+
Community
Early Sign-up: https://www.pingcap.com/tidb-academy/
Sneak Peek!
TiDB Platform Architecture
Platform Architecture
TiDB
TiDB
Worker
Spark
Driver
TiKV Cluster (Storage)
Metadata
TiKV TiKV
TiKV
Data location
Job
TiSpark
DistSQL API
TiKV
TiDB
TSO/Data location
Worker
Worker
Spark Cluster
TiDB Cluster
TiDB
DistSQL API
PD
PD Cluster
TiKV TiKV
TiDB
KV API
MySQL
MySQL
SparkSQL
PD
PD
SparkSQL
TiKV: The Foundation [in CNCF]
RocksDB
Raft
Transaction
Txn KV API
Coprocessor
API
RocksDB
Raft
Transaction
Txn KV API
Coprocessor
API
RocksDB
Raft
Transaction
Txn KV API
Coprocessor
API
Raft
Group
Client
gRPC
TiKV Instance TiKV Instance TiKV Instance
gRPC gRPC
PD Cluster
TiDB: OLTP + Ad Hoc OLAP
Node1 Node2 Node3 Node4
MySQL Network Protocol
SQL Parser
Cost-based Optimizer
Distributed Executor (Coprocessor)
ODBC/JDBC MySQL Client
Any ORM which
supports MySQL
TiDB
TiKV
ID Name Email
1 Edward h@pingcap.com
2 Tom tom@pingcap.com
...
user/1 Edward,h@pingcap.com
user/2 Tom,tom@pingcap.com
...
In TiKV -∞
+∞
(-∞, +∞)
Sorted map
“User” Table
TiDB: Relational -> KV
Some region...
SQL -> Parser -> Coprocessor
TiSpark: Complex OLAP
Spark ExecSpark Exec
Spark Driver
Spark Exec
TiKV TiKV TiKV TiKV
TiSpark
TiSpark TiSpark TiSpark
TiKV
Placement
Driver (PD)
gRPC
Distributed Storage Layer
gRPC
retrieve data location
retrieve real data from TiKV
Who’s Using TiDB?
2018 PingCAP
Who’s using TiDB?
300+
Companies
2018 PingCAP
1. MySQL Scalability
2. Hybrid OLTP/OLAP Architecture
3. Unifying Data Storage/Management
Three Big Use Cases
Mobike + TiDB
● 200 million users
● 200 cities
● 9 milllion smart bikes
● ~30 TB / day
● Locking and unlocking of smart bikes generate massive data
● Smooth experience is key to user retention
● TiDB supports this system by alerting administrators when
success rate of locking/unlocking drops, within minutes
● Quickly find malfunctioning bikes
Scenario #1: Locking/Unlocking
● Synchronize TiDB with MySQL
instances using Syncer (proprietary
tool)
● TiDB + TiSpark empower real-time
analysis with horizontal scalability
● No need for Hadoop + Hive
Scenario #2: Real-Time Analysis
● An innovative loyalty program that must
be on 24 x 7 x 365
● TiDB handles:
○ High-concurrency for peak or promotional season
○ Permanent storage
○ Horizontal scalability
● No interruption as business evolves
Scenario #3: Mobike Store
TiDB on GKE Demo
MySQL Compatibility
● Compatible with MySQL 5.7
○ Joins, Subqueries, DML, DDL etc.
● On the roadmap:
○ Views, Window Functions, GIS
● Missing:
○ Stored Procedures, Triggers, Events
Summary
pingcap.com
/docs/sql/mysql-compatibility/
● Some features work differently
○ Auto Increment
○ Optimistic Locking
● TiDB works better with smaller
transactions
○ Recommended to batch updates, deletes,
inserts to 5000 rows
Nuanced
Thank You!
Twitter: @PingCAP; @morgo
https://github.com/pingcap
(Give us a Watch/Star!)
Morgan Tocker
(morgan@pingcap.com)
Early Sign-up:
www.pingcap.com/tidb-academy/
● Hash Join (fastest; if table <= 50 million rows)
● Sort Merge Join (join on indexed column or ordered data
source)
● Index Lookup Join (join on indexed column; ideally after filter,
result < 10,000 rows)
Chosen based on Cost-based Optimizer:
Join Support
Network cost Memory cost CPU cost
Index Structure
Row:
Key: tablePrefix_rowPrefix_tableID_rowID (IDs are assigned by TiDB, all int64)
Value: [col1, col2, col3, col4]
Index:
Key: tablePrefix_idxPrefix_tableID_indexID_ColumnsValue_rowID
Value: [null]
Keys are ordered by byte array in TiKV, so can support SCAN
Every key is appended a timestamp, issued by Placement Driver
● Complex calculation pushdown
● Key-range pruning
● Index support:
○ Clustered index / non-clustered index
○ Index-only query optimization
● Cost-based optimization:
○ Stats gathered from TiDB in histogram
TiSpark: Features
PD: Dynamic Split and Merge
Region A
Region A
Region B
Region A
Region A
Region B
Split
Region A
Region A
Region B
Merge
TiKV_1 TiKV_2 TiKV_2TiKV_1
PD: Hotspot Removal
*Region A*
*Region B*
Region A
Region B
Workload
*Region A*
Region B
Region A
*Region B*
Workload
Workload
Hotspot Schedule
(Raft leader transfer)
TiKV_1 TiKV_2
TiKV_2TiKV_1
Geo-Replication + Data Location
*Region A*
Region B
Region A
Region B
Seattle_1 Seattle_2
Region A
*Region B*
New York_1
*Region A*
Region B
Region A
*Region B*
Seattle_2Seattle_1
Region A
Region B
New York_1
● Timestamp Oracle service (from Google’s Percolator paper)
● 2-Phase commit protocol (2PC)
● Problem: Single point of failure
● Solution: Placement Driver HA cluster
○ Replicated using Raft
Transaction Model
● Formal proof using TLA+
○ a formal specification and verification language to reason about and prove
aspects of complex systems
● Raft
● TSO/Percolator
● 2PC
● See details: https://github.com/pingcap/tla-plus
Guaranteeing Correctness

More Related Content

PDF
TiDB Introduction
PDF
Introducing TiDB - Percona Live Frankfurt
PDF
TiDB Introduction - Boston MySQL Meetup Group
PDF
Introducing TiDB [Delivered: 09/27/18 at NYC SQL Meetup]
PDF
FOSDEM MySQL and Friends Devroom
PDF
"Smooth Operator" [Bay Area NewSQL meetup]
PDF
Introducing TiDB @ SF DevOps Meetup
PDF
TiDB DevCon 2020 Opening Keynote
TiDB Introduction
Introducing TiDB - Percona Live Frankfurt
TiDB Introduction - Boston MySQL Meetup Group
Introducing TiDB [Delivered: 09/27/18 at NYC SQL Meetup]
FOSDEM MySQL and Friends Devroom
"Smooth Operator" [Bay Area NewSQL meetup]
Introducing TiDB @ SF DevOps Meetup
TiDB DevCon 2020 Opening Keynote

What's hot (20)

PDF
TiDB for Big Data
PDF
Introducing TiDB Operator [Cologne, Germany]
PDF
TiDB as an HTAP Database
PDF
A Brief Introduction of TiDB (Percona Live)
PDF
Presto talk @ Global AI conference 2018 Boston
PDF
Rust in TiKV
PDF
Scale Relational Database with NewSQL
PPTX
Building a transactional key-value store that scales to 100+ nodes (percona l...
PDF
Presto Summit 2018 - 09 - Netflix Iceberg
PDF
How to build TiDB
PPTX
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
KEY
MongoDB SF Ruby
PDF
Unifying Frontend and Backend Development with Scala - ScalaCon 2021
PDF
TiDB at PayPay
PDF
Introducing Scylla Open Source 4.0
PDF
Presto Summit 2018 - 08 - FINRA
PDF
Scylla Summit 2022: Building Zeotap's Privacy Compliant Customer Data Platfor...
PDF
Introducing TiDB Operator
PPTX
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
PDF
Micheal Pershyn "Coljure 4 Big Data"
TiDB for Big Data
Introducing TiDB Operator [Cologne, Germany]
TiDB as an HTAP Database
A Brief Introduction of TiDB (Percona Live)
Presto talk @ Global AI conference 2018 Boston
Rust in TiKV
Scale Relational Database with NewSQL
Building a transactional key-value store that scales to 100+ nodes (percona l...
Presto Summit 2018 - 09 - Netflix Iceberg
How to build TiDB
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
MongoDB SF Ruby
Unifying Frontend and Backend Development with Scala - ScalaCon 2021
TiDB at PayPay
Introducing Scylla Open Source 4.0
Presto Summit 2018 - 08 - FINRA
Scylla Summit 2022: Building Zeotap's Privacy Compliant Customer Data Platfor...
Introducing TiDB Operator
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Micheal Pershyn "Coljure 4 Big Data"
Ad

Similar to TiDB Introduction - San Francisco MySQL Meetup (20)

PDF
Introducing TiDB [Delivered: 09/25/18 at Portland Cloud Native Meetup]
PDF
Presentation at SF Kubernetes Meetup (10/30/18), Introducing TiDB/TiKV
PDF
TiDB + Mobike by Kevin Xu (@kevinsxu)
PDF
Keynote -- Percona Live Europe 2018
PDF
When Apache Spark Meets TiDB with Xiaoyu Ma
PDF
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
PDF
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
PDF
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
PDF
TiDB vs Aurora.pdf
PDF
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
PDF
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
PDF
Purpose-built NoSQL Database for IoT by Basavaraj Soppannavar
PPTX
Oracle Database 12c - Features for Big Data
PDF
Where Does Big Data Meet Big Database - QCon 2012
PDF
"Hadoop and Data Warehouse (DWH) – Friends, Enemies or Profiteers? What about...
PDF
SQLite Dynamic Data in Titanium
PDF
Introduction to Apache Tajo: Data Warehouse for Big Data
PDF
Demystifying Real time Analytics with TiDB
PDF
Tutorial On Database Management System
PDF
Scaling TiDB for Large-Scale Application
Introducing TiDB [Delivered: 09/25/18 at Portland Cloud Native Meetup]
Presentation at SF Kubernetes Meetup (10/30/18), Introducing TiDB/TiKV
TiDB + Mobike by Kevin Xu (@kevinsxu)
Keynote -- Percona Live Europe 2018
When Apache Spark Meets TiDB with Xiaoyu Ma
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
TiDB vs Aurora.pdf
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
Purpose-built NoSQL Database for IoT by Basavaraj Soppannavar
Oracle Database 12c - Features for Big Data
Where Does Big Data Meet Big Database - QCon 2012
"Hadoop and Data Warehouse (DWH) – Friends, Enemies or Profiteers? What about...
SQLite Dynamic Data in Titanium
Introduction to Apache Tajo: Data Warehouse for Big Data
Demystifying Real time Analytics with TiDB
Tutorial On Database Management System
Scaling TiDB for Large-Scale Application
Ad

More from Morgan Tocker (20)

PDF
Introducing Spirit - Online Schema Change
PDF
MySQL Usability Guidelines
PDF
My First 90 days with Vitess
PDF
MySQL 8.0 Optimizer Guide
PDF
MySQL Server Defaults
PDF
MySQL Cloud Service Deep Dive
PDF
MySQL 5.7 + JSON
PDF
Using MySQL in Automated Testing
PDF
Upcoming changes in MySQL 5.7
PDF
MySQL Query Optimization
PDF
MySQL Performance Metrics that Matter
PDF
MySQL For Linux Sysadmins
PDF
MySQL: From Single Instance to Big Data
PDF
MySQL NoSQL APIs
PDF
MySQL 5.7: Core Server Changes
PDF
MySQL 5.6 - Operations and Diagnostics Improvements
PDF
Locking and Concurrency Control
PDF
The InnoDB Storage Engine for MySQL
PDF
My sql 5.7-upcoming-changes-v2
PDF
Mysql 57-upcoming-changes
Introducing Spirit - Online Schema Change
MySQL Usability Guidelines
My First 90 days with Vitess
MySQL 8.0 Optimizer Guide
MySQL Server Defaults
MySQL Cloud Service Deep Dive
MySQL 5.7 + JSON
Using MySQL in Automated Testing
Upcoming changes in MySQL 5.7
MySQL Query Optimization
MySQL Performance Metrics that Matter
MySQL For Linux Sysadmins
MySQL: From Single Instance to Big Data
MySQL NoSQL APIs
MySQL 5.7: Core Server Changes
MySQL 5.6 - Operations and Diagnostics Improvements
Locking and Concurrency Control
The InnoDB Storage Engine for MySQL
My sql 5.7-upcoming-changes-v2
Mysql 57-upcoming-changes

Recently uploaded (20)

PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Introduction to Artificial Intelligence
PPTX
ai tools demonstartion for schools and inter college
PPTX
Essential Infomation Tech presentation.pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
2025 Textile ERP Trends: SAP, Odoo & Oracle
Operating system designcfffgfgggggggvggggggggg
Odoo Companies in India – Driving Business Transformation.pdf
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Design an Analysis of Algorithms II-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How Creative Agencies Leverage Project Management Software.pdf
CHAPTER 2 - PM Management and IT Context
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Understanding Forklifts - TECH EHS Solution
Introduction to Artificial Intelligence
ai tools demonstartion for schools and inter college
Essential Infomation Tech presentation.pptx
PTS Company Brochure 2025 (1).pdf.......
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises

TiDB Introduction - San Francisco MySQL Meetup

  • 1. Introducing TiDB (For those coming from MySQL..) Make Data Creative Morgan Tocker (@pingcap; @morgo) October, 2018
  • 2. ● History and Community ● Technical Walkthrough ● Use Case with Mobike ● Live Demo: TiDB on GKE ● MySQL Compatibility ● Q&A Agenda
  • 3. ● Sr Product / Community Manager ● ~15+ years MySQL Experience ○ MySQL AB, Sun Microsystems, Percona, Oracle ● Previously Product Manager for MySQL Server A Little About Me...
  • 4. A Little About PingCAP... ● Founded in April 2015 by 3 infrastructure engineers ● Offices in China and North America ● Remote Friendly! ○ I work from here ➡
  • 7. Our Product is The TiDB Platform ● TiDB platform: (Ti = Titanium) ○ TiDB (stateless SQL layer compatible with MySQL) ○ TiKV (distributed transactional key-value store) ○ TiSpark (Apache Spark plug-in on top of TiKV) ● Open source from Day 1 ○ GA 1.0: October 2017 ○ GA 2.0: April 2018
  • 8. TiDB is a NewSQL Database ● 1960s: First Gen Databases ● 1970s: Relational Model + SQL ● 2000s: Sharding + Memcached ● 2010s: NoSQL ● 2010s+: NewSQL Inspired by Google Spanner / F1 MySQL Compatible
  • 9. ● Hybrid OLTP & OLAP (Minimize ETL) ● Horizontal Scalability ● MySQL Compatible ● Distributed Transaction (ACID Compliant) ● High Availability ● Cloud-Native TiDB Core Features
  • 10. Architecture SparkSQL TiDB TiDB Worker Spark Driver TiKV Cluster (Storage) Metadata TiKV TiKV TiKV Data location Job TiSpark DistSQL API TiKV TiDB TSO/Data location Worker Worker Spark Cluster TiDB Cluster TiDB DistSQL API PD PD Cluster TiKV TiKV TiDB KV API MySQL MySQL PD PD
  • 11. 2018 PingCAP Stars ● TiDB: 15,000+ ● TiKV: 3700+ Contributors ● TiDB: 200+ ● TiKV: 100+ Community
  • 14. Platform Architecture TiDB TiDB Worker Spark Driver TiKV Cluster (Storage) Metadata TiKV TiKV TiKV Data location Job TiSpark DistSQL API TiKV TiDB TSO/Data location Worker Worker Spark Cluster TiDB Cluster TiDB DistSQL API PD PD Cluster TiKV TiKV TiDB KV API MySQL MySQL SparkSQL PD PD SparkSQL
  • 15. TiKV: The Foundation [in CNCF] RocksDB Raft Transaction Txn KV API Coprocessor API RocksDB Raft Transaction Txn KV API Coprocessor API RocksDB Raft Transaction Txn KV API Coprocessor API Raft Group Client gRPC TiKV Instance TiKV Instance TiKV Instance gRPC gRPC PD Cluster
  • 16. TiDB: OLTP + Ad Hoc OLAP Node1 Node2 Node3 Node4 MySQL Network Protocol SQL Parser Cost-based Optimizer Distributed Executor (Coprocessor) ODBC/JDBC MySQL Client Any ORM which supports MySQL TiDB TiKV
  • 17. ID Name Email 1 Edward h@pingcap.com 2 Tom tom@pingcap.com ... user/1 Edward,h@pingcap.com user/2 Tom,tom@pingcap.com ... In TiKV -∞ +∞ (-∞, +∞) Sorted map “User” Table TiDB: Relational -> KV Some region...
  • 18. SQL -> Parser -> Coprocessor
  • 19. TiSpark: Complex OLAP Spark ExecSpark Exec Spark Driver Spark Exec TiKV TiKV TiKV TiKV TiSpark TiSpark TiSpark TiSpark TiKV Placement Driver (PD) gRPC Distributed Storage Layer gRPC retrieve data location retrieve real data from TiKV
  • 21. 2018 PingCAP Who’s using TiDB? 300+ Companies
  • 22. 2018 PingCAP 1. MySQL Scalability 2. Hybrid OLTP/OLAP Architecture 3. Unifying Data Storage/Management Three Big Use Cases
  • 23. Mobike + TiDB ● 200 million users ● 200 cities ● 9 milllion smart bikes ● ~30 TB / day
  • 24. ● Locking and unlocking of smart bikes generate massive data ● Smooth experience is key to user retention ● TiDB supports this system by alerting administrators when success rate of locking/unlocking drops, within minutes ● Quickly find malfunctioning bikes Scenario #1: Locking/Unlocking
  • 25. ● Synchronize TiDB with MySQL instances using Syncer (proprietary tool) ● TiDB + TiSpark empower real-time analysis with horizontal scalability ● No need for Hadoop + Hive Scenario #2: Real-Time Analysis
  • 26. ● An innovative loyalty program that must be on 24 x 7 x 365 ● TiDB handles: ○ High-concurrency for peak or promotional season ○ Permanent storage ○ Horizontal scalability ● No interruption as business evolves Scenario #3: Mobike Store
  • 27. TiDB on GKE Demo
  • 29. ● Compatible with MySQL 5.7 ○ Joins, Subqueries, DML, DDL etc. ● On the roadmap: ○ Views, Window Functions, GIS ● Missing: ○ Stored Procedures, Triggers, Events Summary pingcap.com /docs/sql/mysql-compatibility/
  • 30. ● Some features work differently ○ Auto Increment ○ Optimistic Locking ● TiDB works better with smaller transactions ○ Recommended to batch updates, deletes, inserts to 5000 rows Nuanced
  • 31. Thank You! Twitter: @PingCAP; @morgo https://github.com/pingcap (Give us a Watch/Star!) Morgan Tocker (morgan@pingcap.com) Early Sign-up: www.pingcap.com/tidb-academy/
  • 32. ● Hash Join (fastest; if table <= 50 million rows) ● Sort Merge Join (join on indexed column or ordered data source) ● Index Lookup Join (join on indexed column; ideally after filter, result < 10,000 rows) Chosen based on Cost-based Optimizer: Join Support Network cost Memory cost CPU cost
  • 33. Index Structure Row: Key: tablePrefix_rowPrefix_tableID_rowID (IDs are assigned by TiDB, all int64) Value: [col1, col2, col3, col4] Index: Key: tablePrefix_idxPrefix_tableID_indexID_ColumnsValue_rowID Value: [null] Keys are ordered by byte array in TiKV, so can support SCAN Every key is appended a timestamp, issued by Placement Driver
  • 34. ● Complex calculation pushdown ● Key-range pruning ● Index support: ○ Clustered index / non-clustered index ○ Index-only query optimization ● Cost-based optimization: ○ Stats gathered from TiDB in histogram TiSpark: Features
  • 35. PD: Dynamic Split and Merge Region A Region A Region B Region A Region A Region B Split Region A Region A Region B Merge TiKV_1 TiKV_2 TiKV_2TiKV_1
  • 36. PD: Hotspot Removal *Region A* *Region B* Region A Region B Workload *Region A* Region B Region A *Region B* Workload Workload Hotspot Schedule (Raft leader transfer) TiKV_1 TiKV_2 TiKV_2TiKV_1
  • 37. Geo-Replication + Data Location *Region A* Region B Region A Region B Seattle_1 Seattle_2 Region A *Region B* New York_1 *Region A* Region B Region A *Region B* Seattle_2Seattle_1 Region A Region B New York_1
  • 38. ● Timestamp Oracle service (from Google’s Percolator paper) ● 2-Phase commit protocol (2PC) ● Problem: Single point of failure ● Solution: Placement Driver HA cluster ○ Replicated using Raft Transaction Model
  • 39. ● Formal proof using TLA+ ○ a formal specification and verification language to reason about and prove aspects of complex systems ● Raft ● TSO/Percolator ● 2PC ● See details: https://github.com/pingcap/tla-plus Guaranteeing Correctness