Hello,
I am trying to separate Runtime and History Databases. I am aware that I need to implement DbHistoryEventHandler and set enableDefaultDbHistoryEventHandler to false in application properties/yaml file.
I am looking for details on how to implement Session and SessionFactory so that EntityManager is injected with appropriate DataSource pointing to seperate DB and thereby all queries work without breaking Cockpit.
Also I found below info at Performance tuning Camunda 7 | Camunda Platform 8 Docs -
“It’s not easy to separate the runtime data from history data Camunda’s out-of-the-box capabilities depend on both data sets. Writing history to another database instance would cause tools like Cockpit to function incorrectly.
A valid strategy is to write the data to a custom backend (like NoSQL) for long time retrieval, but also to the normal Camunda tables for operations. Then you can delete the history from the Camunda database after short intervals as described in Cleaning Up Historical Data.”
Please let me know if its possible to separate Runtime and History Databases.
If you want cockpit to continue to function then you would see to adapt the sql db manager for all of the history queries to use your new data source (assuming no sql based on your comment). You would need to reference the mybatis XML to look up what the various sql queries and argument params are
@StephenOTT - Thank you for your example on history handler in kotlin. I see exact similar implementation in java for cassandra at GitHub - camunda/camunda-engine-cassandra: Cassandra Persistence for Camunda (Community Extension). In my case I want to use two postgres DB data sources one for runtime and the other for history without customizing query handlers and all the query criteria. Camunda supports more than one data source but it is for all the components of engine.