SlideShare a Scribd company logo
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
How can I be ready for the
next recovery of a
PostgreSQL database?
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
PostgreSQL continuous
backup and PITR with
Barman
Webinar - 10 June 2020
Gabriele Bartolini
Head of Global Support
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Something about me
● PostgreSQL user since ~2000
● Co-Founder of 2ndQuadrant
○ Head of Global Support
○ Leader of Cloud Native Initiative
○ Founding member of Barman
● Lean and DevOps practitioner
● Co-Founder of PostgreSQL
Europe and ITPUG
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Public Asciinema screencasts
1. Verify PostgreSQL is up and running
2. Create 'barman' superuser and 'streaming_barman' replication user in
PostgreSQL
3. RPM installation overview
4. Our first backup
5. Incremental backup based on hard links
6. Remote recovery and setup of Hot standby with on-demand WAL
fetching
7. Add WAL streaming to the standby server
8. Add 'zero data loss' or RPO=0 to the Primary/Standby/Barman cluster
9. Introduce geo-redundancy for a backed up server
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Part One
Basic concepts for backup and recovery with
PostgreSQL
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Logical backup with pg_dump
● Consistent snapshot of a PostgreSQL database
● Portable across major versions
● SQL format or Binary format
● Very useful
○ Development
○ Migrations
○ Dump and restore of portions of a database
● Not suitable for disaster recovery
○ Would you trust a home alarm system that takes a picture once a day?
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Continuous physical backup
● Evolution of PostgreSQL’s crash recovery
○ Entire PostgreSQL instance, not a single database
● Founded on Write Ahead Logs
○ Also known as REDO log
○ Changes to the database are first written in the REDO logs, then in the data files
○ WAL files are by default 16MB
● Basic theory:
○ Archive WAL files on a different location
○ Take a physical copy of the PostgreSQL data files on a different location
● Introduced in PostgreSQL 8.1 (2005)
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Continuous Recovery
● Founded on:
○ Standby servers
○ Continuous recovery
● Basic Theory:
○ Copy the data files on another server
○ Apply “redo” logs (roll forward)
■ Until the end of the WAL (full recovery)
■ Up to an exact moment (Point In Time Recovery)
○ Inspect or promote the server (exit continuous recovery)
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
WAL shipping
● Transfer WAL records to a different location
● WAL archiving:
○ Through PostgreSQL’s archive_command
■ Every time a WAL file is closed (16MB or archive_timeout)
○ Through native streaming replication
■ Continuously (WAL sender and WAL receiver)
■ Also synchronous (“zero data loss”)
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Freedom & creativity
● Lego bricks
○ PostgreSQL continuous backup
○ WAL shipping
○ PostgreSQL continuous recovery
● Infinite combinations
○ Architectures
○ Recovery objectives (RPO and RTO)
○ Processes
○ Use cases
● Temptation: DIY solution
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Part Two
Key aspects of Barman
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
First backup & recovery tool for Postgres
● Conceived in 2011, Open sourced in 2012
● Linux & Python, started with Postgres 8.3
● Innovative concepts at that time:
○ Remote backup
○ Remote recovery
○ Multiple PostgreSQL servers
○ Backup catalogue and independent WAL archive
○ Monitoring integration
○ WAL compression
○ Retention policies
○ Incremental backup and recovery
○ Hook scripts
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Requirements
1. Online backup
2. Automation
3. Management of frequency and retention
4. Off-site copies
5. Notifications of anomalies
6. Access limitations
7. Availability
8. Encryption
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Lean approach (customers needs)
● Foster migrations from Oracle
● Parallel backup and recovery
○ Reduce backup and recovery times on very large databases
● Streaming replication support
○ Including synchronous replication for Zero Data loss backups
● On-Demand WAL fetching (WAL hub)
● Geo-redundancy
● Object stores interface (Barman Cloud)
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Faster, Cheaper, Safer (DevOps)
● “We build it, we own it”
○ Barman team is on the front line of 2ndQ Support Incidents for Barman
● Multi-disciplinary development team
○ Peer review
● Trunk based development
● CI/CD and test automation
○ Build quality in / Shift left on security
○ Thousands of automated tests per commit
■ Unit tests, Smoke tests, Acceptance tests, Integration tests
■ All supported PostgreSQL versions and distributions
■ Release time went from 1 week to 2 hours
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Part Three
Tips
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#1 - Separate Barman from Postgres
● Let Barman and Postgres:
○ Run on different servers
○ Use different storage
● Think about:
○ Resilience
○ Commodity storage
■ Physical servers with high capacity local disks
○ Integration with standby servers
■ Zero data loss clusters
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#2 - Avoid network disks
● … if you can
● Some customers run Barman on NFS/CIFS/…
● Think about:
○ File lock issues
■ Place “barman_lock_directory” in the local Linux disk
○ Performance issues
■ Especially if storage is shared
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#3 - Favour locality over distance
● Let Barman and Postgres:
○ Be next to each other
○ In the same data centre
● Think about:
○ Data centre is a single point of failure - Yes, but don’t let it scare you
■ It can be solved
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#4 - WAL streaming
● Let Postgres stream WAL records to Barman
○ Enable WAL streaming
○ Ensure all WALs are shipped
■ Rely on replication slots
■ Fully automated with “create_slot” option
● Think about:
○ Asynchronous replication by default
○ Synchronous replication if …
■ You add a standby server
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#5 - WAL fetching
● Take advantage of WAL archive
● Use Barman as an “infinite” hub of WAL files
○ Forget about configuring “wal_keep_segments”
● On-demand remote fetching:
○ Standby servers
○ Recovery operations
● Parallel pre-fetch (performance boost)
● On the fly decompression
● “get-wal” feature
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#6 - Don’t take yourself so seriously
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#7 - Compress your WALs
● Set “compression” option, globally
● Performed by the WAL archiver process
○ Invoked automatically by the “cron” command
● gzip is normally fine
● Supported algorithms:
○ bzip2
○ pigz
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#8 - Your PostgreSQL building block
● The “Flux capacitor”:
○ Primary instance
○ Standby instance
○ Barman instance
● Think about:
○ High Availability
○ Disaster Recovery
○ Local standby servers
■ You can always add more
■ This architecture is simple yet very effective
○ Symmetric architecture (next rule)
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#9 - Multi-data centre architecture
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#10 - Encryption
● Encrypt at rest your:
○ PostgreSQL servers
○ Backup servers
● Think about:
○ Secure connections
○ Secure access to backup servers
○ Encryption of exported backup files:
■ Tar files on tape
■ Tar files on Cloud object stores
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#11 - Define your maximum RPO
● Clearly define your Recovery Point Objective
○ For example maximum 5 minutes
● Set “archive_timeout”
○ For example “archive_timeout = 5min”
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#12 - Reduce your RPO to 0
● Native synchronous replication
● Requirements:
○ A local standby
○ A local Barman
● Two options:
○ Zero data loss standby
○ Zero data loss backup
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#13 - Backup from a standby
● Available with PostgreSQL 9.6
○ 9.2 to 9.5 requires the pgespresso extension
● Think about:
○ Symmetric architecture
○ Off-load the primary
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#14 - Let “check” be your compass
● “barman check” is the most critical command
● It guides you
○ Setup process
○ Problem solving
● Think about:
○ Integration with alerting tools
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#15 - Monitoring
● Barman is on a Linux system
● That system must be under monitoring
○ Standard metrics
○ Disk usage
● Think about:
○ “barman check --nagios all”
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#16 - Weekly backups
● Start with weekly backups
○ Evaluate daily backups if you require shorter RTO
● Think about:
○ “barman backup all”
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#17 - Retention policies
● Automatically purge old backups
● Retention policies based on:
○ Redundancy (quantity)
○ Recovery window (time, Point of Recoverability)
● Think about:
○ Delete hook scripts
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#18 - Use rsync/SSH for backups
● Optimised algorithm
● Enables incremental copy
○ Set “reuse_backup = link” if your file system supports hard links
● Enables parallel copy
○ Set “parallel_jobs” option
● Think about:
○ Remember locality? Barman and Postgres are in the same network
■ Looser security measures
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#19 - Rely on object stores
● By … relaying to AWS S3 compatible object stores
○ Requires Boto3 library
○ Use “barman-cloud-wal-archive” for WAL files
● Public cloud, Private cloud, Hybrid clouds
○ E.g. use a local object store that relays to public cloud
● Think about:
○ Removing single point of failure for data availability
■ Data centre, Provider, Continent, Planet, … that’s it for now
■ Multi-tiered backup and recovery
○ Enhanced disaster recovery capabilities
○ Remember encryption!
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#20 - Public cloud, via Barman
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#21 - Public cloud, direct
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#22 - Local object store with gateway
To be implemented
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#23 - Geo-redundancy
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#24 - Aggressive start
● Enable “immediate_checkpoint”
● Speed up the start of the backup
○ Request a checkpoint without waiting for the scheduled one
● Think about:
○ Not available on standby servers
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#25 - Precautions
● minimum_redundancy
○ Safety measure: set it to 1
● last_backup_maximum_age
○ Based on the backup frequency
● max_incoming_wals_queue
○ Let “check” fail if your incoming queue gets too high
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#26 - Server configuration files
● Use a separate configuration file per server
● Place them in the /etc/barman.conf.d folder
● Suggested convention:
○ SERVER_ID-PGVERSION.conf
○ Example: juventus-12.conf
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#27 - Last version always wins
● Always install the latest version of Barman
○ Trunk based development
○ Backwards compatible
● Test our development snapshots
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#28 - Use our public repositories
● rpm.2ndquadrant.com
● apt.2ndquadrant.com
● Entry points:
○ Release level (default)
○ Snapshot level
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#29 - Cross data centre backups
● If you have to …
● Use network compression
● Think about:
○ Symmetric architecture
○ Locality
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#30 - Enjoy convention over configuration
● Most options in Barman:
○ Can be set globally in the configuration file
○ Can be overridden at server level
○ Have default values
● If you use our packages:
○ System configuration is already taken care of
■ User
■ Cron
■ Log rotation
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#31 - Get hooked
● Hook scripts
● Before/After certain events
● Two types:
○ Standard: in case of failure, no retry
○ Retry: in case of failure, retry
■ Typical: before WAL archive to relay WAL files in the Cloud
● See “barman-cloud-wal-archive” man page
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#32 - Work in small batches
● Configure archiver batch size
○ For standard archiving or streaming
○ By default unlimited batch
● Archiver process run by the “cron” command
○ Every minute
○ Tune it based on the number of expected WALs between two cron runs
○ Good value to start with is between 10 and 100
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#33 - JSON output
● Every command supports “-f json”
● Integration with other applications
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#34 - Principle Of Least Authority (POLA)
● Avoid using a superuser for Barman
● The “barman” user can be a standard user
○ With specific grants for backup and read operations
○ barman_streaming can be used for replication connections
● Requirements:
○ PostgreSQL 10+
○ Barman 2.11
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
#35 - Enhance gradually
● Consider:
○ One PostgreSQL instance
○ One Barman instance
● Think about:
○ Can I achieve Disaster Recovery?
○ Can I achieve High Availability?
○ Can I achieve Business Continuity?
○ What are my RPO and RTO?
○ Start with your goals, add components gradually to improve them
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Part Four
What lies ahead of us
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Version 2.11 (June 2020)
● “barman-cli-cloud” package
○ barman-cloud-wal-archive (experimental in 2.10)
○ barman-cloud-backup (experimental in 2.10)
○ barman-cloud-wal-restore
○ barman-cloud-restore
○ barman-cloud-list-backup
● Non superuser connections
● Bug fixes
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Tar format for backups
● Tier 2 - optional
● Introduce “tar_retention_policy”
○ >= retention_policy
● Compressed backups
● Encrypted backups
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Object store relay
● Tier 3 - optional
● Introduce “s3_retention_policy”
○ >= tar_retention_policy
● Compressed backups
● Encrypted backups
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Kubernetes
● Cloud Native PostgreSQL
○ Private operator by 2ndQuadrant
○ Public Docker images
● 1st stage:
○ Object store integration with barman-cli-cloud
○ Direct usage from the PostgreSQL primary node
■ Backup and WAL archive
● 2nd stage
○ Barman operator (Barman inside Kubernetes)
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Part Five
Conclusions
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Base backup information:
Disk usage : 24.2 TiB (24.2 TiB with WALs)
Incremental size : 6.7 TiB (-72.44%)
Timeline : 9
Begin WAL : 000000090000A9690000006A
End WAL : 000000090000A96D000000DC
WAL number : 1139
WAL compression ratio: 77.05%
Begin time : 2020-06-05 13:00:04.930924+00:00
End time : 2020-06-06 01:55:34.543064+00:00
Copy time : 12 hours, 47 minutes, 33 seconds + 42 seconds startup
Estimated throughput : 152.1 MiB/s ( 4 jobs)
Begin Offset : 13931024
End Offset : 14041528
Begin LSN : A969/6AD49210
End LSN : A96D/DCD641B8
WAL information:
No of files : 7136
Disk usage : 25.3 GiB
WAL rate : 90.79/hour
Compression ratio : 77.26%
Last available : 000000090000A989000000BC
Output of “barman show-backup” - Courtesy of Barman’s founding sponsor “Navionics”
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Recap
● “Flux capacitor”
● RPO=0 scenarios
● Very Large Databases
● Stable, robust and backwards compatible
● Supports all supported PostgreSQL versions
● Used in mission critical environments
● Used in our infrastructure at 2ndQuadrant
○ We can say: “It saved us once”
● Enhance gradually
● Open source
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
License
Attribution 4.0 International (CC BY 4.0)
You are free to:
Share — copy and redistribute the material in any medium or
format
Adapt — remix, transform, and build upon the material for any
purpose, even commercially.
The licensor cannot revoke these freedoms as long as you
follow the license terms.
Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com
PostgreSQL continuous backup
and PITR with Barman - Webinar
Questions?
www.pgbarman.org
info@2ndquadrant.com

