Management

Data Structure in Registry Center

Under defined namespace, rules, props and metadata nodes persist in YAML, modifying nodes can dynamically refresh configurations. nodes 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. ├──${databaseName} # Logic database name
  6. ├──schemas # Schema list
  7. ├──${schemaName} # Logic schema name
  8. ├──tables # Table configuration
  9. ├──${tableName}
  10. ├──...
  11. ├──views # View configuration
  12. ├──${viewName}
  13. ├──...
  14. ├──...
  15. ├──versions # Metadata version list
  16. ├──${versionNumber} # Metadata version
  17. ├──dataSources # Data source configuration
  18. ├──rules # Rule configuration
  19. ├──...
  20. ├──active_version # Active metadata version
  21. ├──...
  22. ├──nodes
  23. ├──compute_nodes
  24. ├──online
  25. ├──proxy
  26. ├──UUID # Proxy instance identifier
  27. ├──....
  28. ├──jdbc
  29. ├──UUID # JDBC instance identifier
  30. ├──....
  31. ├──status
  32. ├──UUID
  33. ├──....
  34. ├──worker_id
  35. ├──UUID
  36. ├──....
  37. ├──process_trigger
  38. ├──process_list_id:UUID
  39. ├──....
  40. ├──labels
  41. ├──UUID
  42. ├──....
  43. ├──storage_nodes
  44. ├──${databaseName.groupName.ds}
  45. ├──${databaseName.groupName.ds}

/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_PERMITTED

/props

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

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

/metadata/${databaseName}/versions/${versionNumber}/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/${databaseName}/versions/${versionNumber}/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/${databaseName}/schemas/${schemaName}/tables

Use separate node storage for each table, dynamic modification of metadata content is not supported currently.

  1. name: t_order # Table name
  2. columns: # Columns
  3. id: # Column name
  4. caseSensitive: false
  5. dataType: 0
  6. generated: false
  7. name: id
  8. primaryKey: trues
  9. order_id:
  10. caseSensitive: false
  11. dataType: 0
  12. generated: false
  13. name: order_id
  14. primaryKey: false
  15. indexs: # Index
  16. t_user_order_id_index: # Index name
  17. name: t_user_order_id_index

/nodes/compute_nodes

It includes running instance information of database access object, with sub-nodes as the identifiers of currently running instance, which is automatically generated at each startup using UUID. 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.

/nodes/storage_nodes

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