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
- Detail
- Detail
-
Ant Group Powers the Greater Bay Area's "One-Hour Living Circle" and Fuels Global "ChinaTravel Boom"Detail
2024-11-21 19:23:04 1
-
Shenzhen's First Roadside Supercharger Station Commences Trial Operation, Ushering in a New Era for the "Supercharging City"Detail
2024-11-21 11:25:06 1
-
Xiaomi's High-End Strategy: An In-Depth Analysis of Q3 2024 Financial Results and Future OutlookDetail
2024-11-19 23:07:40 1
-
TSMC's Sudden Shift: A Global Chip Giant's Difficult Choices in the US-China GameDetail
2024-11-19 12:27:48 1
-
International Space Station Leak Crisis: NASA's Emergency Evacuation Plan and Signals of Chinese CooperationDetail
2024-11-19 11:34:51 1
-
Ten Years of Searching: Li Eryou's Unwavering Hope in the Search for His Son on MH370Detail
2024-11-18 18:39:16 1
-
The Facial Swelling of Shenzhou 18 Astronauts: The Physiological Cost of Space Exploration and Future ChallengesDetail
2024-11-17 08:03:04 11
-
Xiaomi Automobile Unveils Intelligent Chassis Pre-Research Technology, Ushering in a New Era of "Human-Car-Home Full Ecosystem"Detail
2024-11-14 11:24:27 1
-
Douyin E-commerce Double 11 Data Report: Merchants Businesses Grow, Consumer Trends EmergeDetail
2024-11-14 11:23:11 1
-
New Trends in SOE Reform: Focusing on Five Values to Build a "Living Organism"Detail
2024-11-14 11:19:26 1
-
CATL Chairman Zeng Yuqun: Musk Doesn't Understand Batteries, Tesla's Bet on Cylindrical Batteries is Doomed to FailDetail
2024-11-13 18:47:38 11
-
China Eastern Airlines Technology and Thales Renew Cooperation Agreement, Deepening Avionics Maintenance PartnershipDetail
2024-11-13 16:40:50 1
- Detail
- Detail
- Detail
-
Li Jiaqi's Livestream Double 11 Report: Domestic Brands Surge, Winter Warmer Economy BoomsDetail
2024-11-12 11:07:26 11
-
BYD: Plug-in Hybrids "To the Rescue," Behind the Price War Lies a "Davis Double-Click" in ProfitabilityDetail
2024-11-12 10:49:05 1
-
The Rise of Online Livestreamers: A Mass Career with 15 Million Dream Chasers in Live RoomsDetail
2024-11-11 15:27:33 11