SlideShare a Scribd company logo
1 of 43
Download to read offline
MongoDB Backups and PITR
Igor Donchovski
May-23-2023
© Pythian Services Inc 2023 | Confidential|
About me
---
Name: Igor Donchovski
Company: Pythian
Email: donchovski@pythian.com
Current_Role: Principle Consultant
Education:
- Type: Master
Name: FINKI
Graduated: 2013
University: UKIM
Certificates:
- MongoDB: C100DBA
- Oracle:
- MySQL 5.7 Professional
- OCI Foundations Associate
- HashiCorp: Terraform Associate (002)
- Google: PCA
Social:
- Network: LinkedIn
url: https://mk.linkedin.com/in/igorle
- Network: Twitter
url: https://twitter.com/igorle
© Pythian Services Inc 2023 | Confidential | 2
25
Years in Business
450+
Experts across every Data Domain & Technology
400+
Global Customers
_______________
Gold Partner
40+ Certifications
5 Competencies,
Incl. Data Analytics
and Data Platform
_______________
Silver Partner
50+ Certifications
Migration Factory
Certified Apps
Hosting
_______________
Advanced Partner
1O0+ Certs/Accreds
Migration & DevOps
Competencies
Pythian overview
________________
Premier Partner
120+ Certs/Creds
6 Specializations, MSP
Badge, Partner &
Technical Advisory Bds
Pythian maximizes the value of your data estate by delivering advanced on-prem, hybrid, cloud, and
multi-cloud solutions and solving your toughest data and analytics challenges.
_______________
Select Partner
10+ Certs/Accreds
_______________
Platinum Partner
60+ Certifications
Advisory Board
Member
© Pythian Services Inc 2023 | Confidential | 3
Overview
• Why Backups
• RTO and RPO
• Types of backups
• MongoDB specifics
• PITR
• ChatGPT feedback
• QA
© Pythian Services Inc 2023 | Confidential | 4
Why Backups
© Pythian Services Inc 2023 | Confidential | 5
Why Backups
© Pythian Services Inc 2023 | Confidential | 6
High Availability
Disast r Re ov ry
Scalability
Elasticity
Auto ation
Performance
● Power outage
● Software issues
● Hardware failure
● User error
● Network outages
● Natural disaster
● Other
Why Backups
© Pythian Services Inc 2023 | Confidential | 7
High Availability
Scalability
Elasticity
Disast r Re ov ry
Performance
● RTO - recovery time objective
○ How long it will take to recover?
● RPO - recovery point objective
○ How much data can we lose?
Why Backups
© Pythian Services Inc 2023 | Confidential | 8
TIME
Disaster
RTO
RPO
LOST DATA DOWNTIME
Types of Backups
© Pythian Services Inc 2023 | Confidential | 9
Types of Backups
Logical
• Easy to implement
• Human readable
• Slow for larger dataset
• Might affect database performance
• mongodump (Binary export. Does not contain the index data)
• mongoexport (json or csv export for collection)
• Works with Replica sets and Sharded clusters
© Pythian Services Inc 2023 | Confidential | 10
Types of Backups
Physical
• Moderate to implement
• Cold or hot
• Filesystem copy (cp, rsync)
• LVM Snapshot
• Cloud based disk snapshot
• Percona backup for MongoDB
• MongoDB Cloud manager or Ops manager
© Pythian Services Inc 2023 | Confidential | 11
● Sharded clusters
● Replica sets
Types of Backups - MongoDB
© Pythian Services Inc 2023 | Confidential | 12
● Replica sets
Types of Backups - MongoDB
© Pythian Services Inc 2023 | Confidential | 13
● Sharded clusters
Logical Backups
© Pythian Services Inc 2023 | Confidential | 14
Logical Backup
• mongodump
mongodump --host mongodb1.example.net --port 27017 --username user --password pass --oplog
--out /backup/mongodump-2023-05-23
Optional
--db Specifies the database to backup. Does not work with --oplog
--collection Specifies the collection to backup
--query Limits the documents returned in the output
--gzip Compresses the output
--numParallelCollections=N (No of collections to export in parallel. Default to 4)
• mongorestore
mongorestore --host mongodb1.example.net --port 27017 --username user --password pass
--OplogReplay --oplogLimit <timestamp> /backup/mongodump-2023-05-23
© Pythian Services Inc 2023 | Confidential | 15
Logical Backup
• mongoexport
mongoexport --host mongodb1.example.net --port 27017 --username user --password pass --db
marketing --collection contacts --out /backups/contacts.json
Optional
--csv Changes the export format to CSV
--fields Specifies a field or fields to include in the export
--query Limits the documents returned in the output
• mongoimport
mongoimport --host mongodb1.example.net --port 27017 --username user --password pass --db
marketing --collection contacts --file /backups/contacts.json
© Pythian Services Inc 2023 | Confidential | 16
Physical Backups
© Pythian Services Inc 2023 | Confidential | 17
Physical Backups
● Run on a Secondary node for replica set (Hidden, Delayed)
● Lock the database for writes
> db.fsyncLock()
● Take backup from the disk[s] relevant for mongo
● Grab the latest oplog position (optional)
● Unlock the database for writes
> db.fsyncUnlock()
● Copy the backup to offsite location
© Pythian Services Inc 2023 | Confidential | 18
Physical Backups
Filesystem copy (cp, rsync)
● Stop mongod process
● Rsync or cp the files to external location
$ rsync -av --partial --inplace --append --progress
user@mongodb1.example.net:/backups/mongodb
● Start mongod process
● Might take a while for large datasets
© Pythian Services Inc 2023 | Confidential | 19
Physical Backups
LVM snapshot
● Hot backup on running mongod
> db.fsyncLock()
lvcreate -L5G -s -n mongosnap_23may2023 /dev/vgdiskdata/lvmongo
➔ /dev/vgdiskdata/lvmongo - Logical volume path
➔ lvmongo - LV Name
➔ -L Size of the snapshot
➔ -s It’s a snapshot
➔ -n Name for the snapshot
© Pythian Services Inc 2023 | Confidential | 20
Physical Backups
LVM snapshot
mkdir /tmp/mongosnap
mount -t xfs -o nouuid,ro /dev/vgdiskdata/mongosnap_23may2023 /tmp/mongosnap/
> db.fsyncUnlock()
tar -czf /backups/mongodb_backup_$(date '+%Y%m%d%H%M').tar.gz --absolute-names
/tmp/mongosnap
umount /tmp/mongosnap
lvremove /dev/vgdiskdata/mongosnap_23may2023
© Pythian Services Inc 2023 | Confidential | 21
Physical Backups
Cloud based disk snapshot
AWS
aws ec2 create-snapshot --volume-id VOLUME-ID --description "This is my mongo
volume snapshot"
GCP
gcloud compute snapshots create SNAPSHOT_NAME --source-disk SOURCE_DISK
--source-disk-zone SOURCE_DISK_ZONE
Azure
az snapshot create -g ResourceGroup --source MONGO-DISK-ID --name mongoDisk-bak
© Pythian Services Inc 2023 | Confidential | 22
Physical Backups
Percona backup for MongoDB
● Logical and physical backups and restores
● Selective logical backups and restores with PITR
● Works for both sharded clusters and non-sharded replica sets
● Can be used with any S3-compatible storage
● Support for Microsoft Azure Blob storage
● Supports filesystem storage type for locally mounted remote filesystem
backup servers
© Pythian Services Inc 2023 | Confidential | 23
Physical Backups
PBM Architecture
● pbm-agent is a process running on every mongod node within the cluster or a replica
set that performs backup and restore operations
● pbm CLI is a command-line utility that instructs pbm-agents to perform an operation
● PBM Control collections are special collections in MongoDB that store the
configuration data and backup states
● Remote backup storage as either s3-compatible or filesystem type storage
pbm backup --type=logical|physical --compression=gzip
© Pythian Services Inc 2023 | Confidential | 24
Physical Backups
MongoDB Cloud manager backup
© Pythian Services Inc 2023 | Confidential | 25
Physical Backups
MongoDB Cloud manager backup
● Requires monthly subscription based on snapshot size, schedule, and retention policy
● Install the backup agent and configure in cloud.mongodb.com
● Optional namespace filter to exclude collections from the backup
● Point in time recovery with low overhead
● Data transfer to Cloud manager datacenters is encrypted
● Stores at least 3 copies of your data in at least 2 geographic locations to ensure
redundancy
● Only works with deployments of up to 100k collections
● Snapshot lowest frequency of 6 hours
© Pythian Services Inc 2023 | Confidential | 26
Physical Backups
MongoDB Ops manager backup
● Must run with MongoDB enterprise
● Works with deployments of up to 100k
collections
● Replica set, sharded cluster, and shard
names within the same project must be
unique
© Pythian Services Inc 2023 | Confidential | 27
PITR
© Pythian Services Inc 2023 | Confidential | 28
PITR
© Pythian Services Inc 2023 | Confidential | 29
TIME
RTO
LOST DATA DOWNTIME
Full backup
RPO
Disaster
PITR
Incremental backups
© Pythian Services Inc 2023 | Confidential | 30
TIME
RTO
Full backup LOST DATA DOWNTIME
Inc backup
Disaster
PITR
Incremental backups
● RPO ~ 0
© Pythian Services Inc 2023 | Confidential | 31
TIME
RTO
Full backup LOST
DATA
DOWNTIME
Inc 1 Inc 2 Inc 3 Inc n
Disaster
PITR
Full backup: lvm snapshot + Incremental backups using the Oplog
root @mongodb: ~# mongo - u < username > -p < password > --port < port > --quiet backup_oplog_ts.js > oplog_position
cat backup_oplog_ts.js
var local = db.getSiblingDB('local');
var last = local['oplog.rs'].find().sort({
'$natural': -1
}).limit(1)[0];
var result = {};
if (last != null) {
result = {
position: last['ts']
};
}
print(JSON.stringify(result));
© Pythian Services Inc 2023 | Confidential | 32
TIME
Full backup
"$timestamp": {"t": 1666355398,"i": 1}
PITR
Oplog backup using mongodump
Inc 1 start position
{"position": {"$timestamp": {"t": 1666355398,"i": 1}}}
mongodump --quiet -u < username > -p < password > --port < port > --authenticationDatabase = admin - d local - c oplog.rs --query='{"ts": {
"$gt": {"$timestamp":{"t":1666355398,"i":1}}}}' -o/backups/mongo_20230523/incremental_1
Inc 2 start position (end of Inc 1)
bsondump --quiet /backup/mongo_20230523/incremental_1/local/oplog.rs.bson | tail -1 | jq -c .ts
{"$timestamp": {"t": 1666616998, "i": 1 }}
© Pythian Services Inc 2023 | Confidential | 33
TIME
Full backup
Inc 1
PITR
Inc 2
{"position": {"$timestamp": {"t": 1666616998,"i": 1}}}
mongodump --quiet -u < username > -p < password > --port < port > --authenticationDatabase=admin -d local -c oplog.rs --query='{"ts": { "$gt":
{"$timestamp":{"t":1666616998,"i":1}}}}' -o /backups/mongo_20230523/incremental_2
Inc 3 start position (end of Inc 2)
bsondump --quiet/backup/mongo_20230523/incremental_2/local/oplog.rs.bson | tail -1 | jq -c .ts
{"$timestamp": {"t": 1666617939,"i": 1}}
© Pythian Services Inc 2023 | Confidential | 34
TIME
Full backup
Inc 1 Inc 2 Inc 3 Inc n
PITR
Inc 3
{"position": {"$timestamp": {"t": 1666617939,"i": 1}}}
mongodump --quiet -u < username > -p < password > --port < port > --authenticationDatabase=admin -d local -c oplog.rs --query='{"ts": { "$gt":
{"$timestamp":{"t":1666617939,"i":1}}}}' -o /backups/mongo_20230523/incremental_3
Inc n position: (Inc(n) = Between Inc(n-1) and Full backup(m) )
{"ts": {"$gt": {"$timestamp": {"t": 1666619908,"i": 1}}, "$lte": {"$timestamp": {"t": 1666619998,"i": 1}}}}
© Pythian Services Inc 2023 | Confidential | 35
TIME
Full backup(n)
Inc 1 Inc 2 Inc 3 Inc n
Full backup(m)
PITR
Full backup : 1pm
Incremental backups: every 1 hour
4:30pm - Delete operation on users.meta namespace
© Pythian Services Inc 2023 | Confidential | 36
TIME
Disaster
RTO
Full backup(n)
DOWNTIME
Inc 1 Inc 2 Inc 3 Inc n
RPO
PITR
Identify the erroneous operation start time
bsondump --quiet /backup/mongo_20230523/oplog_4/local/oplog.rs.bson | grep '"op":"d","ns":"users.meta"' {"op": "d","ns": "users.meta","ui":
{"$binary": {"base64": "ZlkpNQpySoG98UFLQvYZnw==","subType": "04"}},"o": {"_id": {"$oid": "636a7cd663089cc37ae7c96c"}},"ts": {"$timestamp":
{"t": 1684859539,"i": 1}},"t": {"$numberLong": "6"},"v": {"$numberLong": "2"},"wall":{"$date": {"$numberLong": "1667917939452"}}}
Erroneous operation : "ts": {"$timestamp": {"t": 1684859539,"i": 1}}
© Pythian Services Inc 2023 | Confidential | 37
TIME
RTO
Full backup(n)
DOWNTIME
Inc 1 Inc 2 Inc 3 Inc n
RPO
Disaster
PITR
Restore the Full backup(n)
Restore the incremental backups using mongorestore --oplogReplay
cp /backup/mongo_20230523/oplog_1/local/oplog.rs.bson /backup/oplogR1/oplog.bson
mongorestore --port 57017 –u < username > -p < password > --authenticationDatabase=admin --oplogReplay /backup/oplogR1
© Pythian Services Inc 2023 | Confidential | 38
TIME
RTO
Full backup(n)
DOWNTIME
Inc 1 Inc 2 Inc 3 Inc n
RPO
Disaster
PITR
Erroneous operation : "ts": {"$timestamp": {"t": 1684859539,"i": 1}}
Restore the final incremental backup using mongorestore --oplogReplay --oplogLimit
cp /backup/mongo_20230523/oplog_4/local/oplog.rs.bson /backup/oplog4/oplog.bson
mongorestore --port 57017 -u < username > -p < password > --authenticationDatabase=admin --oplogReplay --oplogLimit 1684859539, 1 /backup/oplog4
© Pythian Services Inc 2023 | Confidential | 39
TIME
RTO >= 0
Full backup(n)
DOWNTIME
Inc 1 Inc 2 Inc 3 Inc n
RPO=0
Disaster
Summary
• Run backups as part of your organization’s DR strategy
• Logical backups work well with smaller DB size, for larger DBs use physical
• Backups are only good as long as they can be restored
• For Replica sets run backups on a MongoDB Secondary node (hidden or
delayed member)
• For Sharded clusters you need to backup each shard and the config servers
metadata while the balancer is stopped
• Cloud manager/Ops manager backup are enterprise licenced
• Full physical backup and incremental oplog backups will allow you PITR
• RPO ~ 0 means you need to take backups more frequently
• RTO ~ 0 means you need to invest in automating the restore
© Pythian Services Inc 2023 | Confidential | 40
ChatGPT - Explain best practices for MongoDB backups and PITR
MongoDB backups and point-in-time recovery (PITR) are critical aspects of ensuring data availability and recovery in the event of data loss or system failure.
Here are some best practices to consider when performing backups and PITR in MongoDB:
1. Choose the right backup strategy: MongoDB offers several backup strategies, including file system backups, logical backups, and
continuous backups. Choose the right backup strategy based on your business requirements, data size, and recovery objectives.
2. Set backup schedules and retention periods: Create a backup schedule that fits your business needs and set a retention period that
aligns with your recovery objectives. Ensure that you have enough backup storage to retain backups for the desired duration.
3. Use replica sets: MongoDB replica sets provide high availability and data redundancy. By configuring a replica set, you can create
multiple copies of your data across different nodes. This ensures that you always have a copy of your data available for recovery.
4. Enable journaling: Journaling is a feature that ensures data consistency and durability. By enabling journaling, MongoDB can recover
data from incomplete write operations in the event of a system failure.
5. Monitor backup performance: Monitor backup performance to ensure that backups are completed within the scheduled window. Use
tools such as MongoDB Management Service (MMS) to monitor backup status and performance.
6. Test backups regularly: Regularly test your backups to ensure that you can restore your data when needed. Perform a full restore
from a backup to a separate environment to test backup integrity and recovery procedures.
7. Implement PITR: Point-in-time recovery (PITR) allows you to restore your database to a specific point in time. This can be useful
when you need to recover from a data corruption or user error. Ensure that you have enabled oplog (operation log) to enable PITR.
8. Use automation: Use automation tools to simplify backup and PITR operations. Tools such as MongoDB Ops Manager and MongoDB
Atlas provide automated backup and recovery processes.
By following these best practices, you can ensure that your MongoDB backups and PITR processes are reliable and effective in maintaining data
availability and recovery.
© Pythian Services Inc 2023 | Confidential | 41
Thank you!
© Pythian Services Inc 2023 | Confidential| 41
References
How to backup MongoDB database using lvm snapshots - Part 1
MongoDB incremental backups using the oplog - Part 2
MongoDB Backups and Point In Time Recovery - Part 3
Percona Backup for MongoDB Documentation
FAQ: Backup and Restore — MongoDB Cloud Manager
FAQ: Backup and Restore — MongoDB Ops Manager
MongoDB Backup and Restore - Best Practices and Techniques
© Pythian Services Inc 2023 | Confidential | 43

