Provide more granular configuration options to choose DAO implementations #2224
Replies: 4 comments 2 replies
-
@aravindanr Based on "One approach is to provide a configuration property for each DAO interface." and the fact that there are seven DAOs, but we can ignore IndexDAO here, using a granularity level of 6 would mean going from:
to:
where "redis*" eq redis_standalone | redis_cluster | redis_sentinel Are the DAO implementations fully independent from each other? Is achievable this approach? Or, alternatively the granularity level should be 3: MetadataDAO, QueueDAO, ExecutionDAO conductor.db.metadata.type=[ cassandra | memory | dynomite | redis* | postgres | mysql ] in which case eventhandler, polldata, and ratelimiting should inherit the configuration due to the intrinsic dependencies. Any suggestion here will allow me to move forward. I am can extend current support using ConditionalOnExpression on each Bean declaration. Regards |
Beta Was this translation helpful? Give feedback.
-
@marcocrasso Thanks for volunteering. The idea behind this is to not eliminate The implementation that i am aiming for is something like,
The effect of the above configuration should be, for all DAO implementations except The reason for using the fully qualified class names in the key and value is, in the future, the DAO contracts can be published as an SPI module and implementations are loaded during runtime using ServiceLoader. Hope that clarifies the intention. |
Beta Was this translation helpful? Give feedback.
-
@aravindanr I have forked the repo. Right now, me and our team is testing the Cassandra + MySQL combination. I decided to fork it, since the refactoring was big. Once tested and confirmed everything is working as expected, my next step would be to submit a PR. I assigned the issue to myself, hope that is ok. ChangesMain work was about replacing the DI mechanism used for backend, spring-boot Conditional beans with Java SPI. This requires to load beans into spring-boot context differently (not more relying on ConditionalBeans, and to assume that two or more implementations can co-exist in the class loader without causing beans collisions), and to accommodate those modules providing DAOs implementations (i.e. the x-persistence ones) to Java SPI impositions, such default no args constructor. I addressed the backward compatibility goal too. This class holds the new beans mechanism service-loader By backward compatibility I meant supporting beans configuration using the previous “one-property” approach. Hard ConstraintsI auto-imposed as a hard constraint NOT TO TOUCH core module. My rationale was that we are replacing how beans are loaded into spring-boot context, and nothing else. Therefore, core must keep working without noticing these if and only if required beans can be auto-wired. Documentation:Overview of backend as Java SPIMigration guidehttps://github.com/marcocrasso/conductor/tree/iss2017_granular_spi_module_configuration/service-loader#persistence-module-migration-guide how to move an existence *-persistence module to the new Java SPI-based approach. Updated Oficial docshttps://github.com/marcocrasso/conductor/blob/iss2017_granular_spi_module_configuration/docs/docs/extend.md I extended official project documentation in section “extend” to explain how to add a new backend implementation. Running on Dockerhttps://github.com/marcocrasso/conductor/tree/iss2017_granular_spi_module_configuration/docker#readme completely updated Docker steps to show how to use the system with Cassandra, MySQL, Redis, or combinations; all on top of docker-compose. TestingAll tests, both individual and integrations, are passing. Further testing is ongoing. |
Beta Was this translation helpful? Give feedback.
-
@aravindanr great idea and @marcocrasso great work ! If the idea is to segregate the database for each of the implementations, why not also add in another conductor-worflow-scheduler module ? A sample version which I used as separate Conductor WF Scheduler is --> API Calls Scheduler This was designed and developed for Conductor when it was Guice based and a direct Spring + MySQL + Quartz integration wasn't an easy task. However, as Conductor 3.X is Spring Boot based, it's a very farly easy job to to integrate a scheduler and expose new set of APIs. |
Beta Was this translation helpful? Give feedback.
-
Currently the DAO (MetadataDAO, QueueDAO, ExecutionDAO) implementations are chosen by one property called db. This prevents users from picking different implementations for different purposes. For instance, executions could be stored in Cassandra, but queue could be MySQL.
One approach is to provide a configuration property for each DAO interface.
Beta Was this translation helpful? Give feedback.
All reactions