Sharding

Configuration Item Explanation

  1. rules:
  2. - !SHARDING
  3. tables: # Sharding table configuration
  4. <logic-table-name> (+): # Logic table name
  5. actualDataNodes (?): # Describe data source names and actual tables (refer to Inline syntax rules)
  6. databaseStrategy (?): # Databases sharding strategy, use default databases sharding strategy if absent. sharding strategy below can choose only one.
  7. standard: # For single sharding column scenario
  8. shardingColumn: # Sharding column name
  9. shardingAlgorithmName: # Sharding algorithm name
  10. complex: # For multiple sharding columns scenario
  11. shardingColumns: # Sharding column names, multiple columns separated with comma
  12. shardingAlgorithmName: # Sharding algorithm name
  13. hint: # Sharding by hint
  14. shardingAlgorithmName: # Sharding algorithm name
  15. none: # Do not sharding
  16. tableStrategy: # Tables sharding strategy, same as database sharding strategy
  17. keyGenerateStrategy: # Key generator strategy
  18. column: # Column name of key generator
  19. keyGeneratorName: # Key generator name
  20. autoTables: # Auto Sharding table configuration
  21. t_order_auto: # Logic table name
  22. actualDataSources (?): # Data source names
  23. shardingStrategy: # Sharding strategy
  24. standard: # For single sharding column scenario
  25. shardingColumn: # Sharding column name
  26. shardingAlgorithmName: # Auto sharding algorithm name
  27. bindingTables (+): # Binding tables
  28. - <logic_table_name_1, logic_table_name_2, ...>
  29. - <logic_table_name_1, logic_table_name_2, ...>
  30. broadcastTables (+): # Broadcast tables
  31. - <table-name>
  32. - <table-name>
  33. defaultDatabaseStrategy: # Default strategy for database sharding
  34. defaultTableStrategy: # Default strategy for table sharding
  35. defaultKeyGenerateStrategy: # Default Key generator strategy
  36. defaultShardingColumn: # Default sharding column name
  37. # Sharding algorithm configuration
  38. shardingAlgorithms:
  39. <sharding-algorithm-name> (+): # Sharding algorithm name
  40. type: # Sharding algorithm type
  41. props: # Sharding algorithm properties
  42. # ...
  43. # Key generate algorithm configuration
  44. keyGenerators:
  45. <key-generate-algorithm-name> (+): # Key generate algorithm name
  46. type: # Key generate algorithm type
  47. props: # Key generate algorithm properties
  48. # ...