Full Backup Issues in Production Database

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 生产库全备问题

| username: Hacker_4yuDkqVA

[TiDB Usage Environment]
Production Environment
[TiDB Version]
tidb v5.4.0
[Issue and Impact]
Requirement: How to fully back up the entire cluster and restore it to the most recent point in time when a failure occurs.
Is it possible to restore the entire cluster similar to Oracle’s RMAN backup (full backup + incremental backup + latest log files)?
My current idea is: use BR for full backup (restore to a certain point in time) + binlog for incremental backup. I am not sure if this solution is feasible or how it should be implemented.

| username: muliping | Original post link

Feasible,
BR can do full backup (restore to a certain point in time),
Binlog can be parsed using Reparo.

| username: ddhe9527 | Original post link

To achieve point-in-time recovery, you need to use TiDB-Binlog. Configure Drainer with syncer.db-type: “file” to output binlog logs. For PITR, first use BR to restore the full backup, then use the timestamp from the backup set as the starting time, and apply the binlog logs back to TiDB using the reparo tool.

| username: Hacker_4yuDkqVA | Original post link

Using multiple tools feels a bit cumbersome. After outputting the binlog to a file and changing the start time, you need to restore it. So, do you need to ensure that the binlog time is after the full backup of BR? For example, if I do a full backup with BR once a day, then set the binlog time to 7 days.

| username: ddhe9527 | Original post link

Yes, to achieve PITR, it is necessary to ensure that all binlogs after the BR backup timestamp are not lost.

| username: Hacker_4yuDkqVA | Original post link

The scale is not very large. Currently, we plan to use BR for daily full backups because it’s fast. So, I’ll add an incremental backup using binlog. I haven’t done this part before :innocent:. I’m not sure if binlog has any impact on performance.

| username: ddhe9527 | Original post link

What is the impact of enabling Binlog on TiDB’s performance?

| username: HACK | Original post link

It would be great when TiDB’s BR tool can achieve PITR.

| username: fengou1 | Original post link

We are working on it as planned and currently testing. If everything goes smoothly, it is expected to go live in about 2 months.

| username: tidb狂热爱好者 | Original post link

Isn’t binlog an enterprise version tool that requires a paid solution?

| username: ddhe9527 | Original post link

The community edition includes tidb-binlog.

| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.