Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
MongoDB High Availability

You're reading from  MongoDB High Availability

Product type Book
Published in Jul 2014
Publisher
ISBN-13 9781783986729
Pages 164 pages
Edition 1st Edition
Languages
Author (1):
Afshin Mehrabani Afshin Mehrabani
Profile icon Afshin Mehrabani

Table of Contents (17) Chapters

MongoDB High Availability
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Understanding the MongoDB Architecture and Processes Understanding MongoDB's Failures and Limitations Clustering in MongoDB Utilizing a Replica Set Replica Set in Action Understanding the Concept of Sharding Sharding in Action Analyzing and Improving Database Performance Migrating Instances and Reducing Downtime Monitoring and Troubleshooting the Database Index

Learning about sharding


The good news is that MongoDB has come up with a clever solution to scale your database system easily. Sharding is a technique used to scale a database horizontally.

Using sharding, the entire database is divided into separate single databases on different machines. Finally, using a query router, all the separate nodes make a single logical database.

Let's look at an example of sharding. Suppose we have a database sized 1 TB. Storing such a large dataset on a single server is a big challenge, so we use sharding to divide the entire database into smaller instances called shards.

In order to reduce the size of the entire database, we divide it into databases sized 256 GB. During the sharding procedure, each part of the database is divided using a shard key and other options that configure settings for shards such as the size of the dataset.

The following diagram illustrates the example of a 1 TB database being sharded across four instances:

The benefits of using sharding...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}