Shadow DB

    1. <shadow:algorithm />
    1. Create production and shadow data sources.
    1. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:shadow="http://shardingsphere.apache.org/schema/shardingsphere/shadow" xsi:schemaLocation="http://www.springframework.org/schema/beans
    2. http://www.springframework.org/schema/beans/spring-beans.xsd
    3. http://shardingsphere.apache.org/schema/shardingsphere/shadow
    4. http://shardingsphere.apache.org/schema/shardingsphere/shadow/shadow.xsd
    5. ">
    6. <props>
    7. <prop key="operation">insert</prop>
    8. <prop key="column">user_id</prop>
    9. <prop key="value">1</prop>
    10. </shadow:shadow-algorithm>
    11. <shadow:rule id="shadowRule">
    12. <shadow:data-source id="shadow-data-source" production-data-source-name="ds" shadow-data-source-name="ds_shadow"/>
    13. <shadow:shadow-table name="t_user" data-sources="shadow-data-source">
    14. <shadow:algorithm shadow-algorithm-ref="user-id-insert-match-algorithm" />
    15. </shadow:shadow-table>
    16. </shadow:rule>