当前位置:网站首页>TiDB数据迁移场景综述
TiDB数据迁移场景综述
2022-07-02 11:56:00 【添香小铺】
本文档总体介绍可用于 TiDB 的数据迁移方案。数据迁移方案如下:
全量数据迁移。
- 数据导入:使用 TiDB Lightning 将 Aurora Snapshot,CSV 文件或 Mydumper SQL 文件的数据全量导入到 TiDB 集群。
- 数据导出:使用 Dumpling 将 TiDB 集群的数据全量导出为 CSV 文件或 Mydumper SQL 文件,从而更好地配合从 MySQL 数据库或 MariaDB 数据库进行数据迁移。
- TiDB DM (Data migration) 也提供了适合小规模数据量数据库(例如小于 1 TiB)的全量数据迁移功能。
快速初始化 TiDB 集群:TiDB Lightning 提供的快速导入功能可以实现快速初始化 TiDB 集群的指定表的效果。请注意,使用快速初始化 TiDB 集群的功能对 TiDB 集群的影响极大,在进行初始化的过程中,TiDB 集群不支持对外访问。
增量数据迁移:使用 TiDB DM 从 MySQL,MariaDB 或 Aurora 同步 Binlog 到 TiDB,该功能可以极大降低业务迁移过程中停机窗口时间。
TiDB 集群复制:TiDB 支持备份恢复功能,该功能可以实现将 TiDB 的某个快照初始化到另一个全新的 TiDB 集群。
根据迁移数据所在数据库类型、部署位置、业务数据规模大小、业务需求等因素,会有不同数据迁移选择。下面展示一些常用的数据迁移场景,方便用户依据这些线索选择到最适合自己的数据迁移方案。
迁移 Aurora MySQL 到 TiDB
从 Aurora 迁移数据到部署在 AWS 的 TiDB 集群,数据迁移可以分为全量迁移和增量迁移两个步骤进行。请根据你的业务需求选择相应的步骤。
迁移 MySQL 到 TiDB
如果你没有使用 Cloud storage (S3) 服务,而且网络联通和延迟情况良好,那么从 MySQL 迁移数据到 TiDB 时可以参照下面的方案。
如果你对数据迁移速度有要求,或者数据规模特别大(例如大于 1 TiB),并且禁止 TiDB 集群在迁移期间有其他业务写入,那么你可以先使用 Lightning 进行快速导入,然后根据业务需要选择是否使用 DM 进行增量数据 (Binlog) 同步。
分库分表 MySQL 合并迁移到 TiDB
如果你的业务使用了基于 MySQL 分库的方案来存储数据,业务数据从 MySQL 迁移到 TiDB 后,合并这些分表数据到一张合并,那么你可以使用 DM 进行分表合并迁移。
如果分表数据总规模特别大(例如大于 1 TiB),并且禁止 TiDB 集群在迁移期间有其他业务写入,那么你可以使用 Lightning 对分表数据进行快速合并导入,然后根据业务需要选择是否使用 DM 进行增量数据 (Binlog) 的分表同步。
从文件迁移数据到 TiDB
复杂迁移场景
DM 在实时同步过程中,多个已有特性可以使得同步过程更加灵活,适应各类业务需求:
边栏推荐
- 【C语音】详解指针进阶和注意点(2)
- taobao.logistics.dummy.send( 无需物流发货处理 )接口,淘宝店铺发货API接口,淘宝订单发货接口,淘宝r2接口,淘宝oAu2.0接口
- buuctf-pwn write-ups (7)
- [untitled] leetcode 2321 Maximum score of concatenated array
- ##51单片机实验之简易验证码发生器
- 实用调试技巧
- socket(套接字)与socket地址
- HUSTPC2022
- Socket and socket address
- 报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
猜你喜欢

Yolov6 training: various problems encountered in training your dataset
![[noi Simulation Competition] scraping (dynamic planning)](/img/ee/27a07f80207a2925f5065e633eb39f.png)
[noi Simulation Competition] scraping (dynamic planning)

Fundamentals of software testing

LeetCode 2320. 统计放置房子的方式数

Add vector formula in rich text editor (MathType for TinyMCE, visual addition)

taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface
![[apipost] tutorial](/img/f9/717908a72720f152ad49034be64b35.png)
[apipost] tutorial

Why can't programmers who can only program become excellent developers?

Reuse and distribution

ONNX+TensorRT:将预处理操作写入ONNX并完成TRT部署
随机推荐
871. Minimum refueling times: simple priority queue (heap) greedy question
【C语言】详解指针的初阶和进阶以及注意点(1)
tmall. product. schema. Get (product information acquisition schema acquisition), Taobao store upload commodity API interface, Taobao commodity publishing interface, Taobao commodity upload API interf
MFC timer usage
C # delay, start the timer in the thread, and obtain the system time
复用和分用
Li Chuang EDA learning notes 15: draw border or import border (DXF file)
Xilinx Vivado set *. svh as SystemVerilog Header
Record an error report, solve the experience, rely on repetition
C#代码审计实战+前置知识
TiDB 软件和硬件环境建议配置
实用调试技巧
LeetCode 209. Minimum length subarray
HUSTPC2022
##51单片机实验之简易验证码发生器
Leetcode - Search 2D matrix
info [email protected]: The platform “win32“ is incompatible with this module.
SQL 后计算的利器 SPL
蜻蜓低代码安全工具平台开发之路
【题解】Educational Codeforces Round 82