This deck was delivered at the SF Kubernetes meetup at the Microsoft office to introduce TiDB, an open source NewSQL database, and its sister project TiKV, an open source distributed transactional key-value store and a CNCF member project.
= Titanium) ◦ TiDB (SQL Layer) ◦ TiKV (Key-Value Storage) ◦ TiSpark (Spark plugin to TiKV) • Open source from Day 1 ◦ GA 1.0: October 2017 ◦ GA 2.0: April 2018
1 Region 3 TiKV node 1 Store 1 Region 4 gRPC Region 1 Region 2 TiKV node 2 Store 2 Region 3 gRPC Region 3 Region 1 Region 5 TiKV node 3 Store 3 gRPC Region 5 Region 1 Region 2 TiKV node 4 Store 4 gRPC Client PD 1 PD 2 PD 3 Placement Driver Raft Group Region 4 Region 4
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-base Optimizer:
bikes generates massive data • Smooth experience is the key to user retention • TiDB supports this system by alerting administrators when the success rate of locking/unlocking drops, within minutes • Quickly find malfunctioning bikes
that must be on 24x7x365 • TiDB provides: ◦ High-concurrency for peak or promotional season ◦ Permanent storage ◦ Horizontal scalability • No interruption as business evolves
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
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
◦ Auto Increment ◦ Optimistic Locking • TiDB works better with smaller transactions ◦ Recommended to batch updates, deletes, inserts to 5000 rows pingcap.com /docs/sql/mysql-compatibility/