---
title: 【代理投稿】The Journey from MySQL to TiDB
tags: 
author: [bohnen](https://www.docswell.com/user/bohnen)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/LELP5XZ27R.jpg?width=480
description: 2024-06-27 TiUGでのPingCAP CTO Ed Huangの発表スライドです。
published: July 09, 24
canonical: https://www.docswell.com/s/bohnen/K8G4JP-2024-07-09-120442
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/LELP5XZ27R.jpg)

The Journey from MySQL to TiDB
The Story about PingCAP
Ed Huang
Co-founder &amp; CTO, PingCAP
h@pingcap.com


# Page. 2

![Page Image](https://bcdn.docswell.com/page/4JM43LV97W.jpg)



# Page. 3

![Page Image](https://bcdn.docswell.com/page/PJRWQK2979.jpg)

The Beginning -&gt;
From OLTP to HTAP -&gt;
From Database to Database Cloud


# Page. 4

![Page Image](https://bcdn.docswell.com/page/PEXP5LD37X.jpg)

The beginning...
●
The story begins in 2015…
○ Max, Dylan and I were working for a fast-growing startup (Wandoujia.com)
■ The AppStore for Android Phone
○ Max and I were working in Storage/Database Infrastructure Team
■ We all love Golang…We build Codis (https://github.com/CodisLabs/codis, I believe u-next is a
big user of Codis, also TiDB )
■ Fun facts:
● We started using Go even before its 1.0
● We have zero background about SQL database
● No one use Rust in production before 😂
○ We ran/maintained a huge amount of MySQL instances &amp; HBase! （since 2013）
■ MySQL Sharding Cluster
● ~50 nodes
■ HBase
● &gt;200 nodes


# Page. 5

![Page Image](https://bcdn.docswell.com/page/3EKD6LXNJD.jpg)

Why not MySQL？
The diﬀerent requirements:
●
●
●
●
●
Cost-based model
Distributed Computing
Online DDL
Diﬀerent storage API abstraction
…
MySQL codebase is not easy to hack…
We love Golang! We want to use the programing language we like :)


# Page. 6

![Page Image](https://bcdn.docswell.com/page/L73R635ZJ5.jpg)

The Beginning
●
The Beginning: We just want to build a better solution to Sharded MySQL
○ 100% Scalable OLTP
○ MySQL binlog listener (syncer, now is DM), helps user reduce migration cost
Binlog
Binlog
dm
Binlog
dm
Binlog
dm
dm
Binlog
https://github.com/go-mysql-org/go-mysql
dm


# Page. 7

![Page Image](https://bcdn.docswell.com/page/87DYV4D47G.jpg)

The Journey


# Page. 8

![Page Image](https://bcdn.docswell.com/page/VJP6VMXVE8.jpg)

The Journey
OLTP Workload
insert into github_events values(...)
insert into github_events values(...)
insert into github_events values(...)
select … from github_events where actor=&#039;xxx&#039;
…
Binlog
Binlog
dm
Binlog
dm
dm
Binlog
dm
OLAP Workload


# Page. 9

![Page Image](https://bcdn.docswell.com/page/2EV3Z9LR7Q.jpg)

From OLTP to HTAP
●
We introduce TiSpark to enhance TiDB&#039;s analytical capabilities (TiDB 3.0)
TiSpark
Binlog
Binlog
dm
Binlog
dm
Binlog
dm
dm
Binlog
dm


# Page. 10

![Page Image](https://bcdn.docswell.com/page/57G34ZX6JL.jpg)

From OLTP to HTAP
●
●
Is Spark enough?
○ Spark only solve the computing problem
We introduce Columnar Storage (TiFlash) into the storage layer of TiDB 4.0
AdHoc Reporting
TiKV (Row-based Storage)
TiSpark
TiFlash (Columnar Storage)


# Page. 11

![Page Image](https://bcdn.docswell.com/page/4EQ5GL82JP.jpg)

From OLTP to HTAP
●
●
TiFlash solves the Storage problem for high speed OLAP
And then, we introduce MPP mode in TiDB 5.0
AdHoc Reporting
TiKV (Row-based Storage)
TiDB SQL
TiFlash MPP Mode (Massively Parallel Processing)


# Page. 12

![Page Image](https://bcdn.docswell.com/page/KJ495D2P71.jpg)

What&#039;s next? Database Cloud!
TiDB Dedicated
TiDB Serverless


# Page. 13

![Page Image](https://bcdn.docswell.com/page/LE1KWZMXJG.jpg)

Is TiDB-Operator a cloud?
No, not even close.
It&#039;s just only a deployment
tool for TiDB in k8s


# Page. 14

![Page Image](https://bcdn.docswell.com/page/GEWD693KJ2.jpg)

Building a DBaaS is hard, the architecture overview of the ﬁrst version of TiDB Cloud


# Page. 15

![Page Image](https://bcdn.docswell.com/page/47ZGY9VNE3.jpg)

Two diﬀerent approaches to build DBaaS


# Page. 16

![Page Image](https://bcdn.docswell.com/page/YJ6YDK597V.jpg)

Two diﬀerent approaches to build DBaaS
Shared
Gateway
Gateway
Gateway
Gateway
On Demand
Pool
TiDB
Virtual Cluster - Tenant 1
Isolated
SQL Layer
Shared
Storage Layer
TiDB
Row
Engine
MPP
Row
Engine
Virtual Cluster - Tenant 2
TiDB
MPP
MPP
MPP
MPP
Columnar
Engine
Row
Engine
Virtual Cluster - Tenant n
TiDB
TiDB
TiDB
TiDB
Columnar
Engine
Columnar
Engine
MPP
Worker
MPP
Worker
MPP
Worker
Shared
Storage Pool
S3
Service
Shared
Services
Compaction
Analyze
DDL
Remote Copr
Service
Other
Region


# Page. 17

![Page Image](https://bcdn.docswell.com/page/GJ5G3PYDJ4.jpg)

Building a DBaaS actually gives us more
1.
2.
3.
4.
Multi-tenancy
a. Resource Control
b. Online/Concurrent DDL
c. 1,000,000+ Table Support
d. …
Cloud native architecture
a. Compute/Storage separation TiFlash
b. TiDB Serverless Auto-Scaler
c. …
Performance improvement
New workload support
a. Vector Search on TiDB Serverless Tier


# Page. 18

![Page Image](https://bcdn.docswell.com/page/9E2YZ6YMER.jpg)

The philosophy of TiDB
●
●
●
●
●
Cloud is the Future
○ Embrace Kubernetes &amp; Cloud Infrastructure early
Keep Neutral
○ Not rely on speciﬁc hardware
○ Not depend on a speciﬁc cloud vendor
Be Open
○ Open-Minded &amp; Open-Source
Database is not only Database
○ Eco-system also matters!
Simplicity is the best weapon to defeat complexity


