sine99
sine99

Reputation: 97

How can I deploy Mongo database on AWS?

I am building my own webapp which requires a huge database. I want to build and manage my own Mongo database on AWS rather than using Mongo Atlas. Which will be more cost saving? And whether I should go for Mongo Atlas? What will be its advantage over my own database?

Upvotes: 1

Views: 2186

Answers (2)

Akber Iqbal
Akber Iqbal

Reputation: 15031

HOSTING yourself: You can get one or more AWS ec2 instances(which are VMs) where you can install and run Mongo DB yourself and manage it like you wanted to, making sure that you spin up more instances when the workload becomes large and there are instances up and running at all times to enable high availability. Cost (high) - Management responsibilities (lots) - Full MongoDB functionality

MongoDB Atlas is a managed service, you don't need to worry about management tasks like scaling of your database and high availability when a single/more instances die... You pay a very low cost for it - this is run by MongoDb themselves on AWS, Azure, Google cloud; Cost (low) - Management responsibilities (some) - Full MongoDB functionality

Now AWS has its own Mongo compatible database called DocumentDB - this is also a managed database, so you don't need to worry about scalability, high availability etc. This is only available on AWS so super simple and convinient. Cost (low) - Management responsibilities (minimal) - Limited MongoDB functionality

Upvotes: 2

Sashi
Sashi

Reputation: 2867

There are pros and cons for both approaches:

Running MongoDB on AWS

Pros:

Complete control over how you run the database and how resources are allocated on the server. This could even be together with an application server on the same EC2 instance depending on your traffic and load. This might help with cost saving if your database is huge but isn't likely to see much traffic.

Cons:

  1. You will be responsible for ensuring database availability and applying security patches as and when they are available. You may also have to setup firewalls and protect the EC2 instance and database in other ways that would be trivial to do on a hosted service like Atlas.

  2. Data sharding and clustering can be a real pain to manage by yourself.

Running on Atlas

Pros:

  1. Completely managed service where you don't have to be concerned about performance optimization or scalability. You pay for the services and Mongodb takes care of the rest.

  2. You can focus on building a great application instead of spending your time on administering the database and the EC2 instance on which the database runs.

Cons:

  1. You will be constrained by the options offered by Atlas. For most use cases this should be fine, but if you really want a specific change, it would be difficult to implement it if Mongodb doesn't already support it as a part of Atlas.

  2. Think running your application on EC2 vs buying a server on-premise and running your application on that.

  3. Being a managed service, costs might also be higher if your database does not see much traffic.

Upvotes: 3

Related Questions