- Newest
- Most votes
- Most comments
MongoDB Atlas on AWS:
MongoDB Atlas is a fully managed cloud database service that runs on AWS. It simplifies deployment, scaling, and maintenance.
You can start with a free tier and scale up as needed. It also integrates seamlessly with AWS services like Lambda and SageMaker.
Learn more about MongoDB Atlas here.
Self-Hosting on AWS EC2:
You can deploy MongoDB on an AWS EC2 instance. This gives you full control over the database configuration and management.
Steps:
Launch an EC2 instance.
Install MongoDB on the instance.
Configure security groups to allow access to MongoDB on the desired port.
This approach requires you to handle backups, scaling, and updates manually.
AWS DocumentDB (MongoDB-Compatible):
AWS offers DocumentDB, a managed database service that is compatible with MongoDB APIs.
While not a direct MongoDB instance, it provides similar functionality with the added benefit of being fully managed by AWS.
Using Docker on AWS:
Deploy MongoDB in a Docker container on AWS ECS (Elastic Container Service) or EKS (Elastic Kubernetes Service).
This approach is ideal if you're already using containerized applications.
There are two main options for hosting MongoDB in AWS:
- Self-managed MongoDB on Amazon EC2: You can install and configure MongoDB Community Edition on an Amazon EC2 instance. This approach gives you full control over the MongoDB installation and configuration. To set this up:
- Launch an Amazon EC2 instance
- Install MongoDB Community Edition following the MongoDB documentation for Amazon Linux
- Configure MongoDB to allow connections from within your Amazon VPC by editing the /etc/mongod.conf file
- Restart the MongoDB service
- Managed service with Amazon DocumentDB: Amazon DocumentDB is a fully managed document database service that is compatible with MongoDB. It offers several advantages:
- Fully managed service, eliminating operational overhead
- Designed for high performance, scalability, and availability
- Supports MongoDB 3.6 and 4.0 APIs
- Allows use of existing MongoDB drivers and tools
- Decoupled storage and compute, enabling independent scaling
- 99.99% availability with data replication across three Availability Zones
- Ability to add up to 15 low-latency read replicas
For existing MongoDB workloads, you can use AWS Database Migration Service (DMS) to migrate your on-premises or EC2-hosted MongoDB databases to Amazon DocumentDB with minimal downtime.
Choose the option that best fits your needs based on factors like required level of control, operational overhead, scalability requirements, and compatibility needs.
Sources
Install and configure MongoDB community edition - Database Migration Guide
AWS Database category icon Databases - Overview of Amazon Web Services
Use AMS SSP to provision Amazon DocumentDB (with MongoDB compatibility) in your AMS account - AMS Advanced Onboarding Guide
Relevant content
- asked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a month ago