More Related Content

What's hot (20)

Pgday bdr 천정대
Pgday bdr 천정대Pgday bdr 천정대
Pgday bdr 천정대
PgDay.Seoul
 
MyRocks Deep Dive
MyRocks Deep DiveMyRocks Deep Dive
MyRocks Deep Dive
Yoshinori Matsunobu
 
Maxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoinMaxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoin
Wagner Bianchi
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
Mydbops
 
How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScale
MariaDB plc
 
Load Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - SlidesLoad Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - Slides
Severalnines
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
Alexey Lesovsky
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
Olivier DASINI
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with Barman
EDB
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
 
Modeling Data and Queries for Wide Column NoSQL
Modeling Data and Queries for Wide Column NoSQLModeling Data and Queries for Wide Column NoSQL
Modeling Data and Queries for Wide Column NoSQL
ScyllaDB
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
NeoClova
 
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the CloudOracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Markus Michalewicz
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
Maria Colgan
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and Debezium
Tathastu.ai
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
Frederic Descamps
 
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Masahiko Sawada
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Zohar Elkayam
 
Envoy and Kafka
Envoy and KafkaEnvoy and Kafka
Envoy and Kafka
Adam Kotwasinski
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Mydbops
 
Pgday bdr 천정대
Pgday bdr 천정대Pgday bdr 천정대
Pgday bdr 천정대
PgDay.Seoul
 
Maxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoinMaxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoin
Wagner Bianchi
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
Mydbops
 
How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScale
MariaDB plc
 
Load Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - SlidesLoad Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - Slides
Severalnines
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
Alexey Lesovsky
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
Olivier DASINI
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with Barman
EDB
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
 
Modeling Data and Queries for Wide Column NoSQL
Modeling Data and Queries for Wide Column NoSQLModeling Data and Queries for Wide Column NoSQL
Modeling Data and Queries for Wide Column NoSQL
ScyllaDB
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
NeoClova
 
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the CloudOracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Markus Michalewicz
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
Maria Colgan
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and Debezium
Tathastu.ai
 
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Masahiko Sawada
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Zohar Elkayam
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Mydbops
 

Similar to Webinar: PostgreSQL continuous backup and PITR with Barman (20)

Advanced backup methods (Postgres@CERN)
Advanced backup methods (Postgres@CERN)Advanced backup methods (Postgres@CERN)
Advanced backup methods (Postgres@CERN)
Anastasia Lubennikova
 
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
Gabriele Bartolini
 
PostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with BarmanPostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with Barman
Gabriele Bartolini
 
PGConf.ASIA 2019 Bali - Your Business Continuity Matrix and PostgreSQL's Disa...
PGConf.ASIA 2019 Bali - Your Business Continuity Matrix and PostgreSQL's Disa...PGConf.ASIA 2019 Bali - Your Business Continuity Matrix and PostgreSQL's Disa...
PGConf.ASIA 2019 Bali - Your Business Continuity Matrix and PostgreSQL's Disa...
Equnix Business Solutions
 
