Database Backup and Recovery Best Practices. Manjot Singh, Data & Infrastrustructure Architect

Similar documents
MySQL Backup Best Practices and Case Study:.IE Continuous Restore Process

MySQL In the Cloud. Migration, Best Practices, High Availability, Scaling. Peter Zaitsev CEO Los Angeles MySQL Meetup June 12 th, 2017.

ZYNSTRA TECHNICAL BRIEFING NOTE

Deploying MySQL in Production Daniel Kowalewski Senior Technical Operations Engineer, Percona

Deploying MySQL in Production

What s New in MySQL and MongoDB Ecosystem Year 2017

MySQL High Availability

Solution Pack. Managed Services Virtual Private Cloud Managed Database Service Selections and Prerequisites

arcserve r16.5 Hybrid data protection

Pro2SQL. OpenEdge Replication. for Data Reporting. for Disaster Recovery. March 2017 Greg White Sr. Progress Consultant Progress

Using Percona Monitoring and Management to Troubleshoot MySQL Performance Issues

Running MySQL on AWS. Michael Coburn Wednesday, April 15th, 2015

Backup & Restore. Maximiliano Bubenick Sr Remote DBA

Backup vs. Business Continuity

How CloudEndure Disaster Recovery Works

MongoDB Shell: A Primer

How CloudEndure Disaster Recovery Works

How CloudEndure Works

How to Backup at Petabyte Scale When Every Transaction Counts

Netapp Exam NS0-510 NCIE-Backup & Recovery Implementation Engineer Exam Version: 7.0 [ Total Questions: 216 ]

Deploy. A step-by-step guide to successfully deploying your new app with the FileMaker Platform

HP Designing and Implementing HP Enterprise Backup Solutions. Download Full Version :

How CloudEndure Works

HPE Converged Data Solutions

Document Sub Title. Yotpo. Technical Overview 07/18/ Yotpo

Tintri Cloud Connector

White Paper: Backup vs. Business Continuity. Backup vs. Business Continuity: Using RTO to Better Plan for Your Business

ECE Engineering Robust Server Software. Spring 2018

Web-Hosting: Service Level Agreement

Percona Software & Services Update

PGConf.Russia 2019, Moscow. Alexander Kukushkin

Azure Webinar. Resilient Solutions March Sander van den Hoven Principal Technical Evangelist Microsoft

Modernize Your Backup and DR Using Actifio in AWS

Disaster Happens; Don t Be Held

From Single File Recovery to Full Restore: Choosing the Right Backup and Recovery Solution for Your Cloud Data

Disaster Recovery Is A Business Strategy

Become a MongoDB Replica Set Expert in Under 5 Minutes:

Welcome! Considering a Warm Disaster Recovery Site?