More Related Content

What's hot

Percona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio CodePercona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio CodeFrederic Descamps
 
OrientDB Distributed Architecture v2.0
OrientDB Distributed Architecture v2.0OrientDB Distributed Architecture v2.0
OrientDB Distributed Architecture v2.0Orient Technologies
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQLMydbops
 
MySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to HaveMySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to HaveSveta Smirnova
 
Oracle GoldenGate 19c を使用した 簡単データベース移行ガイド_v1.0
Oracle GoldenGate 19c を使用した 簡単データベース移行ガイド_v1.0Oracle GoldenGate 19c を使用した 簡単データベース移行ガイド_v1.0
Oracle GoldenGate 19c を使用した 簡単データベース移行ガイド_v1.0オラクルエンジニア通信
 
ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)Mydbops
 
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022HostedbyConfluent
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMongoDB
 
High Availability for Oracle SE2
High Availability for Oracle SE2High Availability for Oracle SE2
High Availability for Oracle SE2Markus Flechtner
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101MongoDB
 
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfMySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfAlkin Tezuysal
 
Oracle 12c Multitenant architecture
Oracle 12c Multitenant architectureOracle 12c Multitenant architecture
Oracle 12c Multitenant architecturenaderattia
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained Mydbops
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewRené Cannaò
 
