Management

Data Structure in Registry Center

Under defined namespace, rules, props and metadata nodes persist in YAML, modifying nodes can dynamically refresh configurations. status node persist the runtime node of database access object, to distinguish different database access instances.

  1. namespace
  2. ├──rules # Global rule configuration
  3. ├──props # Properties configuration
  4. ├──metadata # Metadata configuration
  5. ├──${schema_1} # Schema name 1
  6. ├──dataSources # Datasource configuration
  7. ├──rules # Rule configuration
  8. ├──schema # Table configuration
  9. ├──${schema_2} # Schema name 2
  10. ├──dataSources # Datasource configuration
  11. ├──rules # Rule configuration
  12. ├──schema # Table configuration
  13. ├──status
  14. ├──compute_nodes
  15. ├──online
  16. ├──${your_instance_ip_a}@${your_instance_port_x}
  17. ├──${your_instance_ip_b}@${your_instance_port_y}
  18. ├──....
  19. ├──circuit_breaker
  20. ├──${your_instance_ip_c}@${your_instance_port_v}
  21. ├──${your_instance_ip_d}@${your_instance_port_w}
  22. ├──....
  23. ├──storage_nodes
  24. ├──disable
  25. ├──${schema_1.ds_0}
  26. ├──${schema_1.ds_1}
  27. ├──....
  28. ├──primary
  29. ├──${schema_2.ds_0}
  30. ├──${schema_2.ds_1}
  31. ├──....

/rules

global rule configurations, including configure the username and password for ShardingSphere-Proxy.

  1. - !AUTHORITY
  2. users:
  3. - root@%:root
  4. - sharding@127.0.0.1:sharding
  5. provider:
  6. type: ALL_PRIVILEGES_PERMITTED

/props

Properties configuration. Please refer to Configuration Manual for more details.

  1. kernel-executor-size: 20
  2. sql-show: true

/metadata/${schemaName}/dataSources

A collection of multiple database connection pools, whose properties (e.g. DBCP, C3P0, Druid and HikariCP) are configured by users themselves.

  1. ds_0:
  2. initializationFailTimeout: 1
  3. validationTimeout: 5000
  4. maxLifetime: 1800000
  5. leakDetectionThreshold: 0
  6. minimumIdle: 1
  7. password: root
  8. idleTimeout: 60000
  9. jdbcUrl: jdbc:mysql://127.0.0.1:3306/ds_0?serverTimezone=UTC&useSSL=false
  10. dataSourceClassName: com.zaxxer.hikari.HikariDataSource
  11. maximumPoolSize: 50
  12. connectionTimeout: 30000
  13. username: root
  14. poolName: HikariPool-1
  15. ds_1:
  16. initializationFailTimeout: 1
  17. validationTimeout: 5000
  18. maxLifetime: 1800000
  19. leakDetectionThreshold: 0
  20. minimumIdle: 1
  21. password: root
  22. idleTimeout: 60000
  23. jdbcUrl: jdbc:mysql://127.0.0.1:3306/ds_1?serverTimezone=UTC&useSSL=false
  24. dataSourceClassName: com.zaxxer.hikari.HikariDataSource
  25. maximumPoolSize: 50
  26. connectionTimeout: 30000
  27. username: root
  28. poolName: HikariPool-2

/metadata/${schemaName}/rules

Rule configurations, including sharding, readwrite-splitting, data encryption, shadow DB configurations.

  1. - !SHARDING
  2. xxx
  3. - !READWRITE_SPLITTING
  4. xxx
  5. - !ENCRYPT
  6. xxx

/metadata/${schemaName}/schema

Dynamic modification of metadata content is not supported currently.

  1. tables: # Tables
  2. t_order: # table_name
  3. columns: # Columns
  4. id: # column_name
  5. caseSensitive: false
  6. dataType: 0
  7. generated: false
  8. name: id
  9. primaryKey: trues
  10. order_id:
  11. caseSensitive: false
  12. dataType: 0
  13. generated: false
  14. name: order_id
  15. primaryKey: false
  16. indexs: # Indexes
  17. t_user_order_id_index: # index_name
  18. name: t_user_order_id_index
  19. t_order_item:
  20. columns:
  21. order_id:
  22. caseSensitive: false
  23. dataType: 0
  24. generated: false
  25. name: order_id
  26. primaryKey: false

/status/compute_nodes

It includes running instance information of database access object, with sub-nodes as the identifiers of currently running instance, which consist of IP and PORT. Those identifiers are temporary nodes, which are registered when instances are on-line and cleared when instances are off-line. The registry center monitors the change of those nodes to govern the database access of running instances and other things.

/status/storage_nodes

It is able to orchestrate replica database, delete or disable data dynamically.