| <?xml version="1.0" encoding="utf-8" standalone="yes"?> |
| <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| <channel> |
| <title>Usage on ShardingSphere</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/</link> |
| <description>Recent content in Usage on ShardingSphere</description> |
| <generator>Hugo -- gohugo.io</generator> |
| <language>en-us</language> |
| |
| <atom:link href="https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/index.xml" rel="self" type="application/rss+xml" /> |
| |
| |
| <item> |
| <title>Sharding</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule/</guid> |
| <description>Resource Operation Configure data source information ADD RESOURCE ds_0 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_1&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ),ds_1 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_2&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ); Rule Operation Create sharding rule CREATE SHARDING TABLE RULE t_order( RESOURCES(ds_0,ds_1), SHARDING_COLUMN=order_id, TYPE(NAME=hash_mod,PROPERTIES(&#34;sharding-count&#34;=4)), KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake)) ); Create sharding table CREATE TABLE `t_order` ( `order_id` int NOT NULL, `user_id` int NOT NULL, `status` varchar(45) DEFAULT NULL, PRIMARY KEY (`order_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 Drop sharding table DROP TABLE t_order; Drop sharding rule DROP SHARDING TABLE RULE t_order; Drop resource DROP RESOURCE ds_0, ds_1; Drop distributed database DROP DATABASE foo_db; </description> |
| </item> |
| |
| <item> |
| <title>Readwrite_splitting</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule/</guid> |
| <description>Resource Operation ADD RESOURCE write_ds ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_0&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ),read_ds ( HOST=&#34;127.0.0.1&#34;, PORT=3307, DB=&#34;ds_0&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ); Rule Operation Create readwrite_splitting rule CREATE READWRITE_SPLITTING RULE group_0 ( WRITE_RESOURCE=write_ds, READ_RESOURCES(read_ds), TYPE(NAME=random) ); Alter readwrite_splitting rule ALTER READWRITE_SPLITTING RULE group_0 ( WRITE_RESOURCE=write_ds, READ_RESOURCES(read_ds), TYPE(NAME=random,PROPERTIES(read_weight=&#39;2:0&#39;)) ); Drop readwrite_splitting rule DROP READWRITE_SPLITTING RULE group_0; Drop resource DROP RESOURCE write_ds,read_ds; Drop distributed database DROP DATABASE readwrite_splitting_db; </description> |
| </item> |
| |
| <item> |
| <title>Encrypt</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule/</guid> |
| <description>Resource Operation ADD RESOURCE ds_0 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_0&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ); Rule Operation Create encrypt rule CREATE ENCRYPT RULE t_encrypt ( COLUMNS( (NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,TYPE(NAME=AES,PROPERTIES(&#39;aes-key-value&#39;=&#39;123456abc&#39;))), (NAME=order_id,PLAIN=order_plain,CIPHER =order_cipher,TYPE(NAME=RC4,PROPERTIES(&#39;rc4-key-value&#39;=&#39;123456abc&#39;))) )); Create encrypt table CREATE TABLE `t_encrypt` ( `id` int(11) NOT NULL, `user_id` varchar(45) DEFAULT NULL, `order_id` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; Alter encrypt rule ALTER ENCRYPT RULE t_encrypt ( COLUMNS( (NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,TYPE(NAME=AES,PROPERTIES(&#39;aes-key-value&#39;=&#39;123456abc&#39;))) )); Drop encrypt rule DROP ENCRYPT RULE t_encrypt; Drop resource DROP RESOURCE ds_0; Drop distributed database DROP DATABASE encrypt_db; </description> |
| </item> |
| |
| <item> |
| <title>DB Discovery</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/db-discovery/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/db-discovery/</guid> |
| <description>Resource Operation ADD RESOURCE ds_0 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_0&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ),ds_1 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_1&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ),ds_2 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_2&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ); Rule Operation Create DB discovery rule CREATE DB_DISCOVERY RULE db_discovery_group_0 ( RESOURCES(ds_0, ds_1), TYPE(NAME=MySQL.MGR,PROPERTIES(&#39;group-name&#39;=&#39;92504d5b-6dec&#39;)), HEARTBEAT(PROPERTIES(&#39;keep-alive-cron&#39;=&#39;0/5 * * * * ?&#39;)) ); Alter DB discovery rule ALTER DB_DISCOVERY RULE db_discovery_group_0 ( RESOURCES(ds_0, ds_1, ds_2), TYPE(NAME=MySQL.MGR,PROPERTIES(&#39;group-name&#39;=&#39;92504d5b-6dec&#39;)), HEARTBEAT(PROPERTIES(&#39;keep-alive-cron&#39;=&#39;0/5 * * * * ?&#39;)) ); Drop db_discovery rule DROP DB_DISCOVERY RULE db_discovery_group_0; Drop db_discovery type DROP DB_DISCOVERY TYPE db_discovery_group_0_mgr; Drop db_discovery heartbeat DROP DB_DISCOVERY HEARTBEAT db_discovery_group_0_heartbeat; Drop resource DROP RESOURCE ds_0,ds_1,ds_2; Drop distributed database DROP DATABASE discovery_db; </description> |
| </item> |
| |
| <item> |
| <title>Shadow</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule/</guid> |
| <description>Resource Operation ADD RESOURCE ds_0 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_0&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ),ds_1 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_1&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ),ds_2 ( HOST=&#34;127.0.0.1&#34;, PORT=3306, DB=&#34;ds_2&#34;, USER=&#34;root&#34;, PASSWORD=&#34;root&#34; ); Rule Operation Create shadow rule CREATE SHADOW RULE group_0( SOURCE=ds_0, SHADOW=ds_1, t_order((simple_hint_algorithm, TYPE(NAME=SIMPLE_HINT, PROPERTIES(&#34;foo&#34;=&#34;bar&#34;))),(TYPE(NAME=REGEX_MATCH, PROPERTIES(&#34;operation&#34;=&#34;insert&#34;,&#34;column&#34;=&#34;user_id&#34;, &#34;regex&#34;=&#39;[1]&#39;)))), t_order_item((TYPE(NAME=SIMPLE_HINT, PROPERTIES(&#34;foo&#34;=&#34;bar&#34;))))); Alter shadow rule ALTER SHADOW RULE group_0( SOURCE=ds_0, SHADOW=ds_2, t_order_item((TYPE(NAME=SIMPLE_HINT, PROPERTIES(&#34;foo&#34;=&#34;bar&#34;))))); Drop shadow rule DROP SHADOW RULE group_0; Drop resource DROP RESOURCE ds_0,ds_1,ds_2; Drop distributed database DROP DATABASE foo_db; </description> |
| </item> |
| |
| </channel> |
| </rss> |