Building Lakehouses on Delta Lake with SQL Analytics Primer
Building Lakehouses on Delta Lake with SQL Analytics PrimerBuilding Lakehouses on Delta Lake with SQL Analytics Primer
Building Lakehouses on Delta Lake with SQL Analytics PrimerDatabricks
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 
PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensour...
PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensour...PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensour...
PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensour...Mydbops
 

What's hot (20)

Percona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio CodePercona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio Code
 
OrientDB Distributed Architecture v2.0
OrientDB Distributed Architecture v2.0OrientDB Distributed Architecture v2.0
OrientDB Distributed Architecture v2.0
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQL
 
MySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to HaveMySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to Have
 
Oracle GoldenGate 19c を使用した 簡単データベース移行ガイド_v1.0
Oracle GoldenGate 19c を使用した 簡単データベース移行ガイド_v1.0Oracle GoldenGate 19c を使用した 簡単データベース移行ガイド_v1.0
Oracle GoldenGate 19c を使用した 簡単データベース移行ガイド_v1.0
 
ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)
 
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
Introducing KRaft: Kafka Without Zookeeper With Colin McCabe | Current 2022
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
High Availability for Oracle SE2
High Availability for Oracle SE2High Availability for Oracle SE2
High Availability for Oracle SE2
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101
 
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfMySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
 
