CSE Roadmap

Common tier · about 3 hours · 8 parts

Part 8 of 8 · 3 min read

Exercises

Easy

Easy 1: Local or global (20 minutes)

Choose a local or global index for: a search by word on a document store with heavy reads, a table of orders searched by customer when the customer ID is the partition key, a dashboard that filters by status on a write-heavy table.

Done when: three choices with reasons.

Hint

Count how often each path is used.

Easy 2: Tail chance (20 minutes)

Each partition is slow 2 percent of the time. Compute the chance that a scatter/gather query is slow for 5, 25 and 50 partitions.

Done when: three probabilities.

Hint

Chance slow = 1 − 0.98 raised to the number of partitions.

Easy 3: Hash mod N moves (20 minutes)

A key has hash 98,765. Find its node with 7, 8 and 9 nodes. Does it move on each step?

Done when: three node numbers and two yes/no answers.

Hint

Use the remainder of 98,765 divided by each number.

Medium

Medium 1: Cost of a write (30 minutes)

A record has 4 indexed fields. Count the partitions touched by a write with a local index and with a global index over 10 index partitions (all different at worst). Say what changes if the global index is updated asynchronously.

Done when: two counts and a freshness note.

Hint

A local index writes within one partition.

Medium 2: Fixed partitions (30 minutes)

A cluster has 800 partitions on 8 nodes and gains 2 nodes. Compute the partitions per node after, the partitions moved at least, and the share of the data moved. Compare with hash mod N from 8 to 10 nodes.

Done when: four numbers and a comparison.

Hint

Fair share = partitions ÷ nodes. Minimum moved = partitions the new nodes hold.

Medium 3: Moving time (30 minutes)

4 TB of data is split into 400 partitions. A new node joins a cluster of 9. Compute the data moved, and the time at 150 MB/s of copying with 50 percent of bandwidth given to normal traffic. State the node count where the move would take under an hour.

Done when: a data size, a time and a node count.

Hint

Partition size = 4 TB ÷ 400. New node fair share = 400 ÷ 10.

Hard

Hard 1: Index design for a marketplace (45 minutes)

A marketplace has 50 partitions keyed by listing ID. Queries: by seller, by category and price range, and by text word. For each query choose local or global, and a partition scheme for the global ones. Give the reads and writes touched.

Done when: a table with three queries, index types and costs.

Hint

Text search by a word is a term search.

Hard 2: Rebalancing plan (45 minutes)

A cluster of 12 nodes at 70 percent load gets 4 more nodes. Write the plan: partition scheme, how many partitions move, the copy rate limit, the order, the checks, and the rollback. Show what a mistaken automatic move could do.

Done when: a numbered plan with numbers and a risk scenario.

Hint

Limit copying so that load plus copy stays below 90 percent.

Hard 3: Choose the partition count (50 minutes)

A system will grow from 5 to 60 nodes over three years, with a data size of 20 TB at the end. Choose between fixed partitions, dynamic splitting and partitions per node. Pick the number of partitions or the limits, and defend the partition size.

Done when: a chosen scheme with numbers and a defence.

Hint

Partitions must be at least as many as the final node count, with room to spare.