Management

Data Structure in Registry Center

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

  1. namespace
  2. ├──rules # Global rule configuration
  3. ├──transaction
  4. ├──active_version
  5. ├──versions
  6. ├──0
  7. ├──props # Properties configuration
  8. ├──active_verison
  9. ├──versions
  10. ├──0
  11. ├──metadata # Metadata configuration
  12. ├──${databaseName}
  13. ├──data_sources
  14. ├──units # Storage unit configuration
  15. ├──${dataSourceName}
  16. ├──active_verison # Active version
  17. ├──versions # version list
  18. ├──0
  19. ├──...
  20. ├──nodes # Storage node configuration
  21. ├──${dataSourceName}
  22. ├──active_verison # Active version
  23. ├──versions # version list
  24. ├──0
  25. ├──...
  26. ├──schemas # Schema list
  27. ├──${schemaName}
  28. ├──tables # Table configuration
  29. ├──${tableName}
  30. ├──active_verison # Active version
  31. ├──versions # version list
  32. ├──0
  33. ├──...
  34. ├──views # View configuration
  35. ├──${viewName}
  36. ├──active_verison # Active version
  37. ├──versions # version list
  38. ├──0
  39. ├──...
  40. ├──rules
  41. ├──sharding
  42. ├──algorithms
  43. ├──${algorithmName} # algorithm name
  44. ├──active_verison # Active version
  45. ├──versions # version list
  46. ├──0
  47. ├──...
  48. ├──key_generators
  49. ├──${keyGeneratorName} # keyGenerator name
  50. ├──active_verison # Active version
  51. ├──versions # version list
  52. ├──0
  53. ├──...
  54. ├──tables
  55. ├──${tableName} # logic table name
  56. ├──active_verison # Active version
  57. ├──versions # version list
  58. ├──0
  59. ├──...
  60. ├──nodes
  61. ├──compute_nodes
  62. ├──online
  63. ├──proxy
  64. ├──UUID # Proxy instance identifier
  65. ├──....
  66. ├──jdbc
  67. ├──UUID # JDBC instance identifier
  68. ├──....
  69. ├──status
  70. ├──UUID
  71. ├──....
  72. ├──worker_id
  73. ├──UUID
  74. ├──....
  75. ├──show_process_list_trigger
  76. ├──process_id:UUID
  77. ├──....
  78. ├──labels
  79. ├──UUID
  80. ├──....
  81. ├──storage_nodes
  82. ├──${databaseName.groupName.ds}
  83. ├──${databaseName.groupName.ds}
  84. ├──statistics
  85. ├──shardingsphere
  86. ├──schemas
  87. ├──shardingsphere
  88. ├──tables # system tables
  89. ├──sharding_table_statistics # sharding statistics table
  90. ├──8a2dcb0d97c3d86ef77b3d4651a1d7d0 # md5
  91. ├──cluster_information # cluster information table

/rules

These are the global rule configurations, transaction configuration.

  1. transaction:
  2. defaultType: XA
  3. providerType: Atomikos

/props

These are the properties’ configurations. Please refer to the Configuration Manual for more details.

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

/metadata/${databaseName}/data_sources/units/ds_0/versions/0

Database connection pools, whose properties (e.g. HikariCP) are to be configured by the user.

  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

/metadata/${databaseName}/data_sources/nodes/ds_0/versions/0

Database connection pools, whose properties (e.g. HikariCP) are to be configured by the user.

  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

/metadata/${databaseName}/rules/sharding/tables/t_order/versions/0

Sharding configuration。

  1. actualDataNodes: ds_${0..1}.t_order_${0..1}
  2. auditStrategy:
  3. allowHintDisable: true
  4. auditorNames:
  5. - t_order_dml_sharding_conditions_0
  6. databaseStrategy:
  7. standard:
  8. shardingAlgorithmName: t_order_database_inline
  9. shardingColumn: user_id
  10. keyGenerateStrategy:
  11. column: another_id
  12. keyGeneratorName: t_order_snowflake
  13. logicTable: t_order
  14. tableStrategy:
  15. standard:
  16. shardingAlgorithmName: t_order_table_inline
  17. shardingColumn: order_id

/metadata/${databaseName}/schemas/${schemaName}/tables/t_order/versions/0

Use separate node storage for each table.

  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 a replica database, and delete or disable data dynamically.