【TiDB 4.0 PCTA 学习笔记】- 2.1 When to use TiDB platform(TiDB 的适用场景)& 2.2 How to connect TiDB platform(如何连接到 TiDB)@2班+陈俊聪

课程名称:课程版本(201)+ 2.1 When to use TiDB platform(TiDB 的适用场景)& 2.2 How to connect TiDB platform(如何连接到 TiDB)


2 小时


2.1 When to use TiDB platform(TiDB 的适用场景)
2.2 How to connect TiDB platform(如何连接到 TiDB)


TiDB for OLTP-like workload

when you need Random,Real-time Read/Write access to your big data (billions of rows),with

  • ACID compliance
  • Secondary index support
  • MySQL syntax

TiDB for Real-time HTAP workload

  • Real-time HTAP (Hybrid transactional/analytical processing)
  • When you have a OLTP-like workload using TiDB,and you want to perform OLAP query in place with the help of TiFlash
    • with fresh data
    • with zero interference on OLTP performance
  • Data integration
    • when you have multiple data sources like (OLTP databases,streaming ingestion and etc.),you want to perform OLAP query on the integrated data set

Connect with Spark Eco-system via TiSpark

Whith TiSpark you can use Spark to process data within TiDB platform inplace without moving your data out.
It’s useful when you want workload like:

  • Iterative processing
    • like traditional ETL job
  • Joining datasets
    • joining large datasets from multiple data sources
    • a lot of shuffling and sorting is needed

When TiDB is not a good choice

  • Your data can fit on a single server
  • You need to perform heavy analytics tasks
    • scanning and aggregation on large data sets,that intermediate results can not fit in single server’s memory
  • You need sub-millisecond latency
    • take a look at Redis?

TiDB speaks MySQL protocol



  • CLI
    • offical mysql-client
    • mycli
  • GUI
    • PHPMyAdmin
    • MySQL Workbench
    • Navicat


  • Python
    • mysqlclient
    • PyMySQL
    • MySQL-Python
  • Java
    • JDBC
    • go-sql-driver/mysql

Any programming language and its recommended MySQL connector

ORM (Object-Relational Mapping)

  • Java
    • Hibernate
    • MyBatis
  • Python
    • Django ORM
    • SQLAlchemy
  • Go
    • Gorm
    • xorm


docker rm -f myadm_tidb
docker run -d \
--name myadm_tidb \
-e PMA_HOST= \
-e PMA_PORT="4000" \
-p 8080:80 \