Skip to content
Ameen Abozaid
Planned lessonSRC-007-L08

Demo: choosing a shard key for orders

  • Lesson 8 of 9
  • Senior C
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

pick and test a shard key; prepares SRC-007-LAB1.

Draft outline details

Step by step

  1. List the main queries: order by id, orders by customer, ops reports by date.
  2. Analyze real order data for distribution by customer and by order id.
  3. Planned mistake: choose order id hash because it spreads evenly. Fix: "my orders" now hits all shards; choose customer id with salting for large customers or keep a lookup table.
  4. Quantify hot-partition risk using the top customers' share.
  5. Outline resharding and the migration plan.
  6. Record the decision in an ADR.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.