21 rules for dividing databases and tables, hold!
AD |
ShardingSphere5.xt_orderDB_1DB_2t_order_1t_order_2 t_order t_order_0t_order_1t_order_n DB_1
ShardingSphere5.x
t_orderDB_1DB_2t_order_1t_order_2
t_order t_order_0t_order_1t_order_n
DB_1.t_order_1DB_2.t_order_2
t_order t_order_0 t_order_910 t_ordert_order_n
SQLSQL t_orderSQLSQL t_order
SQL
select * from t_order where order_no='A11111'
SQL
select * from DB_1.t_order_n where order_no='A11111'
DB_1.t_order_n
JOIN
- JOIN
t_cityDB_n.t_order_nJOINJOIN
10001000SQL
t_order SQLSQLorder_no order_no % 2 DB_1 DB_2
order_no t_order order_no
ShardingSphere
- ID
- order_no % 2
- .....
JOIN
t_order t_order_item order_no order_no
t_order t_order_item SQL
SELECT * FROM t_order o JOIN t_order_item i ON o.order_no=i.order_no
SQL
SELECT * FROM t_order_0 o JOIN t_order_item_0 i ON o.order_no=i.order_no SELECT * FROM t_order_0 o JOIN t_order_item_1 i ON o.order_no=i.order_no SELECT * FROM t_order_1 o JOIN t_order_item_0 i ON o.order_no=i.order_no SELECT * FROM t_order_1 o JOIN t_order_item_1 i ON o.order_no=i.order_no
t_order_n t_order_item_n
SELECT * FROM t_order_0 o JOIN t_order_item_0 i ON o.order_id=i.order_id SELECT * FROM t_order_1 o JOIN t_order_item_1 i ON o.order_id=i.order_id
t_order t_order_item t_order
SQL
SQL SQL -> -> SQL -> SQL -> SQL ->
SQLSQLSQL
SELECT order_no FROM t_order where order_status > 0 and user_id = 10086
SQLFieldTableConditionOrder ByGroup ByLimit SQL
SQLuser_idSQL
SELECT order_no FROM t_order where user_id = 10086 and order_status > 0
SQL
SQL SQL
SQL SQLSQL
3
SQL
SQL = BETWEEN IN SQLSQL
SELECT * FROM t_order where t_order_id in (1,2)
SQL
SELECT * FROM t_order_0 where t_order_id in (1,2)SELECT * FROM t_order_1 where t_order_id in (1,2)
SQLSQLSQL
t_order t_order_id t_usert_order_id
SELECT * FROM t_order_0 t LEFT JOIN t_user_0 u ON u.user_id = t.user_id WHERE t.user_id = 1SELECT * FROM t_order_0 t LEFT JOIN t_user_1 u ON u.user_id = t.user_id WHERE t.user_id = 1SELECT * FROM t_order_1 t LEFT JOIN t_user_0 u ON u.user_id = t.user_id WHERE t.user_id = 1SELECT * FROM t_order_1 t LEFT JOIN t_user_1 u ON u.user_id = t.user_id WHERE t.user_id = 1
5
DQL DML DDL t_order SQL t_order_0 t_order_n
SET TCL
autocommit
SET autocommit=0;
DCL order order
CREATE USER order@127.0.0.1 identified BY '';
DESCRIBE t_order;
t_order t_order_0 t_order_n
SQL
USE order_db;
ShardingSphere Schema
SQL
SQLSQL t_order SQL t_order
SELECT * FROM t_order
SELECT * FROM t_order_n
SQL
SQL SQL JDBC
SQL
t_ordert_order_nIDID
ID
IDIDIDID
9ID
SQL
6
API
XASeata
5 Seata +
Shadow Table
21Proxy
ShardingSphere5.x 2
Disclaimer: The content of this article is sourced from the internet. The copyright of the text, images, and other materials belongs to the original author. The platform reprints the materials for the purpose of conveying more information. The content of the article is for reference and learning only, and should not be used for commercial purposes. If it infringes on your legitimate rights and interests, please contact us promptly and we will handle it as soon as possible! We respect copyright and are committed to protecting it. Thank you for sharing.(Email:[email protected])
Mobile advertising space rental |
Tag: rules for dividing databases and tables hold
Preliminary Exploration of Data Heterogeneity in Canal (Tips)
NextHow to face the future of embryonic science: can global regulatory agencies keep up?
Guess you like
-
"Macau Story," a mini-series celebrating the 25th anniversary of Macau's return to China, achieves a billion viewsDetail
2024-12-24 16:38:43 1
-
Youku Sports and VICTOR Partner to Deliver an Upgraded and Innovative Live Streaming Experience for the 2024 BWF World Tour FinalsDetail
2024-12-24 14:31:57 1
-
Foxconn's Parent Company, Hon Hai Precision Industry, Invests an Additional RMB 600 Million in its Zhengzhou-based EV Battery UnitDetail
2024-12-24 10:01:13 1
-
2024 Spring Festival Travel Rush New Train Schedule: 321 Additional Trains Nationwide Starting January 5th, Further Enhancing Service Quality and EfficiencyDetail
2024-12-23 12:05:44 1
-
Changan Automobile and EHang Intelligent Sign Strategic Cooperation Agreement to Build Future Flying Car EcosystemDetail
2024-12-22 15:08:38 1
-
Liaoning Province and Baidu Sign Strategic Cooperation Framework Agreement to Jointly Promote AI Industry DevelopmentDetail
2024-12-20 19:36:38 1
-
Wanxun Technology Secures Nearly RMB 200 Million in Funding to Lead Global Soft Robotics Innovation, Set to Showcase Breakthroughs at CES 2025Detail
2024-12-20 15:54:19 1
-
Huolala's 2025 Spring Festival Freight Festival: Supporting Spring Festival Travel, Offering New Year Benefits to Users and DriversDetail
2024-12-20 13:38:20 1
-
The Third Meeting of the Third Council of the International New Energy Solutions Platform (INES): Charting a Blueprint for a "Dual Carbon" FutureDetail
2024-12-19 17:03:07 1
-
WeChat's Official Account Launches "Author Read Aloud Voice" Feature for Personalized Article ListeningDetail
2024-12-18 17:19:57 1
-
The 12th China University Students' Polymer Materials Innovation and Entrepreneurship Competition Finals Grand Opening in Guangrao CountyDetail
2024-12-18 16:04:28 1
-
Tracing the Ancient Shu Road, Winds of the Three Kingdoms: Global Influencer Shu Road Journey LaunchesDetail
2024-12-18 15:23:35 1
-
Seres: A Pioneer in ESG Practices, Driving Sustainable Development of China's New Energy Vehicle IndustryDetail
2024-12-17 16:20:26 1
- Detail
-
My Health, My Guard: Huawei WATCH D2 Aids Precise Blood Pressure Management in the Winter Health BattleDetail
2024-12-17 09:36:15 1
-
Investigation into the Chaos of Airline Seat Selection: Paid Seat Selection, Seat Locking Mechanisms, and Consumer Rights ProtectionDetail
2024-12-15 16:45:48 1
-
Japanese Scientists Grow Human Organs in Pigs: A Balancing Act of Breakthrough and EthicsDetail
2024-12-14 19:48:50 1
-
Pang Donglai and Sam's Club: Two Paths to Transformation in China's Retail IndustryDetail
2024-12-14 17:57:03 1
-
In-Depth Analysis of China's Precision Reducer Industry: Technological Innovation and Market CompetitionDetail
2024-12-14 16:04:26 1
-
Alibaba's "TAO" App Launches in Japan, Targeting High-Quality Service and Convenient LogisticsDetail
2024-12-13 13:22:23 1