Management

Data Structure in Registry Center

Under defined namespace, rules, props and metadata nodes persist in YAML. Modifying nodes can dynamically refresh configurations. nodes persist the runtime node of database access object, to distinguish different database access instances. sys_data persist data records in system tables.

  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. ├──data_sources # 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}
  46. ├──sys_data
  47. ├──shardingsphere
  48. ├──schemas
  49. ├──shardingsphere
  50. ├──tables # system tables
  51. ├──sharding_table_statistics # sharding statistics table
  52. ├──8a2dcb0d97c3d86ef77b3d4651a1d7d0 # md5
  53. ├──cluster_information # cluster information table

/rules

These are the global rule configurations, which can include transaction configuration, SQL parser configuration, etc.

  1. - !TRANSACTION
  2. defaultType: XA
  3. providerType: Atomikos
  4. - !SQL_PARSER
  5. sqlCommentParseEnabled: true

/props

These are the properties configuration. Please refer to the 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 the users.

  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, read/write splitting, data encryption, and 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 the currently running instance, which is automatically generated at each startup using UUID.

The identifiers are temporary nodes, which are registered when instances are online and cleared when instances are offline. The registry center monitors the change of those nodes to govern the database access of running instances and other things.

/nodes/storage_nodes

It can orchestrate replica database, and delete or disable data dynamically.