AWS re:Post을(를) 사용하면 다음에 동의하게 됩니다. AWS re:Post 이용 약관

Amazon DocumentDB - Item Level Recovery

0

Hi All,

is it possible item level recovery in document db, i don't see options in console. we have only taking backup and restore cluster , instance from snapshot. Could someone please help on this, how we can do the item level recovery in document db (i.e, missing collections or tables or indexs)

Thanks, Bhargav.

  • please accept the answer if it was useful

질문됨 6달 전232회 조회
1개 답변
0

Amazon DocumentDB does not provide built-in item-level recovery directly through the console. However, you can achieve item-level recovery using the following approaches:

1. Point-in-Time Restore (PITR) and Manual Extraction

Restore a Cluster to a Point in Time:

  • Use the DocumentDB console or AWS CLI to restore your cluster to a point in time before the item(s) were deleted.
  • This creates a new cluster with the data as it existed at the specified time.

Extract the Needed Data:

  • Connect to the new cluster and manually extract the items, collections, tables, or indexes that you need.
  • Use MongoDB tools like mongodump and mongorestore to transfer the required data back to your original cluster.

2. Use of Change Streams for Tracking and Recovery

  • If you have enabled change streams on your collections, you can use them to track changes to the data in real-time.
  • This allows you to capture deletions and modifications, making it possible to manually reconstruct the data if needed.

3. Custom Backup and Restore Logic

  • Implement custom logic to periodically back up critical collections or documents at the application level.
  • Store these backups in S3 or another storage service, allowing you to restore individual items when necessary.

Example of Restoring Using PITR

Here's a step-by-step example of how to restore a collection from a snapshot:

aws docdb restore-db-cluster-to-point-in-time \
    --source-db-cluster-identifier my-cluster \
    --target-db-cluster-identifier my-cluster-restore \
    --restore-to-time 2023-06-01T12:00:00Z

Connect to the Restored Cluster:

Use your MongoDB client or tools like mongosh to connect to the newly restored cluster.

Extract the Required Data:

mongodump --uri mongodb://restored-cluster-endpoint:27017 --db your_db --collection your_collection --out /path/to/dump

Restore the Data to the Original Cluster:

mongorestore --uri mongodb://original-cluster-endpoint:27017 --db your_db --collection your_collection /path/to/dump/your_db/your_collection.bson

Summary While Amazon DocumentDB does not support direct item-level recovery, using point-in-time restores, change streams, and custom backup logic allows you to achieve the same goal. For critical applications, consider implementing a comprehensive backup strategy to minimize data loss and facilitate recovery.

profile picture
전문가
답변함 6달 전
profile picture
전문가
검토됨 6달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