Q.67. What is a Partition key? Why to partition azure table

Partition key is a string property using which we can partition a Table. A single partition contains a set of entities in a table with the same Partition Key value.

Why to partition the table?


Partitioning allows physical separation of tables to enable load balancing and scalability. What is the importance of Partition key in an Azure Table Storage? Entities with the same partition key can be queried more quickly. Choosing a Partition Key impacts the scalability, query performance and load balancing.

Scalability


For Windows Azure table storage, the most significant decision that affects scalability is the choice of Partition key for a table. We will see in the next couple of questions and answers how partition key impacts the scalability.

Query efficiency


Using the partition key in a query limits the query execution and so, performance is enhanced.

Partitioning enables efficient querying because the entire table need not be scanned and entities within a partition are served by a single server. We should mention the partition key in the query, as otherwise the entire table will be scanned.

Load balancing


In a real time situation as traffic and data in the Table starts increasing, a performance hit can occur. Partitioning feature organizes entities into partitions and spreads these different partitions across different servers to facilitate load balancing.