menghaoranss opened a new issue #14113:
URL: https://github.com/apache/shardingsphere/issues/14113


   
   In cluster mode, `shardingsphere` persist meta data to node ` 
/namespace/metadata/logic_db/schema`, the content is as follows:
   
   ```
   tables:
     t_address:
       columns:
         address_id:
           caseSensitive: false
           dataType: -5
           generated: false
           name: address_id
           primaryKey: true
         address_name:
           caseSensitive: false
           dataType: 12
           generated: false
           name: address_name
           primaryKey: false
       indexes:
         primary:
           name: PRIMARY
     t_order:
       columns:
         order_id:
           caseSensitive: false
           dataType: -5
           generated: true
           name: order_id
           primaryKey: true
         user_id:
           caseSensitive: false
           dataType: 4
           generated: false
           name: user_id
           primaryKey: false
         address_id:
           caseSensitive: false
           dataType: -5
           generated: false
           name: address_id
           primaryKey: false
         status:
           caseSensitive: false
           dataType: 12
           generated: false
           name: status
           primaryKey: false
   ```
   
   If there are too many tables, the data size of this node will be 
particularly large which may affect the performance of `shardingsphere`, 
therefore, I suggest splitting the metadata into the following structures:
   
   ```
   namespace
      ├──rules                                     # 全局规则配置
      ├──props                                     # 属性配置
      ├──metadata                                  # Metadata 配置
      ├      ├──${schema_1}                        # Schema 名称1
      ├      ├      ├──dataSources                 # 数据源配置
      ├      ├      ├──rules                       # 规则配置
      ├      ├      ├──tables                      # 表结构配置
      ├      ├      ├      ├──t_order       
      ├      ├      ├      ├──t_address
   ...                
   ```
   
   the content of node `t_order`:
   
   ```
   t_address:
       columns:
         address_id:
           caseSensitive: false
           dataType: -5
           generated: false
           name: address_id
           primaryKey: true
         address_name:
           caseSensitive: false
           dataType: 12
           generated: false
           name: address_name
           primaryKey: false
       indexes:
         primary:
           name: PRIMARY
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to