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
-
The 2025 Chinese New Year (Spring Festival) film box office has exploded, exceeding 3 billion RMB and setting a new record for presales!Detail
2025-01-29 11:55:06 1
-
Seres and Beihang University Join Hands to Build an Innovative Ecosystem, Deepening Industry-Academia-Research Collaboration and Promoting Technological TransformationDetail
2025-01-28 14:46:18 1
-
Douyin 2024 Platform Governance Report: Safeguarding Security, Building a Better CommunityDetail
2025-01-28 14:25:55 1
-
Chinese Scientists Develop a Lightweight Bionic Dexterous Hand with 19 Degrees of Freedom, Promising to Revolutionize Prosthetic and Robotics TechnologyDetail
2025-01-28 14:16:39 1
-
DeepSeek: A Chinese AI Startup's Meteoric Rise Shakes Up Global Tech and Sends US Stocks PlungingDetail
2025-01-28 14:13:23 1
-
WeChat's New Year's Red Envelope Feature Gets a Voice Message Upgrade for Warmer Wishes!Detail
2025-01-26 11:37:36 1
-
360 Digital Security Group and Zhibangyang Education Technology Join Forces to Build a New Ecosystem for Cybersecurity and AI Talent CultivationDetail
2025-01-24 15:09:51 1
-
Visionox Achieves Mass Production of AMOLED with Solid-State Laser Annealing (SLA) Technology, Ushering in a New Era for the Display IndustryDetail
2025-01-24 14:34:23 1
-
Seres at the Davos Forum: The Path to Globalizing New Energy Vehicles Through Cooperation in the Intelligent EraDetail
2025-01-23 13:28:12 1
-
Amazon to Close All French-Speaking Quebec Warehouses, Laying Off Nearly 2,000 EmployeesDetail
2025-01-23 10:51:23 1
-
The official launch of the 2025 Electric Bicycle Trade-in Policy: Upgraded Subsidy Standards, Procedures, and PromotionDetail
2025-01-23 10:48:52 1
-
Xbox Series X|S Officially Supports External Hard Drives Larger Than 16TB: Saying Goodbye to Storage WorriesDetail
2025-01-23 10:39:19 1
-
Leaders from the Beijing Chaoyang District CPPCC Visited Quantum Leap Group, Affirming its Contributions and Future Prospects in the Silver Hair EconomyDetail
2025-01-22 17:06:56 1
-
China's Car Imports Remain Sluggish in 2024: 12% Decline, Sharp Drop in New Energy VehiclesDetail
2025-01-22 11:37:25 1
-
China Railway Group Limited (CRGL) officially debunks "speed-up" ticket booking software: Not a shortcut, but a pathway to riskDetail
2025-01-22 11:36:09 1
-
Dago Bio Completes Over $20 Million A+ Round Funding to Accelerate Novel Molecular Glue Drug DevelopmentDetail
2025-01-22 11:34:05 1
-
Rapid Degradation of Global Lake Submerged Vegetation: Satellite Observations Reveal a Critical Period of Ecosystem ShiftDetail
2025-01-22 11:29:03 1
-
Star Ace Capital Group and Abu Dhabi Investment Office Partner to Build a Global Esports Industry BenchmarkDetail
2025-01-22 11:27:50 1
-
Hisense Television Leads the 100-Inch Large-Screen Market in 2024, Achieving an Unparalleled Industry LegacyDetail
2025-01-22 11:12:49 1
-
WeChat Launches "Gifts" Feature: Streamlining Gift-Giving and Powering Social Commerce GrowthDetail
2025-01-21 16:05:45 1