• Contact Us
  • Support
  • Questions? Contact Us Today: 617.630.2800
  • Follow us on Twitter
  • Join our Facebook Group
  • Find us on LinkedIn
  • Subscribe to our RSS Feed
  • Search Site

  • Solutions
    • By Use Case
    • By Industry
    • By Delivery Model
  • Product
    • Product Architecture
    • Scale Out via Data Distribution
    • Scale Out via Read/Write Splitting
    • Admin & High Availability
    • Key Features / Benefits
    • Easing Capacity Planning
    • What is Database Sharding?
  • Resources
    • Datasheets
    • Case Studies
    • Whitepapers
    • Webinars
    • Videos
    • Scale Out Readiness Calculator
    • Database Assessment
    • Benchmark
    • Frequently Asked Questions
    • Documentation
  • Blogs
    • ScaleBase Blog
    • CTO Blog
  • Company
    • Customers
    • Management
    • News
      • Press Releases
      • Coverage
      • Events
    • Partners
    • Investors
    • Careers
    • Contact Us

You are here: ScaleBase / Blog / Architecture / Backing Up MySQL With ScaleBase

Backing Up MySQL With ScaleBase

12 Sep 2011 / 2 Comments / in Architecture, Blog, ScaleBase/by Paul Campaniello

Backing up data is critical for production databases – and there are a lot of well-known solutions for backing up databases.

When the database is sharded, backing up data becomes problematic. If the backup is not synchronized across all shards, data inconsistency might occur. In this blog post I’ll try to detail the possible backup scenarios for sharded databases when using ScaleBase.

Backup Types

Let’s start by understanding the different backup types that are out there. You can read all about it here.

A physical backup involves copying all database files to a different location. Copying can take several hours for a decent database if it’s done to a disk or a tape. It might take only seconds if the database files reside on SAN/NAS storage hardware that supports snapshot technology.

A logical backup is a copy of the logical database structure. It backs up meaningful data rather than the physical backup’s bits and bytes.  The logical backup is comprised of all CREATE TABLE statements and INSERT statements for the content.

Physical backup methods are faster than logical because they involve only file copying without conversion.

A full restore is also faster from a physical backup. However with a physical backup you can’t restore only one table, or selected specific data. If this is what you need, you’ll have to use logical backups.

Physical Backup

A physical backup can be cold, warm or hot.

Backup Type Single Database Sharded Database with ScaleBase
Cold
  1. Shut down the database server.
  2. Make the copy or snapshot.
  3. Start the database server.
  1. Shut down the ScaleBase instances that are connected to the database (using MySQLAdmin).
  2. Take the copy or snapshot (simultaneously) on all sharded databases.
  3. Startup the ScaleBase instances.
Warm
  1. Flush and lock all tables with the command “FLUSH TABLES WITH READ LOCK”.
  2. Perform the copy or snapshot.
  3. Then “UNLOCK TABLES”.
  1. Run the lock command through ScaleBase.
  2. While locked, take the copy or snapshot simultaneously on all databases.
  3. Run the unlock command through ScaleBase.
Hot Needs tools like “MySQL Enterprise Backup”, or “Percona xtrabackup”. Needs tools like “MySQL Enterprise Backup”, or “Percona xtrabackup” on all databases servers.

Logical Backup

1 DB Sharded
The most common command for a logical backup is:mysqldump –single-transaction –all-databases Run the command through ScaleBase.

Benefits of Backing Up with ScaleBase

The added value of using ScaleBase when backing up data is:

  • Vs. single database:
    • Backup takes only a fraction of the time. Since each database is smaller, copying the data is faster.
  • Vs. home-grown sharded environment:
    • Instead of updating backup scripts, just change the IP address to ScaleBase. Everything will continue working exactly as before.

