Coder Social home page Coder Social logo

rds-s3-backup's Introduction

What is this?

This is a simple ruby script to take SQL dumps of RDS instances in an unobtrusive way.

Why would I need it?

RDS snapshots are not enough, they are tied to the region and sometimes the availability zone of the server from which they were taken. If an earthquakyphoonicane hits Virginia you won't be able to get to your snapshots. With SQL dumps in S3, however, you are much more likely to be able to bring your server up elsewhere.

This script uses Fog to take a snapshot of your server and start a temporary server based on that snapshot. Then mysqldump is run to get the raw SQL out and put on the disk. Fog then is used to put that SQL file into S3, and clean up the snapshot and the temporary server.

This approach works great for a multi-AZ primary database server with no replication slaves. If you have replicated slaves you should dump straight from those instead. This script doesn't do that, though it could be easily modified to do so.

How can I use it?

You'll need mysqldump, gzip, ruby 1.9.x, and the fog and thor gems on your system. It has a command line interface with like a million options since the script needs so much access to do its job, or you can point it to a YAML file with options instead.

The easiest way to use it is to configure a Chef role using this cookbook.

Or use direct with:

ruby rds-s3-backup.rb s3_dump --config-file=config.yml

How can I trust it?

It has been working well in our production site for some time, but don't take my word for it.

rds-s3-backup's People

Contributors

davidebettio avatar intjonathan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.