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

TiDBの面白さと始め方

 TiDBの面白さと始め方

TiDBの面白さと始め方 at NewSQL/分散SQLデータベース よろず勉強会 #1 https://newsql-dist-db.connpass.com/event/264644/

shigeyuki fujishima

November 24, 2022
Tweet

More Decks by shigeyuki fujishima

Other Decks in Technology

Transcript

  1. About me Professional Experience - Technical support engineer at PingCAP

    K.k. - 10+ years experience of professional software engineer - Previously working as a solution architect, a software engineer in the private cloud team, SRE, DevOps, etc… Personal Summary - Based in Fukuoka, Japan - Pythonista, Gopher and Rust newbie - Forever English learner
  2. Agenda - TiDB Explained - TiDB Architecture - TiDB and

    MySQL - Getting Started with TiDB
  3. TiDB Explained - MySQL Compatible - Highly compatible with the

    MySQL 5.7 protocol - The ecosystem tools for MySQL and the MySQL client can be used for TiDB - PHPMyAdmin, Navicat, MySQL Workbench, mysqldump, and Mydumper/myloader etc - Unsupported feature/function/protocol can be alternatively supported with specific tools. - Replicate data from MySQL: TiDB Data Migration (DM) - Replicate data to MySQL: TiCDC https://docs.pingcap.com/tidb/stable/mysql-compatibility
  4. TiDB Explained - Real-Time HTAP - A Hybrid Transactional and

    Analytical Processing (HTAP) - Can process OLTP and OLAP workloads in the same architecture without the workloads interfering with each other. - Row-based and column-based storage engines in a single system - Distributed execution engine powered by TiDB optimizer - Distributed TiKV coprocessors and the TiFlash Massively Parallel Processing (MPP) execution engine. https://www.pingcap.com/blog/the-beauty-of-htap-tidb-and-alloydb-as-examples/
  5. TiDB Explained - Scalability - Decoupled architecture - Automatic data

    sharding https://www.pingcap.com/blog/tidb-internal-data-storage/
  6. TiDB Architecture - TiDB Server - A stateless SQL layer

    - The connection endpoint of the MySQL protocol to the outside - Placement Driver (PD) server - The metadata managing component - TiKV server - Responsible for storing data - A distributed transactional key-value storage engine - TiFlash server - Store data by column - Accelerate analytical processing https://docs.pingcap.com/tidb/stable/tidb-architecture
  7. TiDB and MySQL - Auto increment ID - Allocated in

    a batch of values (30 thousand by default) to each TiDB server - Only be monotonic on a per TiDB server basis - Recommended to use AUTO_RANDOM instead.
  8. TiDB and MySQL - Auto increment ID - In v6.4,

    MySQL compatibility mode has been released as an experimental feature. - Note that v6.4 is DMR (development milestone release), which is not recommended for the production environment. - V6.1 is current LTS version.
  9. TiDB and MySQL - Etc - Default character set and

    collation - The default value in TiDB is utf8mb4 - The default collation of utf8mb4 in TiDB is utf8mb4_bin - ANALYZE TABLE - Completely rebuilds the statistics for a table and can take much longer to complete - Incremental stats collection using “ANALYZE INCREMENTAL TABLE” - System variables - 717 global variables in TiDB v6.3
  10. Getting Started with TiDB - tiup playground - Download TiUP,

    launch TiDB cluster, and do some DDLs and DMLs - https://docs.pingcap.com/tidb/stable/tiup-playground - tiup demo - Try HTAP - https://docs.pingcap.com/tidb/stable/dev-guide-bookshop-schema-design - https://docs.pingcap.com/tidb/stable/dev-guide-hybrid-oltp-and-olap-queries