Skip to main content

Architecture

MongoDB Architecture MongoDB follows a document-oriented database architecture with several key components:

Core Components

  • mongod: The primary database process that handles data requests, manages data access, and performs background management operations

  • mongos: The routing service for MongoDB sharded clusters that processes queries from the application layer

  • Config Servers: Store metadata and configuration settings for the entire cluster

  • Replica Sets: Groups of mongod processes that maintain the same data set, providing redundancy and high availability

Storage Architecture

  • WiredTiger Storage Engine: Default storage engine providing document-level concurrency control

  • Collections: Groups of MongoDB documents, equivalent to tables in relational databases

  • Documents: BSON (Binary JSON) format data structures composed of field-value pairs

  • Indexes: Data structures that improve query performance by providing efficient access paths

Sharding Architecture

  • Shard Key: Determines how data is distributed across shards

  • Chunks: Logical groups of documents based on shard key ranges

  • Balancer: Automatically distributes chunks across shards for optimal performance