Synthetic and Hierarchical Partition Keys

Learn how to overcome the limitation of a single partition key with synthetic and hierarchical partition keys.

The problem

Sometimes, we might need to filter by two or more fields. Once we narrow the search to a single partition, indexes cover the rest. However, performance might not be outstanding if the partition contains many documents. On top of that, partitions have size and performance limits we don’t want to reach. For example, let’s imagine we have an e-commerce company like Shopify. We provide a cloud platform to retailers to sell their goods online, and billionaire shoppers can make thousands of orders.

Each order has a retailerId and shopperId, and both are necessary for most queries.

Get hands-on with 1200+ tech skills courses.