Sharding MongoDB: What it Is, How it Works & When to Use It
Автор: Database Dive
Загружено: 2024-10-22
Просмотров: 137
Описание:
Many developers and DBAs came across a situation where a database server became ill-equipped to handle daily workloads.
In such situations, people usually turn to sharding.
This MongoDB sharding video will explain what does MongoDB sharding mean and why is it important.
This MongoDB sharding tutorial will tell you that MongoDB sharding, simply put, is a method of distributing data across multiple servers.
This MongoDB tutorial will tell you that MongoDB sharding is necessary when data becomes big enough and your database server starts facing challenges related to data and throughput.
Sharding in MongoDB is supported by horizontal scaling.
MongoDB horizontal scaling splits the load of the server across multiple servers, thus reducing the load on a single server.
That way, a single server handles only a part of the workload.
Horizontal scaling increases complexity in managing the infrastructure, but at the same time comes with lower cost than high-end hardware for a single machine.
A sharded MongoDB deployment is often referred to as a sharded MongoDB cluster.
Each MongoDB sharded cluster contains three components: a shard that contains a subset of the sharded data, a query router called mongos, and configuration servers that store metadata and configuration settings related to the MongoDB database cluster.
For a MongoDB sharded cluster, MongoDB recommends using a cluster of MongoDB servers that are capable of implementing replication and automated failover. This MongoDB tutorial will tell you that such server cluster is known as a replica set and a sharded cluster will most likely be deployed by deploying config servers and each shard as 3-member replica sets. Additionally, one would need to deploy one or more mongos routers.
Also, this NoSQL tutorial will tell you that it's recommended to deploy at least one member of the replica set in a location that's suitable to be used for disaster recovery.
As far as the number of database shards in a MongoDB sharding setup is concerned, MongoDB recommends using at least two shards for sharded data distribution.
This MongoDB sharding tutorial will tell you that when it comes to mongos, one should either embed the routers at the application level or add mongos instances on the same hardware where other mongos instances are running.
Follow this MongoDB tutorial and you'll know that if you use a proxy or load balancer in between the application and the mongos routers, you should configure it for client affinity to allow every connection from a single client to reach the same mongos routers. Client affinity refers to a consistent client connection to a specified data source.
This MongoDB sharding tutorial will provide you with a common sharded cluster architecture as well as a demo MongoDB sharding deployment.
For demo MongoDB sharding deployments, MongoDB recommends deploying a sharded MongoDB cluster with a minimum number of components, these being a mongos instance, a single-shard replica set, and a replica set configuration server.
Do you use the sharding features provided by MongoDB?
Share your thoughts in the comment section and until next time.
Music:
Reflection by Filo Starquez: / filo-starquez
Creative Commons — Attribution - NoDerivs 3.0 Unported — CC BY-ND 3.0
Free Download / Stream: https://www.audiolibrary.com.co/filo-...
Music promoted by Audio Library: • Lo-fi, Hip-Hop, Instrumental No Copyright ...
#mongodb #nosql #database #software #coding
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: