DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Join us today at 1 PM EST: "3-Step Approach to Comprehensive Runtime Application Security"
Save your seat
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Connecting to Amazon DocumentDB With MongoDB Drivers

Connecting to Amazon DocumentDB With MongoDB Drivers

Set up an Amazon DocumentDB cluster and connect using any CData Software Driver for MongoDB.

Jerod Johnson user avatar by
Jerod Johnson
·
Apr. 29, 19 · Tutorial
Like (2)
Save
Tweet
Share
10.54K Views

Join the DZone community and get the full member experience.

Join For Free

Amazon DocumentDB offers a way for developers and DBAs to balance availability, read scalability, and latency with five pre-configured consistency levels. The data in an Amazon DocumentDB cluster is accessible just like a MongoDB 3.6 cluster. The CData Software Drivers for MongoDB provide a SQL-like interface to MongoDB data through standards-based drivers, allowing users to see their data in the BI, reporting, and ETL tools of their choice, as well as in custom tools and applications.

This article walks through configuring an Amazon DocumentDB cluster and connecting to the cluster through any of the available CData Software MongoDB drivers.

NOTE: To interact with your Amazon DocumentDB cluster, you must launch an Amazon Elastic Compute Cloud (Amazon EC2) instance into your default VPC, in the same AWS Region where you created your Amazon DocumentDB cluster and install the CData drivers onto the EC2 instance.

Creating a DocumentDB Cluster

To create a DocumentDB cluster, log in to your AWS Console, select Amazon DocumentDB, and click Clusters and Create to add a new cluster. Once you create the cluster, you can connect to the cluster using the MongoDB client from an EC2 instance to populate the cluster. Once you have data in the Amazon DocumentDB cluster, you can connect using the CData MongoDB Drivers.

Connecting to an Amazon DocumentDB Cluster

With your cluster created, make note of the cluster details (found by clicking on the cluster name on the Clusters page).

The table below describes the mapping from the DocumentDB cluster details to the CData Driver properties:

CData Driver Property Amazon DocumentDB Property
Server Cluster endpoint
Port Port
User Master username
Password (set when you create the cluster)

In addition to the cluster details, you need to set a few more additional properties in the CData drivers to connect to an Amazon DocumentDB cluster:

  • UseSSL: True (Amazon DocumentDB Clusters have SSL enabled by default and this cannot be changed.)
  • SSLServerCert: * (This automatically accepts the certificate presented by the DocumentDB Cluster, which is already hosted within the same region and security group as the EC2 instance.)
  • Other: "UseFindAPI=true" (This is set to ensure compatibility with the DocumentDB version of the MongoDB API.)

With all of the properties, your standard connection string would look like the following:

view source

Server=<cluster-name>.cluster-xxxxxxxxxxxx.<region>.docdb.amazonaws.com; Port=27107; User=myMaster; Password=myPassword; UseSSL=True; SSLServerCert=*; Other='UseFindAPI=True';

Once the connection properties are set, you can quickly connect to your Amazon DocumentDB account using any of the MongoDB Drivers. Download a free trial of any of the drivers to start working with your DocumentDB data in the BI, reporting, ETL, and custom tools that you are already using.

Driver (software) cluster MongoDB

Published at DZone with permission of Jerod Johnson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Choosing the Best Cloud Provider for Hosting DevOps Tools
  • Top Five Tools for AI-based Test Automation
  • Memory Debugging: A Deep Level of Insight
  • Why Does DevOps Recommend Shift-Left Testing Principles?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: