تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
ينطبق على إصدار Cloud Firestore Standard وإصدار Cloud Firestore Enterprise.
توفّر ميزة "الاسترداد في نقطة زمنية محددة" (PITR) الحماية من عمليات الحذف أو الكتابة غير المقصودة. تحتفظ ميزة "الاسترداد في نقطة زمنية" بنسخ من مستنداتك من الطوابع الزمنية السابقة. على سبيل المثال، في حال أرسل أحد المطوّرين أي بيانات غير صحيحة أو حذف أو كتب بيانات عن طريق الخطأ، يمكن استخدام ميزة "الاسترداد في نقطة زمنية" لاسترداد البيانات إلى نقطة زمنية سابقة (بحد أقصى 7 أيام).
بالنسبة إلى أي قاعدة بيانات نشطة تتبع أفضل الممارسات، لن يؤثر استخدام ميزة "الاسترداد في نقطة زمنية" في أداء عمليات القراءة أو الكتابة.
فترة الاسترداد في نقطة زمنية معيّنة
بعد تفعيل PITR، تبدأ Cloud Firestore في الاحتفاظ ببيانات PITR. يتم الاحتفاظ ببيانات PITR لمدة 7 أيام في فترة PITR.
يمكنك قراءة البيانات الخاصة بطابع زمني استنادًا إلى وقت تفعيل ميزة "استعادة البيانات في نقطة زمنية":
حالة تفعيل استعادة البيانات في نقطة زمنية محددة
أقدم بيانات PITR متاحة
غير مفعّل
قبل ساعة واحدة من وقت طلب القراءة
تم تفعيلها خلال 7 أيام
قبل ساعة واحدة من تفعيل ميزة "استعادة البيانات إلى نقطة زمنية"
تم تفعيلها قبل أكثر من 7 أيام
قبل 7 أيام من وقت طلب القراءة
يتم الاحتفاظ بإصدار واحد كل دقيقة في فترة استرداد البيانات في نقطة زمنية محددة. يمكنك قراءة المستندات بدقة تصل إلى دقيقة واحدة باستخدام طابع زمني كامل بالدقائق. ستعرض القراءات التي لا تتضمّن دقة على مستوى الدقيقة، مثل 2023-05-30 09:00:00.1234AM، خطأً يفيد بأنّ read_time قديم جدًا.
يتم الاحتفاظ بنسخة واحدة فقط من المستند في حال عمليات الكتابة المتعددة. على سبيل المثال، إذا كان المستند يتضمّن عمليات كتابة متعدّدة تتراوح بين v1, v2, ... vk بين الطابع الزمني 2023-05-30 09:00:00AM (باستثناء) والطابع الزمني 2023-05-30 09:01:00AM (شامل)، سيعرض طلب القراءة في الطابع الزمني 2023-05-30 09:01:00AM الإصدار vk من المستند.
يمكنك القراءة من البيانات التي تم إنشاؤها خلال فترة استعادة البيانات إلى نقطة زمنية محددة. يتم تخزين البيانات بدقة تصل إلى دقيقة واحدة، ويمكنك استرداد البيانات بالدقة نفسها. تكون ميزة "الاستعادة إلى نقطة زمنية" غير مفعّلة تلقائيًا.
يحدّد الحقل earliestVersionTime في قاعدة البيانات
أول وقت مسموح به لقراءة بياناتك.
بغض النظر عمّا إذا كانت ميزة "استعادة البيانات في نقطة زمنية" مفعّلة أم لا، يمكنك قراءة المستندات (ولكن ليس تصديرها) في أي طابع زمني بدقة أجزاء من الثانية خلال الساعة الماضية، ولكن ليس قبل earliestVersionTime.
طُرق استرداد البيانات
هناك عدة طرق لاسترداد البيانات:
لاسترداد جزء من قاعدة البيانات،
نفِّذ قراءة قديمة
مع تحديد شرط طلب بحث أو استخدام بحث مباشر عن المفتاح مع طابع زمني في
الماضي،
ثم أعد كتابة النتائج في قاعدة البيانات النشطة. ويُستخدم هذا الإجراء عادةً في العمليات الجراحية على قاعدة بيانات نشطة. على سبيل المثال، إذا حذفت مستندًا معيّنًا عن طريق الخطأ أو عدّلت مجموعة فرعية من البيانات بشكل غير صحيح، يمكنك استردادها باستخدام هذه الطريقة. للحصول على التعليمات، يُرجى الاطّلاع على مقالة
استرداد جزء من قاعدة البيانات.
لاسترداد قاعدة البيانات بأكملها، استخدِم أحد الخيارَين التاليَين:
صدِّر قاعدة البيانات وحدِّد طابعًا زمنيًا في الماضي، ثم استورِدها إلى قاعدة بيانات جديدة. تتيح عملية تصدير PITR استخدام جميع الفلاتر، بما في ذلك تصدير جميع المستندات وتصدير مجموعات معيّنة.
يمكنك استنساخ بيانات الاستعادة إلى نقطة زمنية أو تصديرها عندما يكون الطابع الزمني طابعًا زمنيًا لدقيقة كاملة خلال الأيام السبعة الماضية، ولكن ليس قبل earliestVersionTime.
الأسعار
يُرجى الاطّلاع على معلومات الأسعار التالية قبل تفعيل ميزة "استعادة البيانات إلى نقطة زمنية" لقاعدة البيانات:
مساحة التخزين: تقيس خدمة Cloud Firestore المتوافقة مع MongoDB حجم قاعدة البيانات يوميًا. على مدار شهر، يتم حساب متوسط نقاط العيّنات هذه لاحتساب حجم مساحة التخزين في قاعدة البيانات. يتم ضرب هذه القيمة المتوسطة في سعر الوحدة لعملية الاستعادة إلى نقطة زمنية سابقة (غيغابايت في الشهر). لمزيد من المعلومات، يُرجى الاطّلاع على أسعار مساحة التخزين.
لا تتوفّر طبقة مجانية لمساحة تخزين PITR، ويجب تفعيل الفوترة إذا كنت تريد استخدام PITR.
احتساب الفواتير: أي طلبات بحث تجريها خلال فترة استرداد البيانات السابقة لمدة 7 أيام، سواء من خلال عمليات القراءة القديمة أو عمليات التصدير، تتكبّد تكاليف عمليات القراءة استنادًا إلى عدد المستندات التي تتم قراءتها. يمكنك الاطّلاع على الأسعار لمزيد من المعلومات.
الحدّ الأدنى للفوترة: قد يتم تحصيل رسوم منك تصل إلى تكلفة تخزين ليوم واحد من ميزة "استعادة البيانات إلى نقطة زمنية" حتى إذا أوقفتها في غضون يوم واحد من تفعيلها.
تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-05 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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)."]]