用asp做網(wǎng)站優(yōu)勢(shì)青島百度網(wǎng)站排名
Sharding-JDBC 從入門到精通(10)- 綜合案例(三)查詢商品與測(cè)試及統(tǒng)計(jì)商品和總結(jié)
一、Sharding-JDBC 綜合案例-查詢商品-dao
1、查詢商品:Dao 實(shí)現(xiàn):在 ProductDao 中定義商品查詢方法:
//查詢商品@Select("select i.*, d.descript, r.region_name placeOfOrigin " +"from product_info i join product_descript d on i.product_info_id = d.product_info_id " +"join region r on i.region_code = r.region_code order by i.product_info_id desc limit #{start}, #{pageSize}")List<ProductInfo> selectProductList( @Param("start") int start, @Param("pageSize") int pageSize);
2、在 shopping 子工程(子模塊)中,修改 dao 接口類 ProductDao.java,添加查詢商品的方法。
/*** dbsharding\shopping\src\main\java\djh\it\shopping\dao\ProductDao.java** 2024-7-3 創(chuàng)建 dao 接口類 ProductDao.java*/
package djh.it.shopping.dao;import djh.it.shopping.entity.ProductDescript;
import djh.it.shopping.entity.ProductInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;import java.util.List;
import java.util.Map;@Mapper
@Component
public interface ProductDao {//添加商品基本信息@Insert("insert into product_info(store_info_id, product_name, spec, region_code, price) " +" values(#{storeInfoId},#{productName},#{spec},#{regionCode},#{price})")@Options(useGeneratedKeys = true, keyProperty = "productInfoId", keyColumn = "product_info_id")int insertProductInfo( ProductInfo productInfo );//添加商品描述信息@Insert("insert into product_descript(product_info_id, descript, store_info_id) " +" values(#{productInfoId}, #{descript}, #{storeInfoId})")@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")int insertProductDescript( ProductDescript productDescript );//查詢商品@Select("select i.*, d.descript, r.region_name placeOfOrigin " +"from product_info i join product_descript d on i.product_info_id = d.product_info_id " +"join region r on i.region_code = r.region_code order by i.product_info_id desc limit #{start}, #{pageSize}")List<ProductInfo> selectProductList( @Param("start") int start, @Param("pageSize") int pageSize);}
二、Sharding-JDBC 綜合案例-查詢商品-service 及測(cè)試
1、在 shopping 子工程(子模塊)中,修改 service 接口類 ProductService.java 添加查詢方法。
/*** dbsharding\shopping\src\main\java\djh\it\shopping\service\ProductService.java** 2024-7-3 創(chuàng)建 service 接口類 ProductService.java*/
package djh.it.shopping.service;import djh.it.shopping.entity.ProductInfo;import java.util.List;public interface ProductService {//添加商品public void createProduct( ProductInfo productInfo );//查詢商品public List<ProductInfo> queryProduct( int page, int pageSize);
}
2、在 shopping 子工程(子模塊)中,修改 service 實(shí)現(xiàn)類 ProductServiceImpl.java 添加查詢方法。
/*** dbsharding\shopping\src\main\java\djh\it\shopping\service\impl\ProductServiceImpl.java** 2024-7-3 創(chuàng)建 service 實(shí)現(xiàn)類 ProductServiceImpl.java*/
package djh.it.shopping.service.impl;import djh.it.shopping.dao.ProductDao;
import djh.it.shopping.entity.ProductDescript;
import djh.it.shopping.entity.ProductInfo;
import djh.it.shopping.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;import java.util.List;@Service
public class ProductServiceImpl implements ProductService {@AutowiredProductDao productDao;@Override@Transactionalpublic void createProduct( ProductInfo productInfo ) {ProductDescript productDescript = new ProductDescript();//設(shè)置商品描述信息productDescript.setDescript(productInfo.getDescript());//調(diào)用dao 向商品信息表productDao.insertProductInfo(productInfo);//將商品信息id設(shè)置到 productDescript
// productDescript.setId(productInfo.getProductInfoId()); //errorproductDescript.setProductInfoId(productInfo.getProductInfoId());//設(shè)置店鋪idproductDescript.setStoreInfoId(productInfo.getStoreInfoId());//向商品描述信息表插入數(shù)據(jù)productDao.insertProductDescript(productDescript);}@Overridepublic List<ProductInfo> queryProduct( int page, int pageSize ) {int start = (page - 1) * pageSize;return productDao.selectProductList(start, pageSize);}
}
3、在 shopping 子工程(子模塊)中,修改 測(cè)試類 ShardingTest.java 添加查詢方法。
/*** dbsharding\shopping\src\test\java\djh\it\shopping\ShardingTest.java** 2024-7-3 創(chuàng)建 測(cè)試類 ShardingTest.java*/
package djh.it.shopping;import djh.it.shopping.entity.ProductInfo;
import djh.it.shopping.service.ProductService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;import java.math.BigDecimal;
import java.util.List;@RunWith(SpringRunner.class)
@SpringBootTest(classes = ShoppingBootstrap.class)
public class ShardingTest {@AutowiredProductService productService;@Test //添加商品public void testCreateProduct(){for(int i=1; i<10; i++){ProductInfo productInfo = new ProductInfo();//productInfo.setStoreInfoId(1L); //店鋪id(向 product_db_2 中插入數(shù)據(jù))productInfo.setStoreInfoId(2L); //店鋪id(向 product_db_1 中插入數(shù)據(jù))productInfo.setProductName("Java編程思想"); //商品名稱productInfo.setSpec("大號(hào)"); //商品規(guī)格productInfo.setPrice(new BigDecimal(60)); //商品價(jià)格productInfo.setRegionCode("110100"); //商品產(chǎn)地productInfo.setDescript("《java編程思想》這本書不錯(cuò)!!!"); //商品描述productService.createProduct(productInfo);}}@Test //查詢商品public void testQueryProduct(){List<ProductInfo> productInfos = productService.queryProduct(1, 10);System.out.println(productInfos);}
}
4、在 shopping 子工程(子模塊)中,修改 application.properties 配置文件,完善綁定表。
# dbsharding\shopping\src\main\resources\application.propertiesserver.port = 56082spring.application.name = shopping
spring.profiles.active = localserver.servlet.context-path = /shopping
spring.http.encoding.enabled = true
spring.http.encoding.charset = utf-8
spring.http.encoding.force = truespring.main.allow-bean-definition-overriding = true
mybatis.configuration.map-underscore-to-camel-case = true# sharding-jdbc 分片規(guī)則配置:# 1)配置數(shù)據(jù)源:真實(shí)數(shù)據(jù)源定義 m為主庫,s為從庫。m0, m1, m2, s0, s1, s2
spring.shardingsphere.datasource.names = m0,m1,m2,s0,s1,s2
#spring.shardingsphere.datasource.names = m0,m1,m2spring.shardingsphere.datasource.m0.type = com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.m0.driver-class-name = com.mysql.jdbc.Driver
spring.shardingsphere.datasource.m0.url = jdbc:mysql://localhost:3306/store_db?useUnicode=true
spring.shardingsphere.datasource.m0.username = root
spring.shardingsphere.datasource.m0.password = 12311spring.shardingsphere.datasource.m1.type = com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.m1.driver-class-name = com.mysql.jdbc.Driver
spring.shardingsphere.datasource.m1.url = jdbc:mysql://localhost:3306/product_db_1?useUnicode=true
spring.shardingsphere.datasource.m1.username = root
spring.shardingsphere.datasource.m1.password = 12311spring.shardingsphere.datasource.m2.type = com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.m2.driver-class-name = com.mysql.jdbc.Driver
spring.shardingsphere.datasource.m2.url = jdbc:mysql://localhost:3306/product_db_2?useUnicode=true
spring.shardingsphere.datasource.m2.username = root
spring.shardingsphere.datasource.m2.password = 12311spring.shardingsphere.datasource.s0.type = com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.s0.driver-class-name = com.mysql.jdbc.Driver
spring.shardingsphere.datasource.s0.url = jdbc:mysql://localhost:3307/store_db?useUnicode=true
spring.shardingsphere.datasource.s0.username = root
spring.shardingsphere.datasource.s0.password = 12311spring.shardingsphere.datasource.s1.type = com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.s1.driver-class-name = com.mysql.jdbc.Driver
spring.shardingsphere.datasource.s1.url = jdbc:mysql://localhost:3307/product_db_1?useUnicode=true
spring.shardingsphere.datasource.s1.username = root
spring.shardingsphere.datasource.s1.password = 12311spring.shardingsphere.datasource.s2.type = com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.s2.driver-class-name = com.mysql.jdbc.Driver
spring.shardingsphere.datasource.s2.url = jdbc:mysql://localhost:3307/product_db_2?useUnicode=true
spring.shardingsphere.datasource.s2.username = root
spring.shardingsphere.datasource.s2.password = 12311# 2)配置主、從關(guān)系數(shù)據(jù)庫:
# 主庫從庫邏輯數(shù)據(jù)源定義 ds0為store_db ds1為product_db_1 ds2為product_db_2
spring.shardingsphere.sharding.master-slave-rules.ds0.master-data-source-name=m0
spring.shardingsphere.sharding.master-slave-rules.ds0.slave-data-source-names=s0
spring.shardingsphere.sharding.master-slave-rules.ds1.master-data-source-name=m1
spring.shardingsphere.sharding.master-slave-rules.ds1.slave-data-source-names=s1
spring.shardingsphere.sharding.master-slave-rules.ds2.master-data-source-name=m2
spring.shardingsphere.sharding.master-slave-rules.ds2.slave-data-source-names=s2# 3)配置 分庫策略(水平分庫):
# 默認(rèn)分庫策略,以store_info_id為分片鍵,分片策略為store_info_id % 2 + 1,也就是store_info_id為雙數(shù)的數(shù)據(jù)進(jìn)入ds1, 為單數(shù)的進(jìn)入ds2
spring.shardingsphere.sharding.default-database-strategy.inline.sharding-column = store_info_id
spring.shardingsphere.sharding.default-database-strategy.inline.algorithm-expression = ds$->{store_info_id % 2 + 1}# 4)配置 分表策略(水平分表)
# 4.1) store_info 分表策略,固定分配至ds0的store_info真實(shí)表
spring.shardingsphere.sharding.tables.store_info.actual-data-nodes = ds$->{0}.store_info
spring.shardingsphere.sharding.tables.store_info.table-strategy.inline.sharding-column = id
spring.shardingsphere.sharding.tables.store_info.table-strategy.inline.algorithm-expression = store_info# 4.2) product_info 分表策略
# 數(shù)據(jù)結(jié)點(diǎn)包括:ds1.product_info_1, ds1.product_info_2, ds2.product_info_1, ds2.product_info_2 四個(gè)節(jié)點(diǎn)。
spring.shardingsphere.sharding.tables.product_info.actual-data-nodes = ds$->{1..2}.product_info_$->{1..2}
# 分片策略(水平分表):分片策略為product_info_id % 2 + 1
spring.shardingsphere.sharding.tables.product_info.table-strategy.inline.sharding-column = product_info_id
spring.shardingsphere.sharding.tables.product_info.table-strategy.inline.algorithm-expression = product_info_$->{product_info_id % 2 + 1}
# 主鍵策略(product_info_id 生成為雪花算法,為雙數(shù)的數(shù)據(jù)進(jìn)入 product_info_1表,為單數(shù)的進(jìn)入 product_info_2表)
spring.shardingsphere.sharding.tables.product_info.key-generator.column = product_info_id
spring.shardingsphere.sharding.tables.product_info.key-generator.type = SNOWFLAKE# 4.3) product descript 分表策略
# 分布在 ds1,ds2 的 product_descript_1 product_descript_2表,分片策略為 product_info_id % 2 + 1,
# id 生成為雪花算法, product_info_id 為雙數(shù)的數(shù)據(jù)進(jìn)入 product_descript_1表,為單數(shù)的進(jìn)入 product_descript_2表
spring.shardingsphere.sharding.tables.product_descript.actual-data-nodes = ds$->{1..2}.product_descript_$->{1..2}
spring.shardingsphere.sharding.tables.product_descript.table-strategy.inline.sharding-column =product_info_id
spring.shardingsphere.sharding.tables.product_descript.table-strategy.inline.algorithm-expression = product_descript_$->{product_info_id % 2 + 1}
spring.shardingsphere.sharding.tables.product_descript.key-generator.column=id
spring.shardingsphere.sharding.tables.product_descript.key-generator.type=SNOWFLAKE# 5)設(shè)置 product_info,product_descript為綁定表
#spring.shardingsphere.sharding.binding-tables = product_info,product_descript
# 修改綁定表(以數(shù)組方式顯示)
spring.shardingsphere.sharding.binding-tables[0] = product_info,product_descript# 6)設(shè)置region為廣播表(公共表),每次更新操作會(huì)發(fā)送至所有數(shù)據(jù)源
spring.shardingsphere.sharding.broadcast-tables=region# 7)打開 sql 輸出日志
spring.shardingsphere.props.sql.show = trueswagger.enable = truelogging.level.root = info
logging.level.org.springframework.web = info
logging.level.djh.it.dbsharding = debug
logging.level.druid.sql = debug
5、在 shopping 子工程(子模塊)中, 測(cè)試類 ShardingTest.java 打斷點(diǎn),進(jìn)行查詢方法測(cè)試。
6、注意事項(xiàng):
1)綁定表配置注意事項(xiàng)
# 5)設(shè)置 product_info,product_descript為綁定表
#spring.shardingsphere.sharding.binding-tables = product_info,product_descript
# 修改綁定表(以數(shù)組方式顯示)
spring.shardingsphere.sharding.binding-tables[0] = product_info,product_descript
2)分頁查詢是業(yè)務(wù)中最常見的場(chǎng)景
-
Sharding:jdbc 支持常用關(guān)系數(shù)據(jù)庫的分頁查詢,不過 Sharding-jdbc 的分頁功能比較容易讓使用者誤解,用戶通常認(rèn)為分頁歸并會(huì)占用大量?jī)?nèi)存。
-
在分布式的場(chǎng)景中,將 LIMIT 1088880010 改寫為 LIMIT 8,10000010,才能保證其數(shù)據(jù)的正確性。
-
用戶非常容易產(chǎn)生 Shardingsphere 會(huì)將大量無意義的數(shù)據(jù)加載至內(nèi)存中,造成內(nèi)存溢出風(fēng)險(xiǎn)的錯(cuò)覺。
-
其實(shí)大部分情況都通過流式歸并獲取數(shù)據(jù)結(jié)果集,因此 ShardingSphere 會(huì)通過結(jié)果集的 next 方法將無需取出的數(shù)據(jù)全部跳過,并不會(huì)將其存入內(nèi)存。
3)排序功能注意事項(xiàng)
-
同時(shí)需要注意的是,由于排序的需要,大量的數(shù)據(jù)仍然需要傳輸?shù)?Sharding-Jdbc 的內(nèi)存空間。 因此,采用LIMIT這種方式分頁,并非最佳實(shí)踐。
-
由于 LIMIT 并不能通過索引查詢數(shù)據(jù),因此如果可以保證 ID 的連續(xù)性,通過 ID 進(jìn)行分頁是比較好的解決方案,例如:
SELECT *FROM t_order WHERE id >100000 AND id<= 100010 ORDER BY id;
- 或通過記錄上次查詢結(jié)果的最后一條記錄的ID進(jìn)行下一頁的查詢,例如:
SELECT *FROM t_order WHERE id >10000000 LIMIT 10;
-
排序功能是由 Sharding-jdbc 的排序歸并來完成,由于在 SQL 中存在 ORDER BY 語句,因此每個(gè)數(shù)據(jù)結(jié)果集自身是有序的,因此只需要將數(shù)據(jù)結(jié)果集當(dāng)前游標(biāo)指向的數(shù)據(jù)值進(jìn)行排序即可。
-
這相當(dāng)于對(duì)多個(gè)有序的數(shù)組進(jìn)行排序,歸并排序是最適合此場(chǎng)景的排序算法。
三、Sharding-JDBC 綜合案例-統(tǒng)計(jì)商品
1、在 shopping 子工程(子模塊)中,修改 dao 接口類 ProductDao.java 添加統(tǒng)計(jì)方法。
/*** dbsharding\shopping\src\main\java\djh\it\shopping\dao\ProductDao.java** 2024-7-3 創(chuàng)建 dao 接口類 ProductDao.java*/
package djh.it.shopping.dao;import djh.it.shopping.entity.ProductDescript;
import djh.it.shopping.entity.ProductInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;import java.util.List;
import java.util.Map;@Mapper
@Component
public interface ProductDao {//添加商品基本信息@Insert("insert into product_info(store_info_id, product_name, spec, region_code, price) " +" values(#{storeInfoId},#{productName},#{spec},#{regionCode},#{price})")@Options(useGeneratedKeys = true, keyProperty = "productInfoId", keyColumn = "product_info_id")int insertProductInfo( ProductInfo productInfo );//添加商品描述信息@Insert("insert into product_descript(product_info_id, descript, store_info_id) " +" values(#{productInfoId}, #{descript}, #{storeInfoId})")@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")int insertProductDescript( ProductDescript productDescript );//查詢商品@Select("select i.*, d.descript, r.region_name placeOfOrigin " +"from product_info i join product_descript d on i.product_info_id = d.product_info_id " +"join region r on i.region_code = r.region_code order by i.product_info_id desc limit #{start}, #{pageSize}")List<ProductInfo> selectProductList( @Param("start") int start, @Param("pageSize") int pageSize);//統(tǒng)計(jì)商品總數(shù)@Select("select count(1) from product_info")int selectCount();//商品分組統(tǒng)計(jì)@Select("select t.region_code, count(1) as num from product_info t group by t.region_code having num > 1 order by region_code")List<Map> selectProductGroupList();
}
2、在 shopping 子工程(子模塊)中,修改 測(cè)試類 ShardingTest.java 添加統(tǒng)計(jì)方法。
/*** dbsharding\shopping\src\test\java\djh\it\shopping\ShardingTest.java** 2024-7-3 創(chuàng)建 測(cè)試類 ShardingTest.java*/
package djh.it.shopping;import djh.it.shopping.dao.ProductDao;
import djh.it.shopping.entity.ProductInfo;
import djh.it.shopping.service.ProductService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;import java.math.BigDecimal;
import java.util.List;
import java.util.Map;@RunWith(SpringRunner.class)
@SpringBootTest(classes = ShoppingBootstrap.class)
public class ShardingTest {@AutowiredProductService productService;@AutowiredProductDao productDao;@Test //添加商品public void testCreateProduct(){for(int i=1; i<10; i++){ProductInfo productInfo = new ProductInfo();//productInfo.setStoreInfoId(1L); //店鋪id(向 product_db_2 中插入數(shù)據(jù))productInfo.setStoreInfoId(2L); //店鋪id(向 product_db_1 中插入數(shù)據(jù))productInfo.setProductName("Java編程思想"); //商品名稱productInfo.setSpec("大號(hào)"); //商品規(guī)格productInfo.setPrice(new BigDecimal(60)); //商品價(jià)格productInfo.setRegionCode("110100"); //商品產(chǎn)地productInfo.setDescript("《java編程思想》這本書不錯(cuò)!!!"); //商品描述productService.createProduct(productInfo);}}@Test //查詢商品public void testQueryProduct(){List<ProductInfo> productInfos = productService.queryProduct(1, 10);System.out.println(productInfos);}@Test //統(tǒng)計(jì)商品總數(shù)public void testSelectCount(){int i = productDao.selectCount();System.out.println(i);}@Test //分組統(tǒng)計(jì)商品public void testSelectProductGroupList(){List<Map> maps = productDao.selectProductGroupList();System.out.println(maps);}}
3、在 shopping 子工程(子模塊)中, 運(yùn)行 測(cè)試類 ShardingTest.java 進(jìn)行統(tǒng)計(jì)商品方法測(cè)試。
4、綜合案例-統(tǒng)計(jì)商品 總結(jié):
- 1)分組統(tǒng)計(jì)
分組統(tǒng)計(jì)也是業(yè)務(wù)中常見的場(chǎng)景,分組功能的實(shí)現(xiàn)由Sharding-jdbc分組歸并完成。分組歸并的情況最為復(fù)雜,它分為流式分組歸并和內(nèi)存分組歸并。流式分組歸并要求SQL的排序項(xiàng)與分組項(xiàng)的字段必須保持一致,否則只能通過內(nèi)存歸并才能保證其數(shù)據(jù)的正確性。
- 2)舉例說明,假設(shè)根據(jù)科目分片,表結(jié)構(gòu)中包含考生的姓名(為了簡(jiǎn)單起見,不考慮重名的情況)和分?jǐn)?shù)。通過SQL獲取每位考生的總分,可通過如下 SOL:
SELECT name, SuM(score)FROM t score GROup BY name ORDER BY name;
- 3)在分組項(xiàng)與排序項(xiàng)完全一致的情況下,取得的數(shù)據(jù)是連續(xù)的,分組所需的數(shù)據(jù)全數(shù)存在于各個(gè)數(shù)據(jù)結(jié)果集的當(dāng)前游標(biāo)所指向的數(shù)據(jù)值,因此可以采用流式歸并。
四、Sharding-JDBC 總結(jié)
1、為什么分庫分表?
分庫分表就是為了解決由于數(shù)據(jù)量過大而導(dǎo)致數(shù)據(jù)庫性能降低的問題,將原來獨(dú)立的數(shù)據(jù)庫拆分成若干數(shù)據(jù)庫組成,將數(shù)據(jù)大表拆分成若干數(shù)據(jù)表組成,使得單一數(shù)據(jù)庫、單一數(shù)據(jù)表的數(shù)據(jù)量變小,從而達(dá)到提升數(shù)據(jù)庫性能的目的。
2、分庫分表方式:
垂直分表、垂直分庫、水平分庫、水平分表。
3、分庫分表帶來問題:
由于數(shù)據(jù)分散在多個(gè)數(shù)據(jù)庫,服務(wù)器導(dǎo)致了事務(wù)一致性問題、跨節(jié)點(diǎn) join 問題、跨節(jié)點(diǎn)分頁排序、函數(shù),主鍵需要全局唯一,公共表。
4、Sharding-JDBC 基礎(chǔ)概念:
邏輯表,真實(shí)表,數(shù)據(jù)節(jié)點(diǎn),綁定表,廣播表,分片鍵,分片算法,分片策略,主鍵生成策略。
5、Sharding-JDBC 核心功能:
數(shù)據(jù)分片,讀寫分離。
6、Sharding-JDBC 執(zhí)行流程:
SQL解析 => 查詢優(yōu)化 => SQL路由 => SQL改寫 => SQL執(zhí)行 => 結(jié)果歸并。
7、Sharding-JDBC 最佳實(shí)踐:
系統(tǒng)在設(shè)計(jì)之初就應(yīng)該對(duì)業(yè)務(wù)數(shù)據(jù)的耦合松緊進(jìn)行考量,從而進(jìn)行垂直分庫、垂直分表,使數(shù)據(jù)層架構(gòu)清晰明了。若非必要,無需進(jìn)行水平切分,,應(yīng)先從緩存技術(shù)著手降低對(duì)數(shù)據(jù)庫的訪問壓力。如果緩存使用過后,數(shù)據(jù)庫訪問量還是非常大,可以考慮數(shù)據(jù)庫讀、寫分離原則。若當(dāng)前數(shù)據(jù)庫壓力依然大,且業(yè)務(wù)數(shù)據(jù)持續(xù)增長(zhǎng)無法估量最后可考慮水平分庫、分表,單表拆分?jǐn)?shù)據(jù)控制在1000萬以內(nèi)。
8、Sharding-JDBC 對(duì) SQL 支持說明 詳細(xì)參考:
https://shardingsphere.apache.org/document/current/cn/features/sharding/appendix/
SgardubgSogere 概覽:
https://shardingsphere.apache.org/document/current/cn/overview/
上一節(jié)關(guān)聯(lián)鏈接請(qǐng)點(diǎn)擊
# Sharding-JDBC 從入門到精通(9)- 綜合案例(二)添加商品