> For the complete documentation index, see [llms.txt](https://docs.dispel.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/data-backup-and-recovery.md).

# 数据备份与恢复

Dispel 的数据存储、保留和恢复方案经过精心设计，旨在提供强大的安全性和运营韧性。我们结合使用加密存储解决方案、自动备份机制和地理分布式冗余，力求保护您的数据免遭未经授权的访问和丢失。本文档介绍这些系统的工作原理、相关政策以及在需要恢复数据时应遵循的流程。

## 数据存储区域 <a href="#h_65e00cfeb6" id="h_65e00cfeb6"></a>

Dispel 客户可选择以下两个数据驻留区域之一：

| 仪表板类型       | 位置 | 套餐       |
| ----------- | -- | -------- |
| Dispel - 美国 | 美国 | SaaS     |
| Dispel - 欧盟 | 欧洲 | SaaS、私有云 |

## 数据备份

<figure><img src="https://1079732812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5T5Fo32wwisEqZbODG7j%2Fuploads%2Fgit-blob-64aef062f19766817be7bdcc6cbf28d5d073c2c0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Dispel 会自动备份所有客户数据和系统数据，以防范影响整个系统的意外事件造成灾难性数据丢失。自动化流程会将所有数据备份到能够抵御影响整个可用区的事件的存储设施中。默认情况下，数据至少每 24 小时备份一次。备份存储在加密的数据存储归档中，并受到监控，且会针对相关情况发送告警。

Dispel 管理的所有数据库都会持续受到保护：快照、基础备份和 WAL 文件会持久保存到对象存储中。此外，分叉数据库和跟随者数据库通过获取快照或持久保存的基础备份及 WAL 文件，并在全新的 Postgres 安装实例上重放这些文件来实现。将这些物理备份存储在高可用对象存储中，还使我们能够在硬件故障、数据损坏或大规模服务中断时恢复整个数据库。默认情况下，Dispel 的子处理商提供的对象存储具备耐久性基础设施，用于存储重要数据，其设计目标是对象耐久性达到 99.999999999%。

### 备份类型

Dispel 会创建完整的数据库备份。已提交到数据库的事务会记录为 WAL 文件，可在快照或基础备份之上重放，从而完整重建数据库状态。快照直接存储在对象存储中。Postgres 提供基础备份和 WAL 文件后，应用程序 WAL-E 会立即将它们推送到对象存储中。

## 数据恢复 <a href="#h_29cc3a5682" id="h_29cc3a5682"></a>

数据库可以从冷备份状态恢复，也可以与现有数据库同步。这两种方式分别称为 *分叉* 和 *跟随* 流程。Dispel 还可以回滚到较早的数据库备份。

在所有情况下，都会创建一个新的数据库实例 (N2)，使其与现有数据库 (N1) 并行运行，然后将其提升为 API 的主数据库。以下流程图展示了通过数据库分叉恢复数据的过程：

<figure><img src="https://1079732812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5T5Fo32wwisEqZbODG7j%2Fuploads%2Fgit-blob-ef090b32a2d4a60e1c730676b42d898dfdfb5665%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### 灾难恢复 / 业务连续性 <a href="#h_2c98034406" id="h_2c98034406"></a>

发生中断时，我们的平台会自动恢复 Postgres 数据库。Dispel 平台旨在动态地在云端部署应用程序、监控故障，并恢复发生故障的平台组件，包括客户应用程序和数据库。

## 备份保留期限 <a href="#h_ae062a7b1d" id="h_ae062a7b1d"></a>

生产数据库运行在 Amazon Aurora (RDS) 上，并配置了自动备份，采用滚动 30 天的保留期限，可对最近 30 天内任意秒的时间点进行持续时间点恢复 (PITR)。自动备份包括每日快照和存储在 Amazon S3 中的事务日志，均使用 KMS 加密，且仅授权操作人员可以访问。为满足合规、审计和取证调查要求，日志的保留时间最长可达一年或更久。

## 数据导出 / 归档

客户可以申请获取其数据副本，以便导出和归档。Dispel 使用原生的 `pg_dump` PostgreSQL 工具创建备份文件，因此可以轻松导出到其他 PostgreSQL 安装实例。生成的备份文件采用 `pg_dump`中的自定义格式选项。与纯文本格式相比，自定义格式生成的备份文件可能小得多。

## 数据所有权

客户数据归客户所有；Dispel 数据归 Dispel 所有。有关 Dispel 如何处理客户数据的更多信息，请参阅我们的 [隐私政策](https://legal.dispel.com/policies/privacy-policy).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.dispel.com/documentation/documentation-zh/bao-hu-yu-zhi-li/data-backup-and-recovery.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
