Sharding

    Namespace: http://shardingsphere.apache.org/schema/shardingsphere/sharding/sharding-5.2.1.xsd

    <sharding:rule />

    <sharding:table-rule />

    NameTypeDescription
    logic-tableAttributeLogic table name
    actual-data-nodesAttributeDescribe data source names and actual tables, delimiter as point, multiple data nodes separated with comma, support inline expression. Absent means sharding databases only.
    actual-data-sourcesAttributeData source names for auto sharding table
    database-strategy-refAttributeDatabase strategy name for standard sharding table
    table-strategy-refAttributeTable strategy name for standard sharding table
    sharding-strategy-refAttributesharding strategy name for auto sharding table
    key-generate-strategy-refAttributeKey generate strategy name
    audit-strategy-refAttributeSharding audit strategy name

    <sharding:binding-table-rules />

    NameTypeDescription
    binding-table-rule (+)TagBinding table rule configuration

    <sharding:binding-table-rule />

    NameTypeDescription
    logic-tablesAttributeBinding table name, multiple tables separated with comma

    <sharding:broadcast-table-rules />

    NameTypeDescription
    broadcast-table-rule (+)TagBroadcast table rule configuration

    <sharding:standard-strategy />

    NameTypeDescription
    idAttributeStandard sharding strategy name
    sharding-columnAttributeSharding column name
    algorithm-refAttributeSharding algorithm name

    <sharding:complex-strategy />

    NameTypeDescription
    idAttributeComplex sharding strategy name
    sharding-columnsAttributeSharding column names, multiple columns separated with comma
    algorithm-refAttributeSharding algorithm name

    <sharding:hint-strategy />

    NameTypeDescription
    idAttributeHint sharding strategy name
    algorithm-refAttributeSharding algorithm name

    <sharding:none-strategy />

    NameTypeDescription
    idAttributeSharding strategy name

    <sharding:key-generate-strategy />

    <sharding:audit-strategy />

    NameTypeDescription
    idAttributeSharding audit strategy name
    allow-hint-disableAttributeEnable or disable sharding audit hint
    auditorsTagSharding audit algorithm name
    NameTypeDescription
    auditorTagSharding audit algorithm name

    <sharding:auditor />

    NameTypeDescription
    algorithm-refAttributeSharding audit algorithm name

    <sharding:sharding-algorithm />

    NameTypeDescription
    idAttributeSharding algorithm name
    typeAttributeSharding algorithm type
    props (?)TagSharding algorithm properties

    <sharding:key-generate-algorithm />

    <sharding:audit-algorithm />

    NameTypeDescription
    idAttributeSharding audit algorithm name
    typeAttributeSharding audit algorithm type
    props (?)TagSharding audit algorithm properties

    Please refer to , Built-in Key Generate Algorithm List and for more details about type of algorithm.

    1. Start the Spring program, the configuration will be loaded automatically, and the ShardingSphereDataSource will be initialized.