Configuration – sharding
In this section, we'd like to showcase how to configure data sharding in ShardingSphere-Proxy by means of DistSQL and YAML. With DistSQL, users can use SQL-like statements to configure and manage sharding rules.
In this section, the focus is placed on the DistSQL syntax, and some examples are given to illustrate how users can use DistSQL to perform sharding operations. Additionally, the YAML method relies on configuration files to configure and manage data sharding features. We'd like to introduce the configuration items and their definitions, as well as provide scenario examples.
DistSQL – the SQL syntax
There are four table types: the sharding table, the binding table, the broadcast table, and the single table. To perform operations such as creating table rules, modifying table rules, deleting table rules, and displaying table rules, DistSQL provides four statements respectively: CREATE
, ALTER
, DROP
, and SHOW
.