Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB backup strategy for AWS

If I have mongodb running in an EC2 instance that is being written to (somewhat) constantly what is the most intelligent, safe, and inexpensive backup strategy.

My concern is that if an EC2 instance goes down you lose any data written to disk...

like image 406
ComputationalSocialScience Avatar asked Feb 23 '11 00:02

ComputationalSocialScience


People also ask

Is MongoDB compatible with AWS?

MongoDB is an AWS Partner. To launch a fully managed MongoDB cluster on AWS, try it for free from AWS Marketplace. AWS Service Catalog administrators can add this architecture to their own catalog.

How does MongoDB work with AWS?

It supports a flexible data model that enables you to store data of any structure, and provides a rich set of features, including full index support, sharding, and replication. AWS enables you to set up the infrastructure to support MongoDB deployment in a flexible, scalable, and cost-effective manner on the AWS Cloud.

What are the various backup approaches in MongoDB?

MongoDB provides three major strategies to backing up data: Mongodump, Copying the Underlying Files and Mongo Management Service (MMS). Selection of which strategy is dependent on factors like cost of maintenance, Shards deployment complexity, flexibility and database performance impact.


2 Answers

Old question but I think that I can contribute with more details and informations about a real success case.

In a production environment I have 3 Mongodb with replicaset running in 3 T2.micro instances, 1 instance is the primary, 1 instance is the secondary and 1 instance is delayed (every 4 hours is synchronized) with persistent EBS (it's not deleted after instance reboot). Every 4.5 hours I start a Lambda process that makes a EBS snapshot of delayed instance and sends to a S3 bucket. This is working pretty well.

Some links that can help:

  • Scheduling EBS Snapshots - Part I
  • Scheduling EBS Snapshots - Part II
like image 181
danilodeveloper Avatar answered Sep 30 '22 02:09

danilodeveloper


Who better than 10gen (MongoDB developers) to responds you.

You can see in follogin site, official documentation about MongoDB backups in EC2 instances. http://docs.mongodb.org/ecosystem/platforms/amazon-ec2/

They suggest an EBS snapshots. This solution permits start instance in a few of seconds with a "photo" of your database.

like image 41
Ferran Arau Castell Avatar answered Sep 30 '22 02:09

Ferran Arau Castell