Sharding
Picture a library whose one room is full. The library opens more rooms, and each room keeps the books for one part of the alphabet. Sharding does the same for data: it splits one big database into smaller parts on different servers.
6 min read6 মিনিটে পড়া যায় · 11 sections11টি সেকশন · 8 sources8টি সোর্স · updated Nov 2026আপডেট: Nov 2026
Sharding and the shard keyশার্ডিং আর শার্ড কী (shard key)
Send the same 24 test runs to 4 shards with two different keys, and see which shard gets the load.একই ২৪টি টেস্ট রান দুটি আলাদা কী দিয়ে ৪টি শার্ডে পাঠান, আর দেখুন কোন শার্ডে লোড পড়ে।
You’ll learnআপনি শিখবেন
- What a shard key doesশার্ড কী কী করে
- How a key spreads rows over shardsকী কীভাবে সারি শার্ডে ছড়ায়
- Why one shard becomes hotকেন একটি শার্ড হট হয়
- Why a key costs reads or writesকেন কী-এর দাম পড়ে রিড বা রাইটে
In plain words
Sharding divides a data store into horizontal partitions, called shards Source 8সোর্স 8. Every shard has the same schema, but each one holds its own different subset of the data Source 8সোর্স 8. A shard runs on a server that works as a storage node Source 8সোর্স 8. MongoDB uses the word for the same idea: spreading data across several machines Source 1সোর্স 1.
সহজ English
Sharding divides a data store into horizontal partitions. The partitions are called shards. Source 8সোর্স 8 Every shard has the same schema. But each one holds its own different subset of the data. Source 8সোর্স 8 A shard runs on a server that works as a storage node. Source 8সোর্স 8 MongoDB uses the word for the same idea: spreading data across several machines. Source 1সোর্স 1
বাংলা ব্যাখ্যা
শার্ডিং (sharding) একটি ডেটা স্টোরকে হরাইজন্টাল পার্টিশনে ভাগ করে। পার্টিশনগুলোকে বলে শার্ড (shard)। Source 8সোর্স 8 প্রতিটি শার্ডের স্কিমা একই। কিন্তু প্রতিটি শার্ড ডেটার নিজস্ব আলাদা একটি উপসেট রাখে। Source 8সোর্স 8 একটি শার্ড এমন একটি সার্ভারে চলে, যা একটি স্টোরেজ নোড হিসেবে কাজ করে। Source 8সোর্স 8 MongoDB একই ধারণার জন্য শব্দটি ব্যবহার করে: ডেটা কয়েকটি মেশিনে ছড়িয়ে দেওয়া। Source 1সোর্স 1
When you need it
One server has limits: disk space, computing power, network bandwidth, and sometimes legal rules about where data must live Source 8সোর্স 8. A bigger server only postpones these limits Source 8সোর্স 8. Horizontal scaling splits the data and the load over more servers, and the trade-off is more complexity Source 1সোর্স 1.
Azure warns that sharding adds complexity for the life of the system. It may not fit if the data fits in one instance, or if reads are the bottleneck, because read replicas and caches can help Source 8সোর্স 8.
সহজ English
One server has limits. These are disk space, computing power, network bandwidth, and sometimes legal rules about where data must live. Source 8সোর্স 8 A bigger server only delays these limits. Source 8সোর্স 8 Horizontal scaling splits the data and the load over more servers. The trade-off is more complexity. Source 1সোর্স 1
Azure warns that sharding adds complexity for the life of the system. It may not fit in two cases. One case is when the data fits in one instance. The other case is when reads are the bottleneck, because read replicas and caches can help. Source 8সোর্স 8
বাংলা ব্যাখ্যা
একটি সার্ভারের সীমা আছে। এগুলো হলো ডিস্ক স্পেস, কম্পিউটিং পাওয়ার, নেটওয়ার্ক ব্যান্ডউইথ এবং কখনো ডেটা কোথায় থাকতে হবে সে সম্পর্কিত আইনি নিয়ম। Source 8সোর্স 8 একটি বড় সার্ভার এই সীমাগুলো শুধু পিছিয়ে দেয়। Source 8সোর্স 8 হরাইজন্টাল স্কেলিং (horizontal scaling) ডেটা ও লোড আরও বেশি সার্ভারে ভাগ করে। এর বিনিময় হলো বেশি জটিলতা। Source 1সোর্স 1
Azure সতর্ক করে যে শার্ডিং সিস্টেমের পুরো জীবনের জন্য জটিলতা যোগ করে। দুই ক্ষেত্রে এটি না-ও মানাতে পারে। এক ক্ষেত্র হলো ডেটা একটি ইনস্ট্যান্সে ধরে গেলে। অন্য ক্ষেত্র হলো রিড বটলনেক (bottleneck) হলে, কারণ রিড রিপ্লিকা ও ক্যাশ সাহায্য করতে পারে। Source 8সোর্স 8
How it works
A shard key is one or more attributes of the data. It decides which shard holds an item Source 8সোর্স 8. The sharding logic sends each read and write to the right shard, in the application code or in the data store Source 8সোর্স 8. MongoDB adds a router, called mongos, in front of the shards Source 1সোর্স 1.
Azure describes these strategies; the table shows three of its four Source 8সোর্স 8:
| Strategy | How it picks the shard | Strength | Weakness |
|---|---|---|---|
| Lookup | A map from key to shard | More control over the layout | Looking up the location costs time |
| Range | Neighbouring key values stay together | Good for range queries | Load may not be even |
| Hash | A hash of the key | Better chance of even data and load | Rebalancing is hard without consistent hashing |
| Geographic | Data goes to the shard for its region | Meets data-residency rules and cuts latency for local users | Load can be uneven if most users are in one region |
MongoDB offers the range and hash methods. Ranged sharding is the default Source 4সোর্স 4. Hashed sharding spreads data more evenly, but values that are close together are unlikely to share a shard, so a range query is more likely to go to every shard Source 5সোর্স 5.
MongoDB cuts the span of shard key values into non-overlapping ranges, and each range belongs to a chunk Source 2সোর্স 2. A chunk has an inclusive lower limit and an exclusive upper limit Source 6সোর্স 6.
সহজ English
A shard key is one or more attributes of the data. It decides which shard holds an item. Source 8সোর্স 8 The sharding logic sends each read and write to the right shard. It lives in the application code or in the data store. Source 8সোর্স 8 MongoDB adds a router, called mongos, in front of the shards. Source 1সোর্স 1
Azure describes these strategies; this list shows three of its four: Source 8সোর্স 8
- Lookup: a map from key to shard. Strength: more control over the layout. Weakness: looking up the location costs time.
- Range: neighbouring key values stay together. Strength: good for range queries. Weakness: load may not be even.
- Hash: a hash of the key picks the shard. Strength: better chance of even data and load. Weakness: rebalancing is hard without consistent hashing.
- Geographic: data goes to the shard for its region. Strength: meets data-residency rules and cuts latency for local users. Weakness: load can be uneven if most users are in one region.
MongoDB offers the range and hash methods. Ranged sharding is the default. Source 4সোর্স 4 Hashed sharding spreads data more evenly. But values that are close together are unlikely to share a shard. So a range query is more likely to go to every shard. Source 5সোর্স 5
MongoDB cuts the span of shard key values into non-overlapping ranges. Each range belongs to a chunk. Source 2সোর্স 2 A chunk has an inclusive lower limit and an exclusive upper limit. Source 6সোর্স 6
বাংলা ব্যাখ্যা
একটি শার্ড কী (shard key) হলো ডেটার এক বা একাধিক অ্যাট্রিবিউট। এটি ঠিক করে কোন শার্ড একটি আইটেম রাখবে। Source 8সোর্স 8 শার্ডিং লজিক প্রতিটি রিড ও রাইট সঠিক শার্ডে পাঠায়। এটি অ্যাপ্লিকেশন কোডে বা ডেটা স্টোরে থাকে। Source 8সোর্স 8 MongoDB শার্ডগুলোর সামনে mongos নামের একটি রাউটার যোগ করে। Source 1সোর্স 1
Azure এই স্ট্র্যাটেজিগুলো বর্ণনা করে; এই তালিকায় এর চারটির মধ্যে তিনটি আছে: Source 8সোর্স 8
- লুকআপ (Lookup): কী থেকে শার্ডের একটি ম্যাপ। শক্তি: লেআউটের ওপর বেশি নিয়ন্ত্রণ। দুর্বলতা: অবস্থান খুঁজতে সময় লাগে।
- রেঞ্জ (Range): পাশাপাশি কী ভ্যালু একসাথে থাকে। শক্তি: রেঞ্জ কোয়েরির জন্য ভালো। দুর্বলতা: লোড সমান নাও হতে পারে।
- হ্যাশ (Hash): কী-র একটি হ্যাশ শার্ড বাছে। শক্তি: ডেটা ও লোড সমান হওয়ার সম্ভাবনা বেশি। দুর্বলতা: কনসিসটেন্ট হ্যাশিং ছাড়া রিব্যালেন্সিং কঠিন।
- জিওগ্রাফিক (Geographic): ডেটা তার অঞ্চলের শার্ডে যায়। শক্তি: ডেটা-রেসিডেন্সির নিয়ম মানা যায় এবং স্থানীয় ব্যবহারকারীদের ল্যাটেন্সি কমে। দুর্বলতা: বেশিরভাগ ব্যবহারকারী একটি অঞ্চলে থাকলে লোড অসম হতে পারে।
MongoDB রেঞ্জ ও হ্যাশ পদ্ধতি দেয়। রেঞ্জড শার্ডিং ডিফল্ট। Source 4সোর্স 4 হ্যাশড শার্ডিং ডেটা আরও সমানভাবে ছড়ায়। কিন্তু কাছাকাছি ভ্যালু একই শার্ডে থাকার সম্ভাবনা কম। তাই একটি রেঞ্জ কোয়েরি প্রতিটি শার্ডে যাওয়ার সম্ভাবনা বেশি। Source 5সোর্স 5
MongoDB শার্ড কী ভ্যালুর বিস্তারকে একে অপরের সাথে ওভারল্যাপ করে না এমন রেঞ্জে কাটে। প্রতিটি রেঞ্জ একটি চাঙ্কের (chunk) অন্তর্গত। Source 2সোর্স 2 একটি চাঙ্কের নিচের সীমা অন্তর্ভুক্ত এবং ওপরের সীমা বাদ। Source 6সোর্স 6
Choosing a shard key
Azure calls the shard key the most critical design decision. To change it later, you usually must move all the data to a new layout, which is costly and risky Source 8সোর্স 8. In MongoDB 5.0 and later you can reshard a collection or refine its shard key, but it is still a large operation Source 3সোর্স 3. An effective key does not change, has many different values, spreads data and load evenly, and fits the main queries Source 8সোর্স 8. MongoDB asks you to look at three things: how many different values the key has (cardinality), how often each value occurs (frequency), and whether the value grows in one direction (monotonic change) Source 3সোর্স 3.
সহজ English
Azure calls the shard key the most critical design decision. To change it later, you usually must move all the data to a new layout. This is costly and risky. Source 8সোর্স 8 In MongoDB 5.0 and later you can reshard a collection or refine its shard key, but it is still a large operation. Source 3সোর্স 3 An effective key does four things. It does not change. It has many different values. It spreads data and load evenly. It fits the main queries. Source 8সোর্স 8 MongoDB asks you to look at three things. The first is how many different values the key has (cardinality). The second is how often each value occurs (frequency). The third is whether the value grows in one direction (monotonic change). Source 3সোর্স 3
বাংলা ব্যাখ্যা
Azure শার্ড কী-কে সবচেয়ে গুরুত্বপূর্ণ ডিজাইন সিদ্ধান্ত বলে। পরে এটি বদলাতে সাধারণত সব ডেটা একটি নতুন লেআউটে সরাতে হয়। এটি ব্যয়বহুল ও ঝুঁকিপূর্ণ। Source 8সোর্স 8 MongoDB 5.0 ও তার পরের সংস্করণে আপনি একটি কালেকশন রিশার্ড করতে বা তার শার্ড কী রিফাইন করতে পারেন, তবে এটি এখনও একটি বড় অপারেশন। Source 3সোর্স 3 একটি কার্যকর কী চারটি কাজ করে। এটি বদলায় না। এতে অনেক আলাদা ভ্যালু থাকে। এটি ডেটা ও লোড সমানভাবে ছড়ায়। এটি প্রধান কোয়েরির সাথে মানায়। Source 8সোর্স 8 MongoDB আপনাকে তিনটি জিনিস দেখতে বলে। প্রথমটি হলো কী-তে কতগুলো আলাদা ভ্যালু আছে (কার্ডিন্যালিটি, cardinality)। দ্বিতীয়টি হলো প্রতিটি ভ্যালু কতবার আসে (ফ্রিকোয়েন্সি, frequency)। তৃতীয়টি হলো ভ্যালু এক দিকে বাড়তে থাকে কি না (মনোটনিক পরিবর্তন, monotonic change)। Source 3সোর্স 3
Hot spots
A hot spot is a shard that gets much more load than the others Source 8সোর্স 8. These keys cause them Source 8সোর্স 8:
- Values that only grow, such as auto-increment numbers and sequential timestamps. In MongoDB, all new inserts go to the chunk at the top of the range, and its shard becomes the bottleneck for writes Source 3সোর্স 3.
- Few different values, such as booleans. MongoDB shows a key with 7 values (continents): the cluster can have at most 7 chunks, so more than seven shards give no benefit Source 3সোর্স 3.
- A few very common values. Their chunks can become bottlenecks Source 3সোর্স 3.
Many different values alone do not guarantee an even spread Source 3সোর্স 3. For a key that grows in one direction, MongoDB suggests hashed sharding Source 3সোর্স 3.
সহজ English
A hot spot is a shard that gets much more load than the others. Source 8সোর্স 8 These keys cause them: Source 8সোর্স 8
- Values that only grow, such as auto-increment numbers and sequential timestamps. In MongoDB, all new inserts go to the chunk at the top of the range. Its shard becomes the bottleneck for writes. Source 3সোর্স 3
- Few different values, such as booleans. MongoDB shows a key with 7 values (continents). The cluster can have at most 7 chunks. So more than seven shards give no benefit. Source 3সোর্স 3
- A few very common values. Their chunks can become bottlenecks. Source 3সোর্স 3
Many different values alone do not guarantee an even spread. Source 3সোর্স 3 For a key that grows in one direction, MongoDB suggests hashed sharding. Source 3সোর্স 3
বাংলা ব্যাখ্যা
হট স্পট (hot spot) হলো এমন একটি শার্ড, যা অন্যদের চেয়ে অনেক বেশি লোড পায়। Source 8সোর্স 8 এই কী-গুলো তা ঘটায়: Source 8সোর্স 8
- শুধু বাড়তে থাকা ভ্যালু, যেমন অটো-ইনক্রিমেন্ট নম্বর ও সিকোয়েনশিয়াল টাইমস্ট্যাম্প। MongoDB-তে সব নতুন ইনসার্ট রেঞ্জের ওপরের চাঙ্কে যায়। এর শার্ড রাইটের বটলনেক হয়ে যায়। Source 3সোর্স 3
- কম সংখ্যক আলাদা ভ্যালু, যেমন বুলিয়ান। MongoDB 7টি ভ্যালুর (মহাদেশ) একটি কী দেখায়। ক্লাস্টারে সর্বোচ্চ 7টি চাঙ্ক থাকতে পারে। তাই সাতটির বেশি শার্ড কোনো সুবিধা দেয় না। Source 3সোর্স 3
- কয়েকটি খুব বেশি প্রচলিত ভ্যালু। এদের চাঙ্ক বটলনেক হয়ে উঠতে পারে। Source 3সোর্স 3
শুধু অনেক আলাদা ভ্যালু সমান ছড়ানোর নিশ্চয়তা দেয় না। Source 3সোর্স 3 যে কী এক দিকে বাড়ে, তার জন্য MongoDB হ্যাশড শার্ডিংয়ের পরামর্শ দেয়। Source 3সোর্স 3
Cross-shard queries
If a query has the shard key, mongos sends it only to the shards that hold the data. If it has no shard key, mongos asks every shard. This is a scatter-gather query, and it does not scale in a straight line when you add shards Source 3সোর্স 3. MongoDB makes an exception for aggregation queries that work on a large amount of data, where running on all shards at once can help Source 3সোর্স 3. The slowest shard sets the total time Source 8সোর্স 8. Transactions across shards are harder still, so most sharded systems avoid them and accept eventual consistency Source 8সোর্স 8.
সহজ English
If a query has the shard key, mongos sends it only to the shards that hold the data. If it has no shard key, mongos asks every shard. This is a scatter-gather query. It does not scale in a straight line when you add shards. Source 3সোর্স 3 MongoDB makes an exception for aggregation queries that work on a large amount of data. For them, running on all shards at once can help. Source 3সোর্স 3 The slowest shard sets the total time. Source 8সোর্স 8 Transactions across shards are harder still. So most sharded systems avoid them and accept eventual consistency. Source 8সোর্স 8
বাংলা ব্যাখ্যা
একটি কোয়েরিতে শার্ড কী থাকলে mongos তা শুধু সেই শার্ডগুলোতে পাঠায়, যেগুলোতে ডেটা আছে। শার্ড কী না থাকলে mongos প্রতিটি শার্ডকে জিজ্ঞেস করে। এটি একটি স্ক্যাটার-গ্যাদার (scatter-gather) কোয়েরি। শার্ড যোগ করলে এটি সরল রেখায় স্কেল করে না। Source 3সোর্স 3 বিপুল পরিমাণ ডেটার ওপর কাজ করা অ্যাগ্রিগেশন কোয়েরির জন্য MongoDB একটি ব্যতিক্রম রাখে। তাদের জন্য সব শার্ডে একসাথে চালানো সাহায্য করতে পারে। Source 3সোর্স 3 সবচেয়ে ধীর শার্ড মোট সময় ঠিক করে। Source 8সোর্স 8 একাধিক শার্ড জুড়ে ট্রানজেকশন আরও কঠিন। তাই বেশিরভাগ শার্ডেড সিস্টেম এড়িয়ে যায় এবং ইভেন্চুয়াল কনসিসটেন্সি মেনে নেয়। Source 8সোর্স 8
Rebalancing
Over time, inserts and deletes make the shards uneven, so Azure advises a plan to rebalance periodically. Moving data between shards can cause downtime or lower throughput Source 8সোর্স 8. With the plain formula hash(key) mod N, a change in the number of shards moves most keys Source 8সোর্স 8.
In MongoDB, the balancer runs in the background and moves ranges when the gap between the largest and smallest shard passes a threshold Source 7সোর্স 7. It can slow the cluster while it works Source 7সোর্স 7. A new shard starts empty, so it takes some time for the cluster to balance again Source 7সোর্স 7.
সহজ English
Over time, inserts and deletes make the shards uneven. So Azure advises a plan to rebalance periodically. Moving data between shards can cause downtime or lower throughput. Source 8সোর্স 8 With the plain formula hash(key) mod N, a change in the number of shards moves most keys. Source 8সোর্স 8
In MongoDB, the balancer runs in the background. It moves ranges when the gap between the largest and smallest shard passes a threshold. Source 7সোর্স 7 It can slow the cluster while it works. Source 7সোর্স 7 A new shard starts empty. So it takes some time for the cluster to balance again. Source 7সোর্স 7
বাংলা ব্যাখ্যা
সময়ের সাথে ইনসার্ট ও ডিলিট শার্ডগুলোকে অসমান করে। তাই Azure নিয়মিত রিব্যালেন্স (rebalance) করার একটি পরিকল্পনার পরামর্শ দেয়। শার্ডের মধ্যে ডেটা সরালে ডাউনটাইম হতে পারে, অথবা থ্রুপুট কমতে পারে। Source 8সোর্স 8 সাধারণ hash(key) mod N সূত্রে শার্ডের সংখ্যা বদলালে বেশিরভাগ কী সরে যায়। Source 8সোর্স 8
MongoDB-তে ব্যালেন্সার (balancer) ব্যাকগ্রাউন্ডে চলে। সবচেয়ে বড় ও সবচেয়ে ছোট শার্ডের ব্যবধান একটি থ্রেশহোল্ড পার করলে এটি রেঞ্জ সরায়। Source 7সোর্স 7 কাজ করার সময় এটি ক্লাস্টার ধীর করতে পারে। Source 7সোর্স 7 একটি নতুন শার্ড খালি অবস্থায় শুরু হয়। তাই ক্লাস্টার আবার ব্যালেন্স হতে কিছু সময় লাগে। Source 7সোর্স 7
A real-life example
A learning platform stores the results of test runs. This example is the tutorial's own.
- Key: the run date, ranged. Every new run has the newest date, so every write goes to one shard. The other shards sit idle. Reading one month of runs is fast, because one shard has it.
- Key: a hash of the run ID. New runs spread over all shards, and writes are even. A report of "all runs this week" now has to ask every shard.
Neither key is free. The team picks the one that fits its main queries.
সহজ English
A learning platform stores the results of test runs. This example is the tutorial's own.
- Key: the run date, ranged. Every new run has the newest date. So every write goes to one shard. The other shards sit idle. Reading one month of runs is fast, because one shard has it.
- Key: a hash of the run ID. New runs spread over all shards. Writes are even. But a report of "all runs this week" now has to ask every shard.
Neither key is free. The team picks the one that fits its main queries.
বাংলা ব্যাখ্যা
একটি লার্নিং প্ল্যাটফর্ম টেস্ট রানের রেজাল্ট জমা রাখে। এই উদাহরণটি টিউটোরিয়ালের নিজের।
- কী: রানের তারিখ, রেঞ্জড। প্রতিটি নতুন রানের তারিখ সবচেয়ে নতুন। তাই প্রতিটি রাইট একটি শার্ডে যায়। অন্য শার্ডগুলো অলস বসে থাকে। এক মাসের রান পড়া দ্রুত, কারণ একটি শার্ডই তা রাখে।
- কী: রান আইডির একটি হ্যাশ। নতুন রান সব শার্ডে ছড়ায়। রাইট সমান হয়। কিন্তু "এই সপ্তাহের সব রান"-এর একটি রিপোর্টকে এখন প্রতিটি শার্ডকে জিজ্ঞেস করতে হয়।
কোনো কী-ই বিনামূল্যে নয়। টিম তার প্রধান কোয়েরির সাথে যেটি মানায়, সেটি বাছে।
Common mistakes
- Sharding too early. If the data and traffic fit one instance, sharding only adds work Source 8সোর্স 8.
- A growing number as the shard key. It leads to hot spots Source 8সোর্স 8.
- A key with few values. It limits how many shards help Source 3সোর্স 3.
- Forgetting the daily work. You back up each shard on its own and change the schema on every shard Source 8সোর্স 8.
সহজ English
- Sharding too early. If the data and traffic fit one instance, sharding only adds work. Source 8সোর্স 8
- A growing number as the shard key. It leads to hot spots. Source 8সোর্স 8
- A key with few values. It limits how many shards help. Source 3সোর্স 3
- Forgetting the daily work. You back up each shard on its own. You change the schema on every shard. Source 8সোর্স 8
বাংলা ব্যাখ্যা
- খুব তাড়াতাড়ি শার্ডিং করা। ডেটা ও ট্রাফিক একটি ইনস্ট্যান্সে ধরে গেলে শার্ডিং শুধু কাজ বাড়ায়। Source 8সোর্স 8
- শার্ড কী হিসেবে একটি বাড়তে থাকা সংখ্যা। এটি হট স্পট ঘটায়। Source 8সোর্স 8
- কম ভ্যালুর একটি কী। এটি সীমিত করে কয়টি শার্ড সাহায্য করে। Source 3সোর্স 3
- প্রতিদিনের কাজ ভুলে যাওয়া। আপনি প্রতিটি শার্ডের ব্যাকআপ আলাদাভাবে নেন। আপনি প্রতিটি শার্ডে স্কিমা বদলান। Source 8সোর্স 8
What a tester can check
Tutorial advice
These test ideas are the tutorial's own advice.
- Ask for the shard key. Find out which field it is and why the team chose it.
- Use realistic test data. Include sequential IDs and one very large customer. Look at how many rows each shard gets.
- Compare two queries. Run one with the shard key and one without. Compare the response times.
- Test during a rebalance. Add a shard in a test environment while the suite runs. Watch for errors and slow calls.
- Check the operations. Test backup, restore, and schema changes on every shard.
সহজ English
Tutorial advice
These test ideas are the tutorial's own advice.
- Ask for the shard key. Find out which field it is. Find out why the team chose it.
- Use realistic test data. Include sequential IDs and one very large customer. Look at how many rows each shard gets.
- Compare two queries. Run one with the shard key and one without. Compare the response times.
- Test during a rebalance. Add a shard in a test environment while the suite runs. Watch for errors and slow calls.
- Check the operations. Test backup, restore, and schema changes on every shard.
বাংলা ব্যাখ্যা
Tutorial advice
এই টেস্ট ধারণাগুলো টিউটোরিয়ালের নিজের পরামর্শ।
- শার্ড কী জিজ্ঞেস করুন। এটি কোন ফিল্ড, তা জানুন। টিম কেন এটি বেছেছে, তা জানুন।
- বাস্তবসম্মত টেস্ট ডেটা ব্যবহার করুন। সিকোয়েনশিয়াল আইডি এবং একজন খুব বড় কাস্টমার রাখুন। প্রতিটি শার্ড কত রো পায়, তা দেখুন।
- দুটি কোয়েরি তুলনা করুন। একটি শার্ড কী সহ এবং একটি ছাড়া চালান। রেসপন্স টাইম তুলনা করুন।
- রিব্যালেন্সের সময় টেস্ট করুন। স্যুট চলার সময় একটি টেস্ট এনভায়রনমেন্টে একটি শার্ড যোগ করুন। এরর ও ধীর কলের দিকে নজর রাখুন।
- অপারেশন পরীক্ষা করুন। প্রতিটি শার্ডে ব্যাকআপ, রিস্টোর ও স্কিমা পরিবর্তন টেস্ট করুন।
Key words
| Word | Meaning |
|---|---|
| Shard | One horizontal partition of the data, on its own storage node Source 8সোর্স 8 |
| Shard key | The attributes that decide which shard holds an item Source 8সোর্স 8 |
| Chunk | In MongoDB, a range of shard key values that one shard owns Source 6সোর্স 6 |
| Hot spot | A shard that gets much more load than the others Source 8সোর্স 8 |
| Scatter-gather | A query with no shard key that goes to every shard Source 3সোর্স 3 |
| Balancer | The MongoDB background process that moves ranges between shards Source 7সোর্স 7 |