Oracle 12c Multitenant architecture
Oracle 12c Multitenant architectureOracle 12c Multitenant architecture
Oracle 12c Multitenant architecture
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained
 
MongoDB Backup & Disaster Recovery
MongoDB Backup & Disaster RecoveryMongoDB Backup & Disaster Recovery
MongoDB Backup & Disaster Recovery
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview
 
Building Lakehouses on Delta Lake with SQL Analytics Primer
Building Lakehouses on Delta Lake with SQL Analytics PrimerBuilding Lakehouses on Delta Lake with SQL Analytics Primer
Building Lakehouses on Delta Lake with SQL Analytics Primer
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensour...
PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensour...PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensour...
PostgreSQL 15 and its Major Features -(Aakash M - Mydbops) - Mydbops Opensour...
 

Similar to Here are the key points about Point-in-Time Recovery (PITR) with MongoDB:- PITR allows restoring a database to a previous point in time by replaying oplog entries or incremental backups.- It works by taking full backups periodically and capturing oplog/incremental changes between full backups. - During restore, you first restore from the full backup, then replay oplog/incrementals to roll data forward to the desired point in time.- This allows recovering to any point between full backups, with a recovery point objective (RPO) equal to the frequency of increments. - MongoDB's oplog provides a log of all changes made to a replica set and is used

Percona Live 2022 - PBM - The Backup Open Source Tool for MongoDB
Percona Live 2022 - PBM - The Backup Open Source Tool for MongoDBPercona Live 2022 - PBM - The Backup Open Source Tool for MongoDB
Percona Live 2022 - PBM - The Backup Open Source Tool for MongoDBJean Da Silva
 
Time series denver an introduction to prometheus
Time series denver   an introduction to prometheusTime series denver   an introduction to prometheus
Time series denver an introduction to prometheusBob Cotton
 
