Home > Storage > PowerFlex > White Papers > Dell APEX Block Storage for AWS: MongoDB using Kubernetes and PowerFlex CSI > MongoDB architecture
MongoDB is an open-source NoSQL database that supports JSON-type data structures. MongoDB can be used to store a large volume of data and has a schema-less data model. It supports vertical and horizontal scaling. However, cloud-based providers have hard ceilings based on available instance configurations. As a result, there is a practical maximum for vertical scaling.
MongoDB supports horizontal scaling through sharding. Horizontal scaling divides the system dataset and load over multiple servers, adding additional servers to scale capacity as required. Each machine handles a subset of the overall workload, potentially providing better efficiency and higher throughput than a single high-speed, high-capacity server. MongoDB uses sharding to support deployments with large datasets and high-throughput operations.
The following figure shows the high-level architecture of a MongoDB sharded cluster:
A MongoDB sharded cluster consists of the following components:
• Shard—Each shard contains a subset of sharded data and can be deployed as replica set.
• Mongos—Mongos acts as a query router, providing an interface between client applications and the sharded cluster. It can support hedged reads to minimize latencies.
• Config servers—The servers store metadata and configuration settings for the cluster.
A typical MongoDB production deployment has secondary copies of each shard to increase the cluster resiliency. These copies are referred to as a replica set with a default of three copies, which means one primary and two secondary copies. Replica Sets are the solution for a single point of failure. MongoDB uses a primary-secondary architecture. The inside mechanism of each shard has a replica set. For more information about MongoDB replica sets, see the MongDB replica set documentation. Read-preference and write-concern parameters can be used to determine if these copies can be used to service reads.