Skip to content

Partitioning Distribution

landawn edited this page Jul 27, 2019 · 2 revisions

Partitioning/Distribution is supported by the SliceSelector and DataSourceSelector and integrated with SQLExecutor. Here are the steps to implement it by abacus-util:

  • Define the logic for table partitioning and data source distribution by implementing SliceSelector and DataSourceSelector.
  • Configure the implementation classes in data source xml file by schema DataSource.xsd
  • Initialized SQLExecutor with the DataSourceManager created with the data source xml file by JdbcUtil
  • All the SQL operations will be dispatched to the target table or data source by the logic defined in SliceSelector and DataSourceSelector
  • The queryAll and findAll methods in SQLExecutor are designed to query single/multiple SQL scripts from single/multiple data sources

We should not do it just because it's a challenge thing to do. Any unnecessary partitioning/shared should be avoided. Actually, a lot of load/performance issues can be resolved:

  • Tuning the code and SQL scripts from application level
  • Upgrading disk to SSD could improve performance more than 10 times
  • Introducing cache (Memcached/Redis)
Clone this wiki locally