Tuesday, August 6, 2013

3 Reasons You Should Use DynamoDB over MongoDB

Recently I post a blog to share my experience of migrating from MongoDB to DynamoDB. Migration is smooth, and here are a summary of 7 reason we did the migration:

Reason 1: Use DynamoDB if you are NOT going to have an employee to manage the database servers. 
This is the top 1 reason I migrate from MongoDB to DynamoDB. We are launching a startup, and we have a long list of user requirements from early adoption users. We want to make them satisfied. I need to develop the Windows/Mac OS/Ubuntu software and iPhone/Android apps, also need to work on server to provide data synchronization among these apps. Kelly is not a technically people and didn't have experience on managing servers. Someone may said that people can be a web developer with 21 days. However, that's really not easy for server troubleshooting. With only 15k users and 1.4 million records, I start to get into serious troubles. From the last post,  the more data I stored, the more worse the database latency. In future when I set sharding and replica set for shardings, I can imagine that database management may take a big portion of my time in future. With DynamoDB, you can totally avoid any database management stuff. AWS manages it very well. I've migrated the database for one week, everything works very well.

Reason 2: Use DynamoDB if you didn't have budget for dedicated database servers.
Because I didn't have too much traffic and data records. I used 2 linode VPS as database servers, 1G RAM, 24G disk. The 2 database server is grouped as replica set, and no sharding yet. Ideally they should support my current data scale very well. However it's not true. Upgrading database servers will take more cost, and may still not be able to resolve the issue. There are some managed MongoDB services, but I may not be able to stand for the cost. With current user base, the MongoDB database occupied 8G disk on data and 2G disk on journal file. With managed mongodb service, I need to select 25G plan and starting from US$500 monthly fee. If I got more traffic and users, it would cost too much. Before migration, I tested on DynamoDB, migrating all the data to DynamoDB, that is, 1.4 million records. The actually space is less than 300M. I'm not sure how managed mongodb service, I use command in mongo console to get the disk usage statistics. My first week of cost on DynamoDB is, US$0.05. That's the last week of July, let's see how much it will cost in August.

Reason 3: Use DynamoDB if you are going to integrate with other Amazon Web Services.
For example, full text index of the database. There are solutions for MongoDB, but you need to setup additional servers for indexing and search, and understand the system. The good thing is that MongoDB provided full text index, but I can imagine that full text index for multiple languages is not easy, especially the Chinese word segmentation. Amazon CloudSearch is a solution for DynamoDB full text index. Another example could be AWS Elastic MapReduce, it can be integrated with DynamoDB very easily. Also for database backup and restore, Amazon has other services to integrate with DynamoDB. In my opinion, as the major NoSQL database in Amazon Web Services, DynamoDB will have more and more features, and you can speed up development and reduce the cost of server management by integrating Amazon Web Services.

However, DynamoDB has it's shortcomings. Before you made the decision on using DynamoDB, please read 7 Reasons You Should Use MongoDB over DynamoDB.

8 comments:

  1. Nice post! Mason, perhaps you could update us on DynamoDB? Are you still using it in production? How are the monthly costs working out?

    ReplyDelete
  2. Very useful post you shared here and I really love your tutorials. keep posting.
    Ecommerce and CMS web development in chennai

    ReplyDelete
  3. Excellent post and it very useful...Thanks for sharing such an informative post
    false ceiling in chennai

    ReplyDelete
  4. thanks for your good articles (both about why mongodb and why dynamodb). I am going to use Amazon s3 and ec2 as a service. You suggest me to use Dynamodb even if my decision is mongodb for that 7 reasons? And if i use Dynamodb or mongo db is it easy to migrate to the other?

    ReplyDelete
  5. thanks for your good articles (both about why mongodb and why dynamodb). I am going to use Amazon s3 and ec2 as a service. You suggest me to use Dynamodb even if my decision is mongodb for that 7 reasons? And if i use Dynamodb or mongo db is it easy to migrate to the other?

    ReplyDelete
  6. I feel happy about and I really like this learning more about this topic. keep sharing your information regularly for my future reference.
    http://www.thinkittraining.in/php-training

    ReplyDelete
  7. There are many ways on how the people can keep all the activities for the proper migration from MongoDB to DynamoDB.The avoicefromthemiddle.com is creating some advanced techniques where the people can share their ideas and experiences for the forthcoming events.

    ReplyDelete