0% found this document useful (0 votes)
12 views10 pages

MongoDB-Architecture-and-Cloud-Connection

MongoDB is a NoSQL database that utilizes a document-oriented data model and supports horizontal scaling through its cloud service, MongoDB Atlas. Key components include mongod, mongos, and config servers, with features like replica sets for redundancy and sharded clusters for data distribution. Best practices for architecture include multi-AZ deployment, proper indexing, and regular backups to ensure performance and reliability.

Uploaded by

Kiran Kumar M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views10 pages

MongoDB-Architecture-and-Cloud-Connection

MongoDB is a NoSQL database that utilizes a document-oriented data model and supports horizontal scaling through its cloud service, MongoDB Atlas. Key components include mongod, mongos, and config servers, with features like replica sets for redundancy and sharded clusters for data distribution. Best practices for architecture include multi-AZ deployment, proper indexing, and regular backups to ensure performance and reliability.

Uploaded by

Kiran Kumar M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

MongoDB Architecture &

Cloud Connection
MongoDB is a leading NoSQL database. It is document-oriented and
supports horizontal scaling. MongoDB Atlas offers fully managed
cloud services.

by Kiran Kumar M
Core MongoDB
Components
mongod mongos Config
Primary Query router Servers
daemon for for sharded Store
data requests. clusters. metadata and
configuration
s.

Replica
Sets
Groups for
redundancy
and high
availability.
MongoDB Document Data Model
Documents Stored in BSON format, like JSON.

Collections Groups of related documents.

Flexible Schema Varying document structures allowed.

GridFS For files larger than 16MB.


Sharded Cluster
Architecture
Horizontal Scaling
1
Distributes data across multiple servers.

Shards
2
Each holds a subset of data as a replica set.

Config Servers
3
Store cluster metadata (CSRS).

mongos Routers
4
Client interface to the cluster.
Production Sharded Cluster Configuration
Minimum two shards for data distribution.
Each shard is a 3-member replica set for redundancy.
Config servers are a 3-member replica set.
Multiple mongos routers ensure high availability.
Distributed across 3+ data centers for resilience.
MongoDB Replica Set Architecture
A replica set is a group of mongod instances. They
maintain identical copies of your data. The primary node
handles all write operations. Secondary nodes replicate
data from the primary. Automatic failover occurs if the
primary fails. This ensures high availability and data
redundancy.
Atlas Well-Architected Framework
Security Operational Efficiency Performance
Access controls, encryption, Automation, monitoring, backups. Sizing, indexing, query
network isolation. optimization.

Reliability Cost Optimization


Multi-AZ deployments, automated failover. Right-sizing, auto-scaling capabilities.
Connecting to MongoDB Atlas
Create Account
Sign up at cloud.mongodb.com.

Configure Cluster
Set up your desired specifications.

Whitelist IP
Allow database access from your IP.

Create User
Set database permissions for a new user.

Get Connection String


Retrieve from Atlas dashboard.
MongoDB Client Connection Code
mongodb+srv://username:[email protected]/database

Use language-specific drivers for integration.


Connection pooling optimizes resource usage.
Authenticate with username/password or certificates.
Set read/write concerns for data consistency.
MongoDB Architecture Best Practices
Multi-AZ Deployment
Deploy across multiple zones for resilience.

Indexing
Implement proper indexing for query speed.

Sharding Patterns
Plan data distribution for efficiency.

Performance Monitoring
Continuously monitor system and resources.

Backups & DR
Regular backups and disaster recovery plans.

You might also like