Odoo disaster recovery with barman
Odoo disaster recovery with barmanOdoo disaster recovery with barman
Odoo disaster recovery with barman
Odoo
 
From 0 to ~100: Business Continuity with PostgreSQL
From 0 to ~100: Business Continuity with PostgreSQLFrom 0 to ~100: Business Continuity with PostgreSQL
From 0 to ~100: Business Continuity with PostgreSQL
Gabriele Bartolini
 
Barman
BarmanBarman
Barman
Viktor Stískala
 
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC
 
Barman (PostgreSql) manual
Barman (PostgreSql) manualBarman (PostgreSql) manual
Barman (PostgreSql) manual
Marcelo Pesallaccia
 
Database Dumps and Backups
Database Dumps and BackupsDatabase Dumps and Backups
Database Dumps and Backups
EDB
 
Postgres Point-in-Time Recovery
Postgres Point-in-Time RecoveryPostgres Point-in-Time Recovery
Postgres Point-in-Time Recovery
EDB
 
PostgreSQL Hangout Replication Features v9.4
PostgreSQL Hangout Replication Features v9.4PostgreSQL Hangout Replication Features v9.4
PostgreSQL Hangout Replication Features v9.4
Ashnikbiz
 
Backup recovery with PostgreSQL
Backup recovery with PostgreSQLBackup recovery with PostgreSQL
Backup recovery with PostgreSQL
Federico Campoli
 
Backup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLBackup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQL
Ashnik Pte Ltd
 
What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6
EDB
 
EnterpriseDB BackUp and Recovery Tool
EnterpriseDB BackUp and Recovery ToolEnterpriseDB BackUp and Recovery Tool
EnterpriseDB BackUp and Recovery Tool
EDB
 
9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf
sreedb2
 
GitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons LearnedGitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons Learned
Alexey Lesovsky
 
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam
 
Postgres Vision 2018: WAL: Everything You Want to Know
Postgres Vision 2018: WAL: Everything You Want to KnowPostgres Vision 2018: WAL: Everything You Want to Know
Postgres Vision 2018: WAL: Everything You Want to Know
EDB
 
Advanced backup methods (Postgres@CERN)
Advanced backup methods (Postgres@CERN)Advanced backup methods (Postgres@CERN)
Advanced backup methods (Postgres@CERN)
Anastasia Lubennikova
 
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
Gabriele Bartolini
 
PostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with BarmanPostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with Barman
Gabriele Bartolini
 
