Cloud Firestore Standard 버전 및 Cloud Firestore Enterprise 버전에 해당합니다.
PITR(point-in-time recovery)은 실수로 인한 삭제나 쓰기를 방지합니다. PITR은 이전 타임스탬프의 문서 버전을 유지합니다. 예를 들어 개발자가 잘못된 데이터, 실수로 인한 삭제 또는 쓰기를 푸시하는 경우 PITR을 통해 과거의 특정 시점(최대 7일)의 데이터를 복구할 수 있습니다.
권장사항을 따르는 모든 실시간 데이터베이스의 경우 PITR을 사용해도 읽기 또는 쓰기 성능은 영향을 받지 않습니다.
PITR 기간
PITR을 사용 설정하면 Cloud Firestore에서 PITR 데이터를 보관하기 시작합니다. PITR 데이터는 PITR 기간 중 7일 동안 보관됩니다.
PITR이 사용 설정된 시간을 기반으로 타임스탬프의 데이터를 읽을 수 있습니다.
PITR 사용 설정 상태
사용 가능한 가장 이른 PITR 데이터
사용 중지됨
읽기 요청 시간 1시간 전
7일 이내에 사용 설정됨
PITR이 사용 설정되기 1시간 전
7일 이전에 사용 설정됨
읽기 요청 시간 7일 전
분당 단일 버전이 PITR 기간에 보관됩니다. 1분 타임스탬프를 사용하여 분 단위로 문서를 읽을 수 있습니다. 분 단위가 아닌 읽기(예: 2023-05-30 09:00:00.1234AM)는 read_time이 너무 오래되었다는 오류를 반환합니다.
쓰기가 여러 개인 경우 문서 버전 하나만 유지됩니다. 예를 들어 문서에 2023-05-30 09:00:00AM(제외) 및 2023-05-30 09:01:00AM(포함) 타임스탬프 사이에 v1, v2, ... vk에 이르는 여러 개의 쓰기가 있는 경우, 타임스탬프 2023-05-30 09:01:00AM의 읽기 요청이 문서의 vk 버전을 반환합니다.
PITR 기간 중 생성된 데이터를 읽을 수 있습니다. 데이터는 분 단위로 저장되며 동일한 단위로 데이터를 복구할 수 있습니다. PITR 기능은 기본적으로 중지되어 있습니다.
PITR의 사용 설정 여부와 관계없이 지난 1시간 이내의 마이크로초 단위 타임스탬프에서 문서를 읽을 수 있지만 내보낼 수는 없습니다. 단, earliestVersionTime 이전에서 읽을 수 없습니다.
데이터 복구 방법
데이터를 복구하는 방법에는 여러 가지가 있습니다.
데이터베이스의 일부를 복구하려면 쿼리 조건을 지정하거나 이전의 타임스탬프와 함께 직접 키 조회를 사용하여 비활성 읽기를 수행합니다. 그런 다음 결과를 다시 실시간 데이터베이스에 기록합니다. 이는 일반적으로 실시간 데이터베이스의 소위 외과적 수술을 위해 사용됩니다. 예를 들어 특정 문서를 실수로 삭제하거나 데이터 하위 집합을 잘못 업데이트한 경우 이와 같은 방법으로 복구할 수 있습니다. 자세한 내용은 일부 데이터베이스 복구를 참조하세요.
데이터베이스를 내보내기하고 이전의 타임스탬프를 지정한 후 새 데이터베이스로 가져옵니다. PITR 내보내기 작업은 모든 문서 내보내기 및 특정 컬렉션 내보내기를 포함한 모든 필터를 지원합니다.
타임스탬프가 지난 7일 이내의 1분 타임스탬프이고 earliestVersionTime 이후인 PITR 데이터를 클론하거나 내보낼 수 있습니다.
가격 책정
데이터베이스에 PITR을 사용 설정하기 전에 다음 가격 정보를 고려하세요.
스토리지: MongoDB 호환성을 갖춘 Cloud Firestore는 데이터베이스 크기를 매일 측정합니다. 한 달 동안 이러한 샘플 포인트의 평균을 계산하여 데이터베이스 스토리지 크기를 계산합니다. 이 평균 값에 PITR의 단가(GB-월)를 곱합니다. 자세한 내용은 스토리지 가격 책정을 참조하세요.
PITR 스토리지에는 무료 등급이 없으며 PITR을 사용하려면 결제가 사용 설정되어 있어야 합니다.
컴퓨팅 결제: 비활성 읽기 또는 내보내기를 통해 PITR 기간 7일 동안 수행하는 모든 쿼리에는 읽은 문서 수를 기준으로 읽기 작업 비용이 발생합니다. 자세한 내용은 가격 책정을 참조하세요.
최소 결제: 사용 설정 후 1일 이내에 PITR을 사용 중지하더라도 최대 1일의 PITR 스토리지 비용이 청구될 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["\u003cbr /\u003e\n\n\n|----------------------------------------------------------------------------------------|\n| *Relevant to Cloud Firestore Standard edition and Cloud Firestore Enterprise edition.* |\n\n\u003cbr /\u003e\n\nPoint-in-time recovery (PITR) protects against\naccidental deletion or writes. PITR maintains versions of your\ndocuments from past timestamps. For example, in the case of a developer\npushing any incorrect data, accidental deletes or writes, PITR can recover the\ndata to a point in time in the past (up to a maximum of 7 days).\nFor any live database that follows [Best practices](./best-practices), use of PITR doesn't affect the performance of reads or writes.\n\nPITR window\n\nAfter you enable PITR, Cloud Firestore starts retaining PITR data. PITR data\nis retained for 7 days in the PITR window.\n\nYou can read data for a timestamp based on when PITR was enabled:\n\n| PITR enablement status | Earliest PITR data available | |\n|------------------------------|----------------------------------------|---|\n| Disabled | 1 hour before the time of read request | |\n| enabled within 7 days | 1 hour before PITR was enabled | |\n| enabled more than 7 days ago | 7 days before the time of read request | |\n\n| **Note:** You can't start reading from 7 days in the past immediately after you enable PITR.\n\nA single version per minute is retained in the PITR window. You can read\ndocuments at minute granularity using a whole minute timestamp. Reads that are\nnot at minute granularity like `2023-05-30 09:00:00.1234AM` return an\nerror that the `read_time` is too old.\n\nOnly one version of a document is retained in case of multiple writes. For\nexample, if a document had multiple writes ranging from `v1, v2, ... vk` between\n`2023-05-30 09:00:00AM` (exclusive) and `2023-05-30 09:01:00AM` (inclusive)\ntimestamp, a read request at timestamp `2023-05-30 09:01:00AM` returns the `vk`\nversion of the document.\n\nYou can read from the data created during the PITR\nwindow. The data is stored at a minute granularity and you can recover data\nat the same granularity. The PITR feature is disabled by default.\n\nThe [`earliestVersionTime`](https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases#Database) field of your database specifies the\nearliest permissible read time for your data.\n\nRegardless of whether PITR is enabled or not, you can read (but not export) documents at any microsecond-granularity timestamp within the past hour, but not before the `earliestVersionTime`.\n\nWays to recover data\n\nThere are several ways to recover data:\n\n- To **recover a portion of the database** ,\n\n perform a [stale read](/docs/firestore/enterprise/understand-reads-writes-scale#stale_reads)\n specifying a query-condition or using direct key lookup along with a timestamp in\n the past,\n\n and then write the results back into the live database. This is\n typically used for surgical operations on a live database. For example, if\n you accidentally delete a particular document or incorrectly update a\n subset of data, you can recover it with this method. For instructions, see\n [recovering a portion of your database](/docs/firestore/enterprise/use-pitr#read-pitr).\n\n- To **recover the entire database**, use one of the following options:\n\n -\n [Clone the database](/docs/firestore/enterprise/create-databases#clone-database)\n\n to create a copy of the database at a specific timestamp.\n\n - [Export](/docs/firestore/enterprise/use-pitr#export-import) the database and specify\n a timestamp in the past and then import it to a new database. The PITR\n export operation supports all filters, including export of all documents and\n export of specific collections.\n\n You can clone or export PITR data where the timestamp\n is a whole minute timestamp within the past seven days, but not earlier than\n the `earliestVersionTime`.\n\nPricing\n\nConsider the following pricing information before you enable PITR for your database:\n\n- Storage: Cloud Firestore with MongoDB compatibility measures the database size daily. Over the\n period of a month, these sample points are averaged to calculate the\n database storage size. This average value is multiplied by the unit price of\n PITR (GB-month). See [storage pricing](https://cloud.google.com/firestore/enterprise/pricing) for more information.\n\n PITR storage doesn't have a free tier and you must have billing enabled if you want to use PITR.\n- Compute billing: Any queries that you make during the PITR window of 7 days,\n either through stale reads or exports, incur read operation costs\n based on the number of documents read. See [pricing](https://cloud.google.com/firestore/enterprise/pricing) for more\n information.\n\n- Minimum billing: You may be charged up to 1 day of PITR storage cost even if you disable PITR within a day after enablement.\n\nWhat's next\n\n- Learn more about how to [recover data with PITR](./use-pitr)."]]