1. Two ways to do Partition:
Key range partition:
1. easy to support range queries.
2. Risk of hot spots if the application often accesses keys that are close together in the sorted order.
Hash partition:
1. making range queries inefficient, but may distribute load more evenly.
2. When partitioning by hash, it is common to create a fixed number of partitions in advance, to assign several partitions to each node, and to move entire partitions from one node to another when nodes are added or removed. Dynamic partitioning can also be used.
2. How to solve hot spot ?
1. a simple techinique is to add a random number to the begining or the end of the key.
2. having split the writes across different keys, any reads now have to do additional work, as they have to read the data from all n keys and combine it.
3. you also need