top of page

Elastic Scale -- Sharding

By using Elastic Scale for Azure SQL Database, you can manage your data in separate shards for which resource requirements can dynamically grow or shrink as needed to match the current workload.

To use this feature, you must use the elastic database client library in your application to perform operations across all shards or in individual shards. You can also use the Split-Merge service to separate data in one shard into multiple shards or to combine data from multiple shards into a single shard.

 

Elastic Scale is a feature in SQL Database that you use to adjust the database capacity to match the scalability requirements for different applications. In other words, you can grow or shrink the database by using a technique known as sharding, which partitions your data across identically structured database.

Sharding is useful when the application data in aggregate exceeds the maximum size supported by SQL Database or when you need to separate data by geography for compliance, latency, or geopolitical reasons. Although sharding is not a new concept, it requires the use of custom code to create and manage sharded applications and adds complexity to your solution architecture.

Elastic Scale provides an elastic database client library and a Split-Merge service that helps implify the management of your applications. That way you can adapt the capacity of SQL Database to support varying workloads and ensure consistent performance without manual intervention.

Elastic database client library You must use the elastic database client library to implement standard sharding patterns in a SQL Database by calling its features in your elastic scale application. You use it to perform operations across the all shards as a unit or to perform operations on individual shards.

The elastic database client library provides the following features:

  • Shard map management You first register each database as a shard, and then define a shard map manager that directs connection requests to the correct shard by using a sharding key or a key range. A sharding key is data such as a customer ID number that the database engine uses to keep related transactions in one database.

  • Data-dependent routing Rather than define a connection in your application, you can use this feature to automatically assign a connection to the correct shard.

  • Multishard querying The database engine uses this feature to process queries in parallel across separate shards and then combine the results into a single result set.

  • Shard elasticity This feature monitors resource consumption for the current workload and dynamically allocates more resource as necessary and shrinks the database to its normal state when those resources are no longer required.

You can also use the Split-Merge service to add or remove databases as shards from the shard set and redistribute the data across more or fewer shards. As demand increases, you can split the data out across a greater number of shards. Conversely, you can merge the data into fewer shards as demand lowers.

 

Example:

Answer:

bottom of page