Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7743141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:27:19+00:00 2026-06-01T09:27:19+00:00

We are currently implementing a solution where we have a collection which we want

  • 0

We are currently implementing a solution where we have a collection which we want to shard based on the following fields:

Year (INT)

Month (INT)

We expect to generate around 2GB of data per year for the collection.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:27:21+00:00Added an answer on June 1, 2026 at 9:27 am

    If you don’t mind me asking, why are you considering sharding? 2GB should easily fit on a single server.

    This being said, if you are definitely going to shard your collection, then it is important to choose a non-incrementing shard key that is finely-grained enough such that a situation can never occur in which chunks can not be split.

    For example, if a collection were split by Month alone then there would be only 12 possible chunks. If January was a popular month for inserts, the situation could arise where a million (just to pick an arbitrary large number) records could be inserted into that chunk, and it would never be able to be split.

    It is also important not to choose a shard key that increments (or decrements). As new documents are inserted into the collection, each subsequent document will be added into the same chunk, until this chunk reaches its size limit and must be split. The lower chunk may then be moved to a different server, creating a “waterfall” effect (one shard keeps filling up with chunks, which then get moved to other shards). Meanwhile, all new documents are constantly being written to the same shard creating what is known as a “hot spot”. If the insert rate is sufficient, the disk could reach its IO limit attempting to write new documents while migrating existing data to another shard at the same time.

    The Mongo “Sharding Introduction” document has more details on how
    documents are stored in a sharded collection.
    http://www.mongodb.org/display/DOCS/Sharding+Introduction

    Additionally, the Mongo Document “Choosing a Shard Key” provides good
    details on what to consider when choosing a shard key.
    http://www.mongodb.org/display/DOCS/Choosing+a+Shard+Key

    If possible, I recommend reading “Scaling MongoDB” by Kristina Chodorow.
    http://shop.oreilly.com/product/0636920018308.do This provides an excellent introduction to sharding as well as more detailed explanations on the Dos and Donts of choosing shard keys that I mentioned above.

    Here are links to some questions that other users have asked regarding sharding and choosing Shard Keys. (You may recognize some of the links and some of the authors ) Hopefully these resources will improve your understanding of how sharding works, and if you still decide to shard your collection, allow you to choose an efficient shard key.

    “sharding imbalance” – http://groups.google.com/group/mongodb-user/browse_thread/thread/1328250382087448

    “What is a best method to design the shard index for this dataset” – http://groups.google.com/group/mongodb-user/browse_thread/thread/5bda4a39d9be54f5

    “low cardinality shard keys” – http://groups.google.com/group/mongodb-user/browse_thread/thread/3c96d1c254f113b1

    “shard key analysis” – http://groups.google.com/group/mongodb-user/browse_thread/thread/9cf0b8657d4515e2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

VS2K8, C#. I currently have a solution with the following projects: Core - POCO
I'm currently implementing iterative solvers, which work by successively improving the estimate the solution
i am currently implementing a binary tree in c++ and i want to traverse
I'm currently implementing a HTML canvas based webapp that features panning. Is there a
I'm currently struggling to understand how I should organize/structure a class which I have
I am currently working on implementing puppet in our environment, however, I have a
I'm currently making an application for WP7 where I'm implementing a currency exchange solution.
I am currently implementing my dashboard. My current solution for buttons is this: <LinearLayout
We currently have a J2EE system implementing most of the OWASP top 10 security
I am currently implementing a client-side paging solution using ASP.NET, jQuery and JSON. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.