PGConf.ASIA 2019 Bali - Your Business Continuity Matrix and PostgreSQL's Disa...
PGConf.ASIA 2019 Bali - Your Business Continuity Matrix and PostgreSQL's Disa...PGConf.ASIA 2019 Bali - Your Business Continuity Matrix and PostgreSQL's Disa...
PGConf.ASIA 2019 Bali - Your Business Continuity Matrix and PostgreSQL's Disa...
Equnix Business Solutions
 
Odoo disaster recovery with barman
Odoo disaster recovery with barmanOdoo disaster recovery with barman
Odoo disaster recovery with barman
Odoo
 
From 0 to ~100: Business Continuity with PostgreSQL
From 0 to ~100: Business Continuity with PostgreSQLFrom 0 to ~100: Business Continuity with PostgreSQL
From 0 to ~100: Business Continuity with PostgreSQL
Gabriele Bartolini
 
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC
 
Database Dumps and Backups
Database Dumps and BackupsDatabase Dumps and Backups
Database Dumps and Backups
EDB
 
Postgres Point-in-Time Recovery
Postgres Point-in-Time RecoveryPostgres Point-in-Time Recovery
Postgres Point-in-Time Recovery
EDB
 
PostgreSQL Hangout Replication Features v9.4
PostgreSQL Hangout Replication Features v9.4PostgreSQL Hangout Replication Features v9.4
PostgreSQL Hangout Replication Features v9.4
Ashnikbiz
 
Backup recovery with PostgreSQL
Backup recovery with PostgreSQLBackup recovery with PostgreSQL
Backup recovery with PostgreSQL
Federico Campoli
 
Backup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLBackup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQL
Ashnik Pte Ltd
 
What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6
EDB
 
EnterpriseDB BackUp and Recovery Tool
EnterpriseDB BackUp and Recovery ToolEnterpriseDB BackUp and Recovery Tool
EnterpriseDB BackUp and Recovery Tool
EDB
 
9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf
sreedb2
 
GitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons LearnedGitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons Learned
Alexey Lesovsky
 
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam
 
Postgres Vision 2018: WAL: Everything You Want to Know
Postgres Vision 2018: WAL: Everything You Want to KnowPostgres Vision 2018: WAL: Everything You Want to Know
Postgres Vision 2018: WAL: Everything You Want to Know
EDB
 
Ad

Recently uploaded (20)

Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOMEstablish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Anchore
 
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptxISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
AyilurRamnath1
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Improving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevExImproving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevEx
Justin Reock
 
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto CertificateCybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
VICTOR MAESTRE RAMIREZ
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Jira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : IntroductionJira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : Introduction
Ravi Teja
 
soulmaite review - Find Real AI soulmate review
soulmaite review - Find Real AI soulmate reviewsoulmaite review - Find Real AI soulmate review
soulmaite review - Find Real AI soulmate review
Soulmaite
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf
Minuscule Technologies
 
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to KnowWhat is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
SMACT Works
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
AI Creative Generates You Passive Income Like Never Before
AI Creative Generates You Passive Income Like Never BeforeAI Creative Generates You Passive Income Like Never Before
AI Creative Generates You Passive Income Like Never Before
SivaRajan47
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Securiport - A Border Security Company
Securiport  -  A Border Security CompanySecuriport  -  A Border Security Company
Securiport - A Border Security Company
Securiport
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOMEstablish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Anchore
 
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptxISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
AyilurRamnath1
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Improving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevExImproving Developer Productivity With DORA, SPACE, and DevEx
Improving Developer Productivity With DORA, SPACE, and DevEx
Justin Reock
 
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto CertificateCybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
VICTOR MAESTRE RAMIREZ
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Jira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : IntroductionJira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : Introduction
Ravi Teja
 
soulmaite review - Find Real AI soulmate review
soulmaite review - Find Real AI soulmate reviewsoulmaite review - Find Real AI soulmate review
soulmaite review - Find Real AI soulmate review
Soulmaite
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf7 Salesforce Data Cloud Best Practices.pdf
7 Salesforce Data Cloud Best Practices.pdf
Minuscule Technologies
 
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to KnowWhat is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
SMACT Works
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
AI Creative Generates You Passive Income Like Never Before
AI Creative Generates You Passive Income Like Never BeforeAI Creative Generates You Passive Income Like Never Before
AI Creative Generates You Passive Income Like Never Before
SivaRajan47
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Securiport - A Border Security Company
Securiport  -  A Border Security CompanySecuriport  -  A Border Security Company
Securiport - A Border Security Company
Securiport
 
Ad

Webinar: PostgreSQL continuous backup and PITR with Barman

  • 1. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar How can I be ready for the next recovery of a PostgreSQL database?
  • 2. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar PostgreSQL continuous backup and PITR with Barman Webinar - 10 June 2020 Gabriele Bartolini Head of Global Support
  • 3. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Something about me ● PostgreSQL user since ~2000 ● Co-Founder of 2ndQuadrant ○ Head of Global Support ○ Leader of Cloud Native Initiative ○ Founding member of Barman ● Lean and DevOps practitioner ● Co-Founder of PostgreSQL Europe and ITPUG
  • 4. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Public Asciinema screencasts 1. Verify PostgreSQL is up and running 2. Create 'barman' superuser and 'streaming_barman' replication user in PostgreSQL 3. RPM installation overview 4. Our first backup 5. Incremental backup based on hard links 6. Remote recovery and setup of Hot standby with on-demand WAL fetching 7. Add WAL streaming to the standby server 8. Add 'zero data loss' or RPO=0 to the Primary/Standby/Barman cluster 9. Introduce geo-redundancy for a backed up server
  • 5. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Part One Basic concepts for backup and recovery with PostgreSQL
  • 6. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Logical backup with pg_dump ● Consistent snapshot of a PostgreSQL database ● Portable across major versions ● SQL format or Binary format ● Very useful ○ Development ○ Migrations ○ Dump and restore of portions of a database ● Not suitable for disaster recovery ○ Would you trust a home alarm system that takes a picture once a day?
  • 7. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Continuous physical backup ● Evolution of PostgreSQL’s crash recovery ○ Entire PostgreSQL instance, not a single database ● Founded on Write Ahead Logs ○ Also known as REDO log ○ Changes to the database are first written in the REDO logs, then in the data files ○ WAL files are by default 16MB ● Basic theory: ○ Archive WAL files on a different location ○ Take a physical copy of the PostgreSQL data files on a different location ● Introduced in PostgreSQL 8.1 (2005)
  • 8. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Continuous Recovery ● Founded on: ○ Standby servers ○ Continuous recovery ● Basic Theory: ○ Copy the data files on another server ○ Apply “redo” logs (roll forward) ■ Until the end of the WAL (full recovery) ■ Up to an exact moment (Point In Time Recovery) ○ Inspect or promote the server (exit continuous recovery)
  • 9. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar WAL shipping ● Transfer WAL records to a different location ● WAL archiving: ○ Through PostgreSQL’s archive_command ■ Every time a WAL file is closed (16MB or archive_timeout) ○ Through native streaming replication ■ Continuously (WAL sender and WAL receiver) ■ Also synchronous (“zero data loss”)
  • 10. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Freedom & creativity ● Lego bricks ○ PostgreSQL continuous backup ○ WAL shipping ○ PostgreSQL continuous recovery ● Infinite combinations ○ Architectures ○ Recovery objectives (RPO and RTO) ○ Processes ○ Use cases ● Temptation: DIY solution
  • 11. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar
  • 12. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Part Two Key aspects of Barman
  • 13. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar First backup & recovery tool for Postgres ● Conceived in 2011, Open sourced in 2012 ● Linux & Python, started with Postgres 8.3 ● Innovative concepts at that time: ○ Remote backup ○ Remote recovery ○ Multiple PostgreSQL servers ○ Backup catalogue and independent WAL archive ○ Monitoring integration ○ WAL compression ○ Retention policies ○ Incremental backup and recovery ○ Hook scripts
  • 14. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Requirements 1. Online backup 2. Automation 3. Management of frequency and retention 4. Off-site copies 5. Notifications of anomalies 6. Access limitations 7. Availability 8. Encryption
  • 15. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Lean approach (customers needs) ● Foster migrations from Oracle ● Parallel backup and recovery ○ Reduce backup and recovery times on very large databases ● Streaming replication support ○ Including synchronous replication for Zero Data loss backups ● On-Demand WAL fetching (WAL hub) ● Geo-redundancy ● Object stores interface (Barman Cloud)
  • 16. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Faster, Cheaper, Safer (DevOps) ● “We build it, we own it” ○ Barman team is on the front line of 2ndQ Support Incidents for Barman ● Multi-disciplinary development team ○ Peer review ● Trunk based development ● CI/CD and test automation ○ Build quality in / Shift left on security ○ Thousands of automated tests per commit ■ Unit tests, Smoke tests, Acceptance tests, Integration tests ■ All supported PostgreSQL versions and distributions ■ Release time went from 1 week to 2 hours
  • 17. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Part Three Tips
  • 18. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #1 - Separate Barman from Postgres ● Let Barman and Postgres: ○ Run on different servers ○ Use different storage ● Think about: ○ Resilience ○ Commodity storage ■ Physical servers with high capacity local disks ○ Integration with standby servers ■ Zero data loss clusters
  • 19. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #2 - Avoid network disks ● … if you can ● Some customers run Barman on NFS/CIFS/… ● Think about: ○ File lock issues ■ Place “barman_lock_directory” in the local Linux disk ○ Performance issues ■ Especially if storage is shared
  • 20. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #3 - Favour locality over distance ● Let Barman and Postgres: ○ Be next to each other ○ In the same data centre ● Think about: ○ Data centre is a single point of failure - Yes, but don’t let it scare you ■ It can be solved
  • 21. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #4 - WAL streaming ● Let Postgres stream WAL records to Barman ○ Enable WAL streaming ○ Ensure all WALs are shipped ■ Rely on replication slots ■ Fully automated with “create_slot” option ● Think about: ○ Asynchronous replication by default ○ Synchronous replication if … ■ You add a standby server
  • 22. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #5 - WAL fetching ● Take advantage of WAL archive ● Use Barman as an “infinite” hub of WAL files ○ Forget about configuring “wal_keep_segments” ● On-demand remote fetching: ○ Standby servers ○ Recovery operations ● Parallel pre-fetch (performance boost) ● On the fly decompression ● “get-wal” feature
  • 23. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #6 - Don’t take yourself so seriously
  • 24. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #7 - Compress your WALs ● Set “compression” option, globally ● Performed by the WAL archiver process ○ Invoked automatically by the “cron” command ● gzip is normally fine ● Supported algorithms: ○ bzip2 ○ pigz
  • 25. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #8 - Your PostgreSQL building block ● The “Flux capacitor”: ○ Primary instance ○ Standby instance ○ Barman instance ● Think about: ○ High Availability ○ Disaster Recovery ○ Local standby servers ■ You can always add more ■ This architecture is simple yet very effective ○ Symmetric architecture (next rule)
  • 26. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #9 - Multi-data centre architecture
  • 27. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #10 - Encryption ● Encrypt at rest your: ○ PostgreSQL servers ○ Backup servers ● Think about: ○ Secure connections ○ Secure access to backup servers ○ Encryption of exported backup files: ■ Tar files on tape ■ Tar files on Cloud object stores
  • 28. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #11 - Define your maximum RPO ● Clearly define your Recovery Point Objective ○ For example maximum 5 minutes ● Set “archive_timeout” ○ For example “archive_timeout = 5min”
  • 29. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #12 - Reduce your RPO to 0 ● Native synchronous replication ● Requirements: ○ A local standby ○ A local Barman ● Two options: ○ Zero data loss standby ○ Zero data loss backup
  • 30. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #13 - Backup from a standby ● Available with PostgreSQL 9.6 ○ 9.2 to 9.5 requires the pgespresso extension ● Think about: ○ Symmetric architecture ○ Off-load the primary
  • 31. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #14 - Let “check” be your compass ● “barman check” is the most critical command ● It guides you ○ Setup process ○ Problem solving ● Think about: ○ Integration with alerting tools
  • 32. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #15 - Monitoring ● Barman is on a Linux system ● That system must be under monitoring ○ Standard metrics ○ Disk usage ● Think about: ○ “barman check --nagios all”
  • 33. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #16 - Weekly backups ● Start with weekly backups ○ Evaluate daily backups if you require shorter RTO ● Think about: ○ “barman backup all”
  • 34. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #17 - Retention policies ● Automatically purge old backups ● Retention policies based on: ○ Redundancy (quantity) ○ Recovery window (time, Point of Recoverability) ● Think about: ○ Delete hook scripts
  • 35. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #18 - Use rsync/SSH for backups ● Optimised algorithm ● Enables incremental copy ○ Set “reuse_backup = link” if your file system supports hard links ● Enables parallel copy ○ Set “parallel_jobs” option ● Think about: ○ Remember locality? Barman and Postgres are in the same network ■ Looser security measures
  • 36. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #19 - Rely on object stores ● By … relaying to AWS S3 compatible object stores ○ Requires Boto3 library ○ Use “barman-cloud-wal-archive” for WAL files ● Public cloud, Private cloud, Hybrid clouds ○ E.g. use a local object store that relays to public cloud ● Think about: ○ Removing single point of failure for data availability ■ Data centre, Provider, Continent, Planet, … that’s it for now ■ Multi-tiered backup and recovery ○ Enhanced disaster recovery capabilities ○ Remember encryption!
  • 37. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #20 - Public cloud, via Barman
  • 38. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #21 - Public cloud, direct
  • 39. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #22 - Local object store with gateway To be implemented
  • 40. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #23 - Geo-redundancy
  • 41. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #24 - Aggressive start ● Enable “immediate_checkpoint” ● Speed up the start of the backup ○ Request a checkpoint without waiting for the scheduled one ● Think about: ○ Not available on standby servers
  • 42. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #25 - Precautions ● minimum_redundancy ○ Safety measure: set it to 1 ● last_backup_maximum_age ○ Based on the backup frequency ● max_incoming_wals_queue ○ Let “check” fail if your incoming queue gets too high
  • 43. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #26 - Server configuration files ● Use a separate configuration file per server ● Place them in the /etc/barman.conf.d folder ● Suggested convention: ○ SERVER_ID-PGVERSION.conf ○ Example: juventus-12.conf
  • 44. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #27 - Last version always wins ● Always install the latest version of Barman ○ Trunk based development ○ Backwards compatible ● Test our development snapshots
  • 45. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #28 - Use our public repositories ● rpm.2ndquadrant.com ● apt.2ndquadrant.com ● Entry points: ○ Release level (default) ○ Snapshot level
  • 46. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #29 - Cross data centre backups ● If you have to … ● Use network compression ● Think about: ○ Symmetric architecture ○ Locality
  • 47. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #30 - Enjoy convention over configuration ● Most options in Barman: ○ Can be set globally in the configuration file ○ Can be overridden at server level ○ Have default values ● If you use our packages: ○ System configuration is already taken care of ■ User ■ Cron ■ Log rotation
  • 48. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #31 - Get hooked ● Hook scripts ● Before/After certain events ● Two types: ○ Standard: in case of failure, no retry ○ Retry: in case of failure, retry ■ Typical: before WAL archive to relay WAL files in the Cloud ● See “barman-cloud-wal-archive” man page
  • 49. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #32 - Work in small batches ● Configure archiver batch size ○ For standard archiving or streaming ○ By default unlimited batch ● Archiver process run by the “cron” command ○ Every minute ○ Tune it based on the number of expected WALs between two cron runs ○ Good value to start with is between 10 and 100
  • 50. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #33 - JSON output ● Every command supports “-f json” ● Integration with other applications
  • 51. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #34 - Principle Of Least Authority (POLA) ● Avoid using a superuser for Barman ● The “barman” user can be a standard user ○ With specific grants for backup and read operations ○ barman_streaming can be used for replication connections ● Requirements: ○ PostgreSQL 10+ ○ Barman 2.11
  • 52. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar #35 - Enhance gradually ● Consider: ○ One PostgreSQL instance ○ One Barman instance ● Think about: ○ Can I achieve Disaster Recovery? ○ Can I achieve High Availability? ○ Can I achieve Business Continuity? ○ What are my RPO and RTO? ○ Start with your goals, add components gradually to improve them
  • 53. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Part Four What lies ahead of us
  • 54. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Version 2.11 (June 2020) ● “barman-cli-cloud” package ○ barman-cloud-wal-archive (experimental in 2.10) ○ barman-cloud-backup (experimental in 2.10) ○ barman-cloud-wal-restore ○ barman-cloud-restore ○ barman-cloud-list-backup ● Non superuser connections ● Bug fixes
  • 55. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Tar format for backups ● Tier 2 - optional ● Introduce “tar_retention_policy” ○ >= retention_policy ● Compressed backups ● Encrypted backups
  • 56. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Object store relay ● Tier 3 - optional ● Introduce “s3_retention_policy” ○ >= tar_retention_policy ● Compressed backups ● Encrypted backups
  • 57. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Kubernetes ● Cloud Native PostgreSQL ○ Private operator by 2ndQuadrant ○ Public Docker images ● 1st stage: ○ Object store integration with barman-cli-cloud ○ Direct usage from the PostgreSQL primary node ■ Backup and WAL archive ● 2nd stage ○ Barman operator (Barman inside Kubernetes)
  • 58. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Part Five Conclusions
  • 59. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Base backup information: Disk usage : 24.2 TiB (24.2 TiB with WALs) Incremental size : 6.7 TiB (-72.44%) Timeline : 9 Begin WAL : 000000090000A9690000006A End WAL : 000000090000A96D000000DC WAL number : 1139 WAL compression ratio: 77.05% Begin time : 2020-06-05 13:00:04.930924+00:00 End time : 2020-06-06 01:55:34.543064+00:00 Copy time : 12 hours, 47 minutes, 33 seconds + 42 seconds startup Estimated throughput : 152.1 MiB/s ( 4 jobs) Begin Offset : 13931024 End Offset : 14041528 Begin LSN : A969/6AD49210 End LSN : A96D/DCD641B8 WAL information: No of files : 7136 Disk usage : 25.3 GiB WAL rate : 90.79/hour Compression ratio : 77.26% Last available : 000000090000A989000000BC Output of “barman show-backup” - Courtesy of Barman’s founding sponsor “Navionics”
  • 60. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Recap ● “Flux capacitor” ● RPO=0 scenarios ● Very Large Databases ● Stable, robust and backwards compatible ● Supports all supported PostgreSQL versions ● Used in mission critical environments ● Used in our infrastructure at 2ndQuadrant ○ We can say: “It saved us once” ● Enhance gradually ● Open source
  • 61. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar License Attribution 4.0 International (CC BY 4.0) You are free to: Share — copy and redistribute the material in any medium or format Adapt — remix, transform, and build upon the material for any purpose, even commercially. The licensor cannot revoke these freedoms as long as you follow the license terms.
  • 62. Twitter: @_GBartolini_ @2ndQuad https://www.2ndQuadrant.com PostgreSQL continuous backup and PITR with Barman - Webinar Questions? www.pgbarman.org [email protected]