2 Responses to Backing Up MySQL With ScaleBase

  1. Shlomi Noach says:
    September 13, 2011 at 9:13 am

    Hi,
    Some point I wish to clarify:

    - Warm backup: FLUSHing tables does not mean you can take a file system copy if you’re using InnoDB tables; this is unless you’re using the Google patch (or similar) for disabling InnoDB I/O. Do you?

    - Hot backup: how would you run Percona’s Xtrabackup on all database simultaneously? This highlights your earlier note: “If the backup is not synchronized across all shards, data inconsistency might occur”.

    - Snapshots: if you can take snapshots, and you’re on InnoDB-only DB, then you can make HOT backups (takes very small lock time for flushing the mysql data tables, though not required if they are unchanged).
    So, HOT does not mean you must use tools like “MySQL Enterprise Backup”, or “Percona xtrabackup”. LVM snapshots are just fine.

    Reply
  2. Doron Levari says:
    September 13, 2011 at 1:55 pm

    Hi Shlomi,

    Great input – thanks!!
    You are absolutely right about all bullets you wrote. I’ll elaborate a bit:

    1. Warm backup – all stated above is for MyISAM tables only and would NOT work on standard unpatched InnoDB

    2. Backups can be taken at any time, synchronization should be done in the restore and recovery from the bin log files. We’ll address that in our future blog, stay tuned!

    3. Snapshots: You are correct.

    Again thanks for the response.

    Doron

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to Blog


 

Tweet
database assessment
Popular
  • MemoryImageSeptember 6, 2011, 10:33 am
  • Backing Up MySQL With ScaleBaseSeptember 12, 2011, 8:34 am
  • Running TPC-C on MySQL/RDSJune 15, 2011, 8:45 pm
  • Can Prepared Statements Improve Your Scalability?May 23, 2011, 5:57 pm
Recent
  • Optimizing Sharding Policies to Scale Out MySQL – Part...June 13, 2013, 4:20 pm
  • TechTalk Webinar: Optimizing MySQL Shards – From Vision...June 5, 2013, 2:07 pm
  • ScaleBase Survey Finds That 59% of MySQL Users Have a Scalability...June 4, 2013, 7:27 am
  • ScaleBase presents a webinar on how to scale out MySQL on...May 29, 2013, 3:18 pm
Comments
  • [...] business model, and a strong executive. Scalebase,...February 4, 1:49 am by The Investing Edge of Enterprise IT
  • [...] Recently some customers running on Amazon EC2 asked...December 28, 3:27 pm by High Availability for your ScaleBase instance | MySQL | Syngu
  • [...] ScaleBase Releases Database TPC-C Performance Results...December 12, 2:29 pm by ScaleBase achieves 180K NO-TPM TPCC results on... | MySQL | Syngu
  • Hi Milo - I totally agree. You need to understand how you're...September 6, 10:33 am by liran
Tags
Amazon RDS application re-write Big Data Funding cloud sharding Database Availability database capacity database cloud database scalability database scalability strategy database sharding database virtualization data distribution data traffic manager Elastic Load Balancing Hadoop high availability Industry News MySQL MySQL 5.6 MySQL Clustering MySQL Scalability MySQL Scalability Issues MySQL scale out MySQL Sharding MySQL Tuning NewSQL next gen apps NOSQL scalability of databases Sharding single point of failure thread pool

Recent Comments

  • The Investing Edge of Enterprise IT on Management
  • High Availability for your ScaleBase instance | MySQL | Syngu on High Availability for your ScaleBase instance

Solutions

  • Solutions
    • Centralized Database Management & Visibility
    • Scalability
    • Database Availability
    • Delivery Models
    • Industry Solutions

Products

  • Product Overview
    • Product Architecture
    • Scale Out via Data Distribution
    • Scale Out via Read/Write Splitting
    • Data Traffic Management
    • Availability
    • Key Features / Benefits
    • Easing Capacity Planning
    • Database Sharding

Resources

  • Datasheets
  • Case Studies
  • Whitepapers
  • Webinars
  • Videos
  • Scale Out Readiness Calculator
  • Benchmark
  • Frequently Asked Questions
  • Documentation
  • Database Assessment

Company

  • Company
    • Customers
    • Management
    • News
    • Partners
    • Investors
    • Careers
© 2012 Scalebase Inc.

  • |Home
  • |Sitemap
  • |Privacy Policy
  • |Contact Us
  • |Blog