OSMC 2021 | pg_stat_monitor: A cool extension for better database (PostgreSQL...
OSMC 2021 | pg_stat_monitor: A cool extension for better database (PostgreSQL...OSMC 2021 | pg_stat_monitor: A cool extension for better database (PostgreSQL...
OSMC 2021 | pg_stat_monitor: A cool extension for better database (PostgreSQL...NETWAYS
 
Protecting data with CSI Volume Snapshots on Kubernetes
Protecting data with CSI Volume Snapshots on KubernetesProtecting data with CSI Volume Snapshots on Kubernetes
Protecting data with CSI Volume Snapshots on KubernetesDoKC
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesJimmy Angelakos
 
Introduction to PaaS and Heroku
Introduction to PaaS and HerokuIntroduction to PaaS and Heroku
Introduction to PaaS and HerokuTapio Rautonen
 
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...NTT DATA Technology & Innovation
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Severalnines
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSPostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSVMware Tanzu
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSPostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSCarlos Andrés García
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for PostgresEDB
 
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias CrauwelsOSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias CrauwelsNETWAYS
 
Oracle EBS Journey to the Cloud - What is New in 2022 (UKOUG Breakthrough 22 ...
Oracle EBS Journey to the Cloud - What is New in 2022 (UKOUG Breakthrough 22 ...Oracle EBS Journey to the Cloud - What is New in 2022 (UKOUG Breakthrough 22 ...
Oracle EBS Journey to the Cloud - What is New in 2022 (UKOUG Breakthrough 22 ...Andrejs Prokopjevs
 
PGConf.ASIA 2019 Bali - Patroni in 2019 - Alexander Kukushkin
PGConf.ASIA 2019 Bali - Patroni in 2019 - Alexander KukushkinPGConf.ASIA 2019 Bali - Patroni in 2019 - Alexander Kukushkin
PGConf.ASIA 2019 Bali - Patroni in 2019 - Alexander KukushkinEqunix Business Solutions
 
DevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga #15: Agentless monitoring with icinga and prometheusDevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga #15: Agentless monitoring with icinga and prometheusDevOps Braga
 
Building an analytics workflow using Apache Airflow
Building an analytics workflow using Apache AirflowBuilding an analytics workflow using Apache Airflow
Building an analytics workflow using Apache AirflowYohei Onishi
 
Aerospike O&M Webinar.pptx
Aerospike O&M Webinar.pptxAerospike O&M Webinar.pptx
Aerospike O&M Webinar.pptxAerospike Inc
 
Online Upgrade Using Logical Replication
 Online Upgrade Using Logical Replication Online Upgrade Using Logical Replication
Online Upgrade Using Logical ReplicationEDB
 

Similar to Here are the key points about Point-in-Time Recovery (PITR) with MongoDB:- PITR allows restoring a database to a previous point in time by replaying oplog entries or incremental backups.- It works by taking full backups periodically and capturing oplog/incremental changes between full backups. - During restore, you first restore from the full backup, then replay oplog/incrementals to roll data forward to the desired point in time.- This allows recovering to any point between full backups, with a recovery point objective (RPO) equal to the frequency of increments. - MongoDB's oplog provides a log of all changes made to a replica set and is used (20)

Percona Live 2022 - PBM - The Backup Open Source Tool for MongoDB
Percona Live 2022 - PBM - The Backup Open Source Tool for MongoDBPercona Live 2022 - PBM - The Backup Open Source Tool for MongoDB
Percona Live 2022 - PBM - The Backup Open Source Tool for MongoDB
 
Time series denver an introduction to prometheus
Time series denver   an introduction to prometheusTime series denver   an introduction to prometheus
Time series denver an introduction to prometheus
 
OSMC 2021 | pg_stat_monitor: A cool extension for better database (PostgreSQL...
OSMC 2021 | pg_stat_monitor: A cool extension for better database (PostgreSQL...OSMC 2021 | pg_stat_monitor: A cool extension for better database (PostgreSQL...
OSMC 2021 | pg_stat_monitor: A cool extension for better database (PostgreSQL...
 
Protecting data with CSI Volume Snapshots on Kubernetes
Protecting data with CSI Volume Snapshots on KubernetesProtecting data with CSI Volume Snapshots on Kubernetes
Protecting data with CSI Volume Snapshots on Kubernetes
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on Kubernetes
 
Introduction to PaaS and Heroku
Introduction to PaaS and HerokuIntroduction to PaaS and Heroku
Introduction to PaaS and Heroku
 
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
 
Backups
BackupsBackups
Backups
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSPostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSPostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for Postgres
 
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias CrauwelsOSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
 
Video Analysis in Hadoop
Video Analysis in HadoopVideo Analysis in Hadoop
Video Analysis in Hadoop
 
Oracle EBS Journey to the Cloud - What is New in 2022 (UKOUG Breakthrough 22 ...
Oracle EBS Journey to the Cloud - What is New in 2022 (UKOUG Breakthrough 22 ...Oracle EBS Journey to the Cloud - What is New in 2022 (UKOUG Breakthrough 22 ...
Oracle EBS Journey to the Cloud - What is New in 2022 (UKOUG Breakthrough 22 ...
 
PGConf.ASIA 2019 Bali - Patroni in 2019 - Alexander Kukushkin
PGConf.ASIA 2019 Bali - Patroni in 2019 - Alexander KukushkinPGConf.ASIA 2019 Bali - Patroni in 2019 - Alexander Kukushkin
PGConf.ASIA 2019 Bali - Patroni in 2019 - Alexander Kukushkin
 
DevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga #15: Agentless monitoring with icinga and prometheusDevOps Braga #15: Agentless monitoring with icinga and prometheus
DevOps Braga #15: Agentless monitoring with icinga and prometheus
 
Building an analytics workflow using Apache Airflow
Building an analytics workflow using Apache AirflowBuilding an analytics workflow using Apache Airflow
Building an analytics workflow using Apache Airflow
 
Aerospike O&M Webinar.pptx
Aerospike O&M Webinar.pptxAerospike O&M Webinar.pptx
Aerospike O&M Webinar.pptx
 
Online Upgrade Using Logical Replication
 Online Upgrade Using Logical Replication Online Upgrade Using Logical Replication
Online Upgrade Using Logical Replication
 

More from Igor Donchovski

Sharding and things we'd like to see improved
Sharding and things we'd like to see improvedSharding and things we'd like to see improved
Sharding and things we'd like to see improvedIgor Donchovski
 
Maintenance for MongoDB Replica Sets
Maintenance for MongoDB Replica SetsMaintenance for MongoDB Replica Sets
Maintenance for MongoDB Replica SetsIgor Donchovski
 
Exploring the replication and sharding in MongoDB
Exploring the replication and sharding in MongoDBExploring the replication and sharding in MongoDB
Exploring the replication and sharding in MongoDBIgor Donchovski
 
MongoDB HA - what can go wrong
MongoDB HA - what can go wrongMongoDB HA - what can go wrong
MongoDB HA - what can go wrongIgor Donchovski
 
Enhancing the default MongoDB Security
Enhancing the default MongoDB SecurityEnhancing the default MongoDB Security
Enhancing the default MongoDB SecurityIgor Donchovski
 
Exploring the replication in MongoDB
Exploring the replication in MongoDBExploring the replication in MongoDB
Exploring the replication in MongoDBIgor Donchovski
 
Working with MongoDB as MySQL DBA
Working with MongoDB as MySQL DBAWorking with MongoDB as MySQL DBA
Working with MongoDB as MySQL DBAIgor Donchovski
 

More from Igor Donchovski (8)

Sharding and things we'd like to see improved
Sharding and things we'd like to see improvedSharding and things we'd like to see improved
Sharding and things we'd like to see improved
 
Maintenance for MongoDB Replica Sets
Maintenance for MongoDB Replica SetsMaintenance for MongoDB Replica Sets
Maintenance for MongoDB Replica Sets
 
Exploring the replication and sharding in MongoDB
Exploring the replication and sharding in MongoDBExploring the replication and sharding in MongoDB
Exploring the replication and sharding in MongoDB
 
How to scale MongoDB
How to scale MongoDBHow to scale MongoDB
How to scale MongoDB
 
MongoDB HA - what can go wrong
MongoDB HA - what can go wrongMongoDB HA - what can go wrong
MongoDB HA - what can go wrong
 
Enhancing the default MongoDB Security
Enhancing the default MongoDB SecurityEnhancing the default MongoDB Security
Enhancing the default MongoDB Security
 
Exploring the replication in MongoDB
Exploring the replication in MongoDBExploring the replication in MongoDB
Exploring the replication in MongoDB
 
Working with MongoDB as MySQL DBA
Working with MongoDB as MySQL DBAWorking with MongoDB as MySQL DBA
Working with MongoDB as MySQL DBA
 

Recently uploaded

Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 

Recently uploaded (20)

Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 

Here are the key points about Point-in-Time Recovery (PITR) with MongoDB:- PITR allows restoring a database to a previous point in time by replaying oplog entries or incremental backups.- It works by taking full backups periodically and capturing oplog/incremental changes between full backups. - During restore, you first restore from the full backup, then replay oplog/incrementals to roll data forward to the desired point in time.- This allows recovering to any point between full backups, with a recovery point objective (RPO) equal to the frequency of increments. - MongoDB's oplog provides a log of all changes made to a replica set and is used

  • 1. MongoDB Backups and PITR Igor Donchovski May-23-2023 © Pythian Services Inc 2023 | Confidential|
  • 2. About me --- Name: Igor Donchovski Company: Pythian Email: donchovski@pythian.com Current_Role: Principle Consultant Education: - Type: Master Name: FINKI Graduated: 2013 University: UKIM Certificates: - MongoDB: C100DBA - Oracle: - MySQL 5.7 Professional - OCI Foundations Associate - HashiCorp: Terraform Associate (002) - Google: PCA Social: - Network: LinkedIn url: https://mk.linkedin.com/in/igorle - Network: Twitter url: https://twitter.com/igorle © Pythian Services Inc 2023 | Confidential | 2
  • 3. 25 Years in Business 450+ Experts across every Data Domain & Technology 400+ Global Customers _______________ Gold Partner 40+ Certifications 5 Competencies, Incl. Data Analytics and Data Platform _______________ Silver Partner 50+ Certifications Migration Factory Certified Apps Hosting _______________ Advanced Partner 1O0+ Certs/Accreds Migration & DevOps Competencies Pythian overview ________________ Premier Partner 120+ Certs/Creds 6 Specializations, MSP Badge, Partner & Technical Advisory Bds Pythian maximizes the value of your data estate by delivering advanced on-prem, hybrid, cloud, and multi-cloud solutions and solving your toughest data and analytics challenges. _______________ Select Partner 10+ Certs/Accreds _______________ Platinum Partner 60+ Certifications Advisory Board Member © Pythian Services Inc 2023 | Confidential | 3
  • 4. Overview • Why Backups • RTO and RPO • Types of backups • MongoDB specifics • PITR • ChatGPT feedback • QA © Pythian Services Inc 2023 | Confidential | 4
  • 5. Why Backups © Pythian Services Inc 2023 | Confidential | 5
  • 6. Why Backups © Pythian Services Inc 2023 | Confidential | 6 High Availability Disast r Re ov ry Scalability Elasticity Auto ation Performance
  • 7. ● Power outage ● Software issues ● Hardware failure ● User error ● Network outages ● Natural disaster ● Other Why Backups © Pythian Services Inc 2023 | Confidential | 7 High Availability Scalability Elasticity Disast r Re ov ry Performance
  • 8. ● RTO - recovery time objective ○ How long it will take to recover? ● RPO - recovery point objective ○ How much data can we lose? Why Backups © Pythian Services Inc 2023 | Confidential | 8 TIME Disaster RTO RPO LOST DATA DOWNTIME
  • 9. Types of Backups © Pythian Services Inc 2023 | Confidential | 9
  • 10. Types of Backups Logical • Easy to implement • Human readable • Slow for larger dataset • Might affect database performance • mongodump (Binary export. Does not contain the index data) • mongoexport (json or csv export for collection) • Works with Replica sets and Sharded clusters © Pythian Services Inc 2023 | Confidential | 10
  • 11. Types of Backups Physical • Moderate to implement • Cold or hot • Filesystem copy (cp, rsync) • LVM Snapshot • Cloud based disk snapshot • Percona backup for MongoDB • MongoDB Cloud manager or Ops manager © Pythian Services Inc 2023 | Confidential | 11
  • 12. ● Sharded clusters ● Replica sets Types of Backups - MongoDB © Pythian Services Inc 2023 | Confidential | 12
  • 13. ● Replica sets Types of Backups - MongoDB © Pythian Services Inc 2023 | Confidential | 13 ● Sharded clusters
  • 14. Logical Backups © Pythian Services Inc 2023 | Confidential | 14
  • 15. Logical Backup • mongodump mongodump --host mongodb1.example.net --port 27017 --username user --password pass --oplog --out /backup/mongodump-2023-05-23 Optional --db Specifies the database to backup. Does not work with --oplog --collection Specifies the collection to backup --query Limits the documents returned in the output --gzip Compresses the output --numParallelCollections=N (No of collections to export in parallel. Default to 4) • mongorestore mongorestore --host mongodb1.example.net --port 27017 --username user --password pass --OplogReplay --oplogLimit <timestamp> /backup/mongodump-2023-05-23 © Pythian Services Inc 2023 | Confidential | 15
  • 16. Logical Backup • mongoexport mongoexport --host mongodb1.example.net --port 27017 --username user --password pass --db marketing --collection contacts --out /backups/contacts.json Optional --csv Changes the export format to CSV --fields Specifies a field or fields to include in the export --query Limits the documents returned in the output • mongoimport mongoimport --host mongodb1.example.net --port 27017 --username user --password pass --db marketing --collection contacts --file /backups/contacts.json © Pythian Services Inc 2023 | Confidential | 16
  • 17. Physical Backups © Pythian Services Inc 2023 | Confidential | 17
  • 18. Physical Backups ● Run on a Secondary node for replica set (Hidden, Delayed) ● Lock the database for writes > db.fsyncLock() ● Take backup from the disk[s] relevant for mongo ● Grab the latest oplog position (optional) ● Unlock the database for writes > db.fsyncUnlock() ● Copy the backup to offsite location © Pythian Services Inc 2023 | Confidential | 18
  • 19. Physical Backups Filesystem copy (cp, rsync) ● Stop mongod process ● Rsync or cp the files to external location $ rsync -av --partial --inplace --append --progress user@mongodb1.example.net:/backups/mongodb ● Start mongod process ● Might take a while for large datasets © Pythian Services Inc 2023 | Confidential | 19
  • 20. Physical Backups LVM snapshot ● Hot backup on running mongod > db.fsyncLock() lvcreate -L5G -s -n mongosnap_23may2023 /dev/vgdiskdata/lvmongo ➔ /dev/vgdiskdata/lvmongo - Logical volume path ➔ lvmongo - LV Name ➔ -L Size of the snapshot ➔ -s It’s a snapshot ➔ -n Name for the snapshot © Pythian Services Inc 2023 | Confidential | 20
  • 21. Physical Backups LVM snapshot mkdir /tmp/mongosnap mount -t xfs -o nouuid,ro /dev/vgdiskdata/mongosnap_23may2023 /tmp/mongosnap/ > db.fsyncUnlock() tar -czf /backups/mongodb_backup_$(date '+%Y%m%d%H%M').tar.gz --absolute-names /tmp/mongosnap umount /tmp/mongosnap lvremove /dev/vgdiskdata/mongosnap_23may2023 © Pythian Services Inc 2023 | Confidential | 21
  • 22. Physical Backups Cloud based disk snapshot AWS aws ec2 create-snapshot --volume-id VOLUME-ID --description "This is my mongo volume snapshot" GCP gcloud compute snapshots create SNAPSHOT_NAME --source-disk SOURCE_DISK --source-disk-zone SOURCE_DISK_ZONE Azure az snapshot create -g ResourceGroup --source MONGO-DISK-ID --name mongoDisk-bak © Pythian Services Inc 2023 | Confidential | 22
  • 23. Physical Backups Percona backup for MongoDB ● Logical and physical backups and restores ● Selective logical backups and restores with PITR ● Works for both sharded clusters and non-sharded replica sets ● Can be used with any S3-compatible storage ● Support for Microsoft Azure Blob storage ● Supports filesystem storage type for locally mounted remote filesystem backup servers © Pythian Services Inc 2023 | Confidential | 23
  • 24. Physical Backups PBM Architecture ● pbm-agent is a process running on every mongod node within the cluster or a replica set that performs backup and restore operations ● pbm CLI is a command-line utility that instructs pbm-agents to perform an operation ● PBM Control collections are special collections in MongoDB that store the configuration data and backup states ● Remote backup storage as either s3-compatible or filesystem type storage pbm backup --type=logical|physical --compression=gzip © Pythian Services Inc 2023 | Confidential | 24
  • 25. Physical Backups MongoDB Cloud manager backup © Pythian Services Inc 2023 | Confidential | 25
  • 26. Physical Backups MongoDB Cloud manager backup ● Requires monthly subscription based on snapshot size, schedule, and retention policy ● Install the backup agent and configure in cloud.mongodb.com ● Optional namespace filter to exclude collections from the backup ● Point in time recovery with low overhead ● Data transfer to Cloud manager datacenters is encrypted ● Stores at least 3 copies of your data in at least 2 geographic locations to ensure redundancy ● Only works with deployments of up to 100k collections ● Snapshot lowest frequency of 6 hours © Pythian Services Inc 2023 | Confidential | 26
  • 27. Physical Backups MongoDB Ops manager backup ● Must run with MongoDB enterprise ● Works with deployments of up to 100k collections ● Replica set, sharded cluster, and shard names within the same project must be unique © Pythian Services Inc 2023 | Confidential | 27
  • 28. PITR © Pythian Services Inc 2023 | Confidential | 28
  • 29. PITR © Pythian Services Inc 2023 | Confidential | 29 TIME RTO LOST DATA DOWNTIME Full backup RPO Disaster
  • 30. PITR Incremental backups © Pythian Services Inc 2023 | Confidential | 30 TIME RTO Full backup LOST DATA DOWNTIME Inc backup Disaster
  • 31. PITR Incremental backups ● RPO ~ 0 © Pythian Services Inc 2023 | Confidential | 31 TIME RTO Full backup LOST DATA DOWNTIME Inc 1 Inc 2 Inc 3 Inc n Disaster
  • 32. PITR Full backup: lvm snapshot + Incremental backups using the Oplog root @mongodb: ~# mongo - u < username > -p < password > --port < port > --quiet backup_oplog_ts.js > oplog_position cat backup_oplog_ts.js var local = db.getSiblingDB('local'); var last = local['oplog.rs'].find().sort({ '$natural': -1 }).limit(1)[0]; var result = {}; if (last != null) { result = { position: last['ts'] }; } print(JSON.stringify(result)); © Pythian Services Inc 2023 | Confidential | 32 TIME Full backup "$timestamp": {"t": 1666355398,"i": 1}
  • 33. PITR Oplog backup using mongodump Inc 1 start position {"position": {"$timestamp": {"t": 1666355398,"i": 1}}} mongodump --quiet -u < username > -p < password > --port < port > --authenticationDatabase = admin - d local - c oplog.rs --query='{"ts": { "$gt": {"$timestamp":{"t":1666355398,"i":1}}}}' -o/backups/mongo_20230523/incremental_1 Inc 2 start position (end of Inc 1) bsondump --quiet /backup/mongo_20230523/incremental_1/local/oplog.rs.bson | tail -1 | jq -c .ts {"$timestamp": {"t": 1666616998, "i": 1 }} © Pythian Services Inc 2023 | Confidential | 33 TIME Full backup Inc 1
  • 34. PITR Inc 2 {"position": {"$timestamp": {"t": 1666616998,"i": 1}}} mongodump --quiet -u < username > -p < password > --port < port > --authenticationDatabase=admin -d local -c oplog.rs --query='{"ts": { "$gt": {"$timestamp":{"t":1666616998,"i":1}}}}' -o /backups/mongo_20230523/incremental_2 Inc 3 start position (end of Inc 2) bsondump --quiet/backup/mongo_20230523/incremental_2/local/oplog.rs.bson | tail -1 | jq -c .ts {"$timestamp": {"t": 1666617939,"i": 1}} © Pythian Services Inc 2023 | Confidential | 34 TIME Full backup Inc 1 Inc 2 Inc 3 Inc n
  • 35. PITR Inc 3 {"position": {"$timestamp": {"t": 1666617939,"i": 1}}} mongodump --quiet -u < username > -p < password > --port < port > --authenticationDatabase=admin -d local -c oplog.rs --query='{"ts": { "$gt": {"$timestamp":{"t":1666617939,"i":1}}}}' -o /backups/mongo_20230523/incremental_3 Inc n position: (Inc(n) = Between Inc(n-1) and Full backup(m) ) {"ts": {"$gt": {"$timestamp": {"t": 1666619908,"i": 1}}, "$lte": {"$timestamp": {"t": 1666619998,"i": 1}}}} © Pythian Services Inc 2023 | Confidential | 35 TIME Full backup(n) Inc 1 Inc 2 Inc 3 Inc n Full backup(m)
  • 36. PITR Full backup : 1pm Incremental backups: every 1 hour 4:30pm - Delete operation on users.meta namespace © Pythian Services Inc 2023 | Confidential | 36 TIME Disaster RTO Full backup(n) DOWNTIME Inc 1 Inc 2 Inc 3 Inc n RPO
  • 37. PITR Identify the erroneous operation start time bsondump --quiet /backup/mongo_20230523/oplog_4/local/oplog.rs.bson | grep '"op":"d","ns":"users.meta"' {"op": "d","ns": "users.meta","ui": {"$binary": {"base64": "ZlkpNQpySoG98UFLQvYZnw==","subType": "04"}},"o": {"_id": {"$oid": "636a7cd663089cc37ae7c96c"}},"ts": {"$timestamp": {"t": 1684859539,"i": 1}},"t": {"$numberLong": "6"},"v": {"$numberLong": "2"},"wall":{"$date": {"$numberLong": "1667917939452"}}} Erroneous operation : "ts": {"$timestamp": {"t": 1684859539,"i": 1}} © Pythian Services Inc 2023 | Confidential | 37 TIME RTO Full backup(n) DOWNTIME Inc 1 Inc 2 Inc 3 Inc n RPO Disaster
  • 38. PITR Restore the Full backup(n) Restore the incremental backups using mongorestore --oplogReplay cp /backup/mongo_20230523/oplog_1/local/oplog.rs.bson /backup/oplogR1/oplog.bson mongorestore --port 57017 –u < username > -p < password > --authenticationDatabase=admin --oplogReplay /backup/oplogR1 © Pythian Services Inc 2023 | Confidential | 38 TIME RTO Full backup(n) DOWNTIME Inc 1 Inc 2 Inc 3 Inc n RPO Disaster
  • 39. PITR Erroneous operation : "ts": {"$timestamp": {"t": 1684859539,"i": 1}} Restore the final incremental backup using mongorestore --oplogReplay --oplogLimit cp /backup/mongo_20230523/oplog_4/local/oplog.rs.bson /backup/oplog4/oplog.bson mongorestore --port 57017 -u < username > -p < password > --authenticationDatabase=admin --oplogReplay --oplogLimit 1684859539, 1 /backup/oplog4 © Pythian Services Inc 2023 | Confidential | 39 TIME RTO >= 0 Full backup(n) DOWNTIME Inc 1 Inc 2 Inc 3 Inc n RPO=0 Disaster
  • 40. Summary • Run backups as part of your organization’s DR strategy • Logical backups work well with smaller DB size, for larger DBs use physical • Backups are only good as long as they can be restored • For Replica sets run backups on a MongoDB Secondary node (hidden or delayed member) • For Sharded clusters you need to backup each shard and the config servers metadata while the balancer is stopped • Cloud manager/Ops manager backup are enterprise licenced • Full physical backup and incremental oplog backups will allow you PITR • RPO ~ 0 means you need to take backups more frequently • RTO ~ 0 means you need to invest in automating the restore © Pythian Services Inc 2023 | Confidential | 40
  • 41. ChatGPT - Explain best practices for MongoDB backups and PITR MongoDB backups and point-in-time recovery (PITR) are critical aspects of ensuring data availability and recovery in the event of data loss or system failure. Here are some best practices to consider when performing backups and PITR in MongoDB: 1. Choose the right backup strategy: MongoDB offers several backup strategies, including file system backups, logical backups, and continuous backups. Choose the right backup strategy based on your business requirements, data size, and recovery objectives. 2. Set backup schedules and retention periods: Create a backup schedule that fits your business needs and set a retention period that aligns with your recovery objectives. Ensure that you have enough backup storage to retain backups for the desired duration. 3. Use replica sets: MongoDB replica sets provide high availability and data redundancy. By configuring a replica set, you can create multiple copies of your data across different nodes. This ensures that you always have a copy of your data available for recovery. 4. Enable journaling: Journaling is a feature that ensures data consistency and durability. By enabling journaling, MongoDB can recover data from incomplete write operations in the event of a system failure. 5. Monitor backup performance: Monitor backup performance to ensure that backups are completed within the scheduled window. Use tools such as MongoDB Management Service (MMS) to monitor backup status and performance. 6. Test backups regularly: Regularly test your backups to ensure that you can restore your data when needed. Perform a full restore from a backup to a separate environment to test backup integrity and recovery procedures. 7. Implement PITR: Point-in-time recovery (PITR) allows you to restore your database to a specific point in time. This can be useful when you need to recover from a data corruption or user error. Ensure that you have enabled oplog (operation log) to enable PITR. 8. Use automation: Use automation tools to simplify backup and PITR operations. Tools such as MongoDB Ops Manager and MongoDB Atlas provide automated backup and recovery processes. By following these best practices, you can ensure that your MongoDB backups and PITR processes are reliable and effective in maintaining data availability and recovery. © Pythian Services Inc 2023 | Confidential | 41
  • 42. Thank you! © Pythian Services Inc 2023 | Confidential| 41
  • 43. References How to backup MongoDB database using lvm snapshots - Part 1 MongoDB incremental backups using the oplog - Part 2 MongoDB Backups and Point In Time Recovery - Part 3 Percona Backup for MongoDB Documentation FAQ: Backup and Restore — MongoDB Cloud Manager FAQ: Backup and Restore — MongoDB Ops Manager MongoDB Backup and Restore - Best Practices and Techniques © Pythian Services Inc 2023 | Confidential | 43