Documentation Home
MySQL Utilities 1.5 Manual
Related Documentation Download this Manual
PDF (US Ltr) - 1.5Mb
PDF (A4) - 1.5Mb
HTML Download (TGZ) - 289.5Kb
HTML Download (Zip) - 301.7Kb

MySQL Utilities 1.5 Manual  /  ...  /  Introduction to Sharding Introduction to Sharding

The Fabric sharding implementation requires you to provide the sharding key explicitly while executing a query. To define sharding over a set of tables using the sharding mechanism built into Fabric, it is important to understand two concepts and how they relate.

Shard Mapping

A shard mapping serves to bring a database object (a database table) into the Fabric sharding system. The mapping is a way of informing Fabric that we want a particular sharding scheme (range, hash, list, and so forth.) to be used on a database table, using a value in a particular column. Create a shard mapping as follows:

  1. Define a shard mapping, to tell Fabric the kind of sharding mechanism to use.

  2. Add a relation between the mapping and a database object, to register the database table and a column in the table with the shard mapping.

Once these operations have been completed, we can describe how the shard mapping should split the tables. This is done while creating the shards.


These are the partitions on the table. Since sharding is done on a database table, using an attribute (column) in the table, the values in the column influence how the shards are created. To explain this further, assume that we have two tables we wish to shard.

  • employees

  • Salary

Assume further that both tables are to be sharded by the employee ID that is part of their columns. Where a row is placed is based on the value in the employee ID column. Hence, in a range-based sharding scheme, a shard is nothing but a range of employee ID values.

User Comments
Sign Up Login You must be logged in to post a comment.