با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مربوط به نسخه استاندارد Cloud Firestore و نسخه Enterprise Cloud Firestore.
بازیابی نقطه در زمان (PITR) در برابر حذف یا نوشتن تصادفی محافظت می کند. PITR نسخه هایی از اسناد شما را از مهرهای زمانی گذشته نگهداری می کند. به عنوان مثال، در موردی که یک توسعهدهنده اطلاعات نادرست را فشار میدهد، به طور تصادفی حذف یا مینویسد، PITR میتواند دادهها را تا نقطهای از زمان گذشته (حداکثر تا ۷ روز) بازیابی کند.
برای هر پایگاه داده زنده ای که از بهترین شیوه ها پیروی می کند، استفاده از PITR بر عملکرد خواندن یا نوشتن تأثیر نمی گذارد.
پنجره PITR
پس از فعال کردن PITR، Cloud Firestore شروع به حفظ داده های PITR می کند. داده های PITR به مدت 7 روز در پنجره PITR نگهداری می شوند.
میتوانید براساس زمانی که PITR فعال شده است، دادههای یک مهر زمانی را بخوانید:
وضعیت فعال سازی PITR
اولین داده های PITR موجود
از کار افتاده است
1 ساعت قبل از زمان درخواست خواندن
ظرف 7 روز فعال شد
1 ساعت قبل از فعال شدن PITR
بیش از 7 روز پیش فعال شد
7 روز قبل از زمان درخواست خواندن
یک نسخه در دقیقه در پنجره PITR حفظ می شود. شما می توانید اسناد را با جزئیات دقیق با استفاده از مهر زمانی کامل دقیقه بخوانید. خواندن هایی که در جزئیات دقیق نیستند مانند 2023-05-30 09:00:00.1234AM یک خطا نشان می دهد که read_time خیلی قدیمی است.
فقط یک نسخه از یک سند در صورت نوشتن چندگانه حفظ می شود. به عنوان مثال، اگر سندی دارای چندین نوشته از v1, v2, ... vk بین 2023-05-30 09:00:00AM (انحصاری) و 2023-05-30 09:01:00AM (شامل) مُهر زمانی بود، یک درخواست خواندن در مُهر vk2023-05-30 09:01:00AM از سند
شما می توانید از داده های ایجاد شده در طول پنجره PITR بخوانید. داده ها با جزئیات یک دقیقه ذخیره می شوند و شما می توانید داده ها را با همان دانه بندی بازیابی کنید. ویژگی PITR به طور پیش فرض غیرفعال است.
فیلد earliestVersionTime پایگاه داده شما، اولین زمان خواندن مجاز برای داده های شما را مشخص می کند.
صرف نظر از فعال بودن یا نبودن PITR، میتوانید اسناد را در هر مُهر زمانی میکروثانیهای در یک ساعت گذشته بخوانید (اما نه صادر کنید)، اما نه قبل از earliestVersionTime .
راه های بازیابی اطلاعات
چندین روش برای بازیابی اطلاعات وجود دارد:
برای بازیابی بخشی از پایگاه داده ، یک خواندن بیات را با مشخص کردن شرایط پرس و جو یا با استفاده از جستجوی مستقیم کلید همراه با مهر زمانی در گذشته انجام دهید و سپس نتایج را دوباره در پایگاه داده زنده بنویسید. این معمولاً برای عملیات جراحی در پایگاه داده زنده استفاده می شود. به عنوان مثال، اگر به طور تصادفی یک سند خاص را حذف کنید یا به اشتباه زیرمجموعه ای از داده ها را به روز کنید، می توانید آن را با این روش بازیابی کنید. برای دستورالعملها، به بازیابی بخشی از پایگاه داده خود مراجعه کنید.
برای بازیابی کل پایگاه داده ، از یکی از گزینه های زیر استفاده کنید:
پایگاه داده را صادر کنید و یک مهر زمانی در گذشته مشخص کنید و سپس آن را به یک پایگاه داده جدید وارد کنید. عملیات صادرات PITR از تمام فیلترها، از جمله صادرات تمام اسناد و صادرات مجموعه های خاص پشتیبانی می کند.
میتوانید دادههای PITR را در جایی که مُهر زمانی یک مهر زمانی کامل در هفت روز گذشته است، شبیهسازی یا صادر کنید، اما نه زودتر از earliestVersionTime .
قیمت گذاری
قبل از اینکه PITR را برای پایگاه داده خود فعال کنید، اطلاعات قیمت گذاری زیر را در نظر بگیرید:
ذخیره سازی: Cloud Firestore با سازگاری MongoDB اندازه پایگاه داده را روزانه اندازه گیری می کند. در طول یک ماه، این نقاط نمونه برای محاسبه اندازه ذخیره سازی پایگاه داده میانگین می شوند. این مقدار متوسط در قیمت واحد PITR (گیگابایت در ماه) ضرب می شود. برای اطلاعات بیشتر به قیمت ذخیره سازی مراجعه کنید.
فضای ذخیرهسازی PITR یک ردیف رایگان ندارد و اگر میخواهید از PITR استفاده کنید باید صورتحساب را فعال کنید.
محاسبه صورتحساب: هر سؤالی که در طول پنجره PITR 7 روزه میکنید، چه از طریق خواندن قدیمی یا صادرات، هزینههای عملیات خواندن را بر اساس تعداد اسناد خوانده شده متحمل میشود. برای اطلاعات بیشتر قیمت را ببینید.
حداقل صورتحساب: ممکن است تا 1 روز هزینه ذخیرهسازی PITR از شما کسر شود، حتی اگر PITR را ظرف یک روز پس از فعال کردن غیرفعال کنید.
تاریخ آخرین بهروزرسانی 2025-09-04 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]