分庫分表&主從
<sharding:inline-strategy id="databaseStrategy" sharding-column="id" algorithm-expression="smart_$->{id%2}"/>
<sharding:inline-strategy id="tableStrategy" sharding-column="id" algorithm-expression="smart_device_test_new_$->{id%2}"/>
<sharding:data-source id="shardingDataSource">
<sharding:sharding-rule data-source-names="smart_0,smart_1,smart_2,smart_3">
<sharding:master-slave-rules>
<sharding:master-slave-rule id="smart_0" master-data-source-name="smart_0" slave-data-source-names="smart_2" />
<sharding:master-slave-rule id="smart_1" master-data-source-name="smart_1" slave-data-source-names="smart_3" />
</sharding:master-slave-rules>
<sharding:table-rules>
<sharding:table-rule logic-table="smart_device_test_new" actual-data-nodes="smart_$->{0..1}.smart_device_test_new$->{0..1}" database-strategy-ref="databaseStrategy" table-strategy-ref="tableStrategy" />
</sharding:table-rules>
</sharding:sharding-rule>
</sharding:data-source>
主從
<master-slave:data-source id="masterSlaveDataSource" master-data-source-name="master"
slave-data-source-names="slave">
<master-slave:props>
<prop key="sql.show">false</prop>
<prop key="executor.size">10</prop>
<prop key="foo">bar</prop>
</master-slave:props>
</master-slave:data-source>