` 2017 CloudEndure 1

Projectplace: A Secure Project Collaboration Solution

University Information Technology Data Backup and Recovery Policy

Version v November 2015

WHITE PAPER- Managed Services Security Practices

Vembu v4.0 Vembu ImageBackup

Version v November 2015

UNITRENDS CLOUD BACKUP FOR OFFICE 365

Oracle Zero Data Loss Recovery Appliance (ZDLRA)

Buyer s Guide: DRaaS features and functionality

Backup vs. Business Continuity: Using RTO to Better Plan for Your Business

OUR CUSTOMER TERMS CLOUD SERVICES - INFRASTRUCTURE

Chapter 11. SnapProtect Technology

INFORMATION SECURITY- DISASTER RECOVERY

Vembu Technologies. Experience. Headquartered in Chennai Countries

Hybrid Cloud Data Protection & Storage

Hystax. Live Migration and Disaster Recovery. Hystax B.V. Copyright

Testing and Verifying your MySQL Backup Strategy

Cloud Compute. Backup Portal User Guide

SQL Server Virtualization 201

MongoDB Backup and Recovery Field Guide. Tim Vaillancourt Sr Technical Operations Architect, Percona

Creating a Best-in-Class Backup and Recovery System for Your MySQL Environment. Akshay Suryawanshi DBA Team Manager,

Vembu v4.0 Vembu ImageBackup

FUJITSU Backup as a Service Rapid Recovery Appliance

The Nuances of Backup and Recovery Solutions

User Guide. Version R95. English

Arcserve Solutions for Amazon Web Services (AWS)

Disaster Recovery and Mitigation: Is your business prepared when disaster hits?

Percona Software & Services Update

Lessons from database failures

Microsoft Azure Windows Server Microsoft System Center

CIO Guide: Disaster recovery solutions that work. Making it happen with Azure in the public cloud

MongoDB Security: Making Things Secure by Default

Percona Xtrabackup: Hot Backup Solution for MySQL

MOVING TOWARDS ZERO DOWNTIME FOR WINTEL Caddy Tan 21 September Leaders Have Vision visionsolutions.com 1

HYBRID CLOUD BACKUP & DISASTER RECOVERY

MySQL As A Service. Operationalizing 19 Years of Infrastructure at GoDaddy

NS NetworkAppliance. Network Appliance Solution Architect-Backup and Restore (New)

Case study: Building bi-directional DR. Joep Piscaer, VMware vexpert, VCDX #101

Backup & Recovery on AWS

The Key to Disaster Recovery

Simple Data Protection for the Cloud Era

Countering ransomware with HPE data protection solutions

1Z Oracle. MySQL 5 Database Administrator Certified Professional Part I

Application Lifecycle Management on Softwareas-a-Service

UNITRENDS & NUTANIX ARCHITECTURE & IMPLEMENTATION GUIDE

Business Continuity and Disaster Recovery. Ed Crowley Ch 12

White Paper: Backup vs. Business Continuity. Backup vs. Business Continuity: Using RTO to Better Plan for Your Business

Sneak peek into Vembu BDR Suite v3.6!

Configuration Guide for Veeam Backup & Replication with the HPE Hyper Converged 250 System

Oracle Secure Backup: Achieve 75 % Cost Savings with Your Tape Backup

SAP HANA Disaster Recovery with Asynchronous Storage Replication

Data Protection Modernization: Meeting the Challenges of a Changing IT Landscape

MySQL Backup solutions. Liz van Dijk Zarafa Summer Camp - June 2012

Virtualizing disaster recovery helps ensure business resiliency while cutting operating costs.

Security+ Guide to Network Security Fundamentals, Third Edition. Chapter 13 Business Continuity

Dbvisit Product and Company Website Copy

Aurora, RDS, or On-Prem, Which is right for you

A CommVault White Paper: Business Continuity: Architecture Design Guide

Hitchhiker s Guide to Veeam Backup Free Edition

TOP REASONS TO CHOOSE DELL EMC OVER VEEAM

Data Storage, Recovery and Backup Checklists for Public Health Laboratories

Transcription:

Database Backup and Recovery Best Practices (with a focus on MySQL) Manjot Singh, Data & Infrastrustructure Architect

About Manjot Singh MySQL Fanatic Long time user (~16 years) Database and Systems Administrator for a number of years Oracle, SQL Server, MySQL Now an Architect at Percona, helping many companies scale databases and systems and implement best practices

About Percona Percona Delivers enterprise-class software, support and consulting solutions for MySQL and MongoDB We have a global 24x7x365 consulting team Percona consults with some of the largest companies on the internet as well as new startups Percona Consultants have decades of experience solving complete database and performance issues

Do I Need to Take Database Backups?

YES!!!

Why Backup and Recovery? Backup and Recovery processes are a critical part of any application infrastructure. A well tested backup and recovery system can be the difference between a minor outage and the end of your business.

Recovery Requirements Determine Backups Three important questions define backup and recovery systems for organizations: Recovery Time Objective Recovery Point Objective Risk Mitigation

Recovery Time Objective (RTO) The amount of time that may pass during a disruption before it exceeds the maximum allowable time specified in the Business Continuity Plan How long does it take you to get back up?

Recovery Point Objective (RPO) Duration of time and service level within which a business process must be restored after a disaster in order to avoid unacceptable consequences associated with a break in continuity How much data can I lose? When was the last backup before failure?

Risk Mitigation What failure scenarios must the data be protected against?

Risk Mitigation Backups: Can help mitigate failure scenarios (Multiple) Host Failure (Multiple) Data Center Failure Data Corruption or Loss Satisfy Legal Regulations Legislation Regulation Fulfill Industry Standards PCI HIPAA etc

Designing a Backup and Recovery System Based on the RTO, RPO, and address whatever risks are applicable Not all data should have the same requirements For example HR database could have a longer RTO than your customer facing product database. Cost of 1 hour outage for HR is small compared to not accepting orders for 1 hour.

Types of Backups

Physical or Binary Backup A physical backup typically refers to a copy of the entire on disk database Used to mitigate a single or multiple host failure Can build replicas Quick Full Recovery Time Slow to recover single row or table (user error)

Physical or Binary Backup MySQL Percona XtraBackup (takes a copy of the data directory and applies logs) MySQL Enterprise Backup LVM or VM Snapshot

XtraBackup - Backup Standard use: [mysql-master]# xtrabackup --backup --target-dir=/backup --user=root --password=x [mysql-master]# xtrabackup --prepare --target-dir=/backup Prepare was previously apply-log

XtraBackup - Restore Standard use: [mysql-restore]# scp r mysql-master:/backup [mysql-restore]# xtrabackup --copy-back --target-dir=/backup/ [mysql-restore]# chown R mysql.mysql /var/lib/mysql

Logical Backup Generates SQL files containing data that can regenerate a database Easily restore single row, table, or database Works across versions SQL (such as mysqldump) can be parsed with standard UNIX tools Restore process automatically replicated Long Full Restore Time

Logical Backup MySQL mysqldump mysqlpump (5.7+) mydumper Delayed slave can also fit similar use cases

mysqldump - Backup Standard use: [mysql-master]# mysqldump triggers routines events single-transaction all-databases -r dump.sql

mysqldump - Restore Standard use: [mysql-restore]# scp mysql-master:dump.sql [mysql-restore]# mysql < dump.sql [mysql-restore]# # OR: [mysql-restore]# mysql mysql> source dump.sql

Which is best? BOTH! Binary Backups Address Host Failure Logical Backups address data corruption and user error

Binary Logs Addresses RPO Logs should be rotated and backed up Combine with a Binary Backup to allow Point in Time recovery If you backup logs every hour, your RPO is 1 hour in case of a failure Can be reduced, but not to the point where the i/o and network traffic interfere with database operations Can stream logs for real-time RPO Adding complexity increases recovery time due to more complicated recovery procedures

Binary log streaming mysqlbinlog --raw --read-from-remote-server --stop-never --host mysqlmaster --port 3306 -u repl p somepass

Binary log streaming

Binary log streaming

Binary log streaming nohup livebinlog.sh server2.conf 2>&1 > livebinlog-server2.log & More information: https://www.percona.com/blog/2012/01/18/backing-up-binary-log-files-with-mysqlbinlog/

Other Considerations

Retention Protect Against Data Center Failure Keep multiple backups Counting on a single backup is a risk Corruption Malicious data User error Store important data offsite Cloud storage Google Nearline, Amazon Glacier Vaulting Ship drives/tapes DR site

Retention Standard Approach Up to a week on local server Up to 2 weeks within local datacenter Up to a month at a remote facility Monthly and/or annual backups remotely forever Longer retention periods Depending on business, legal and industry standards

Encrypt Sensitive Data Encrypt at rest on disk Encrypt when it leaves a secure environment Very important for offsite storage and multiple data centers Negatively affects backup and recovery times Adds complexity Potential failures in recovery Revoked or lost keys and passwords

Incremental and Differential Backups Records difference since last backup Allows smaller backups, ie full backup on Sunday and backup changes since the last backup daily Risky if one incremental goes corrupt Negatively affects RTO Take longer to restore

Monitoring Create alerts when backups fail Freshness Success/Failure Automated recovery systems should alert on RTO Graph to see how long backups take and when backups start and stop Determine system impact of backups

Recovery Testing DON T DO THIS AT 3 AM WHILE YOUR BUSINESS IS ON THE LINE

Recovery Testing Backups do not exist until you are certain they can be recovered Backups single purpose is to enable recovery during a disaster Recovery procedures should be tested on a regular basis, at least once a quarter

Recovery Testing Validates the correctness of your backups Provides metrics on recovery time and recovery point Can test by refreshing data to stage/test or development Restore and check for: Errors Data Size Checksums Result sets

Percona Can Help Percona can help you choose, implement, and optimize the most appropriate MySQL or MongoDB backup and recovery solution for your environment. Every situation is unique and we can work with you to create the most effective solution for your business.

Questions?

Get Your Tickets for Percona Live Europe! Championing Open Source Databases MySQL, MongoDB, Open Source Databases Time Series Databases, PostgreSQL, RocksDB Developers, Business/Case Studies, Operations September 25-27th, 2017 Radisson Blu Royal Hotel, Dublin, Ireland Early Bird Tickets Available Until 8 th! Prices Increase on the 9th!

DATABASE PERFORMANCE MATTERS