Skip to content

Add calm-hub standalone mode#1307

Merged
jpgough-ms merged 9 commits intofinos:mainfrom
rocketstack-matt:calm/feature/nitratedb-standalone
May 22, 2025
Merged

Add calm-hub standalone mode#1307
jpgough-ms merged 9 commits intofinos:mainfrom
rocketstack-matt:calm/feature/nitratedb-standalone

Conversation

@rocketstack-matt
Copy link
Member

@rocketstack-matt rocketstack-matt commented May 20, 2025

  • Add NitriteDB support for an in process mongo like DB
  • Enable file backed persistence for running in standalone mode with persistence

Addresses #1239 making it easier for developers and companies to run their own instance of calm-hub without Docker or MongoDB

To test, once you have packaged the calm-hub jar you can simply run:

java -Dcalm.database.mode=standalone -jar target/quarkus-app/quarkus-run.jar

Adding something to the DB via the swagger UI will allow you to view the docs in the calm-hub UI and restarting the process should show that the added entities persist over restarts.

* Add NitriteDB support for an in process mongo like DB
* Enable file backed persistence for running in standalone mode with persistence
@rocketstack-matt rocketstack-matt changed the title Add standalone mode: Add calm-hub standalone mode May 20, 2025
@github-actions github-actions bot added the calm-hub The Calm Hub Product label May 20, 2025
Copy link
Member

@jpgough-ms jpgough-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments. Overall I like that we would have an in memory solution, however I am concerned that this will make changing/adding new features more difficult and some of the tests/config introduce a fair bit of brittleness.

I am wondering whether writing the SQL version of the store + then using H2 would be a better approach. It would also offer the ability then for teams/orgs to use Postgres or similar if they cannot use Mongo, whilst offering us the in memory solution.

@rocketstack-matt
Copy link
Member Author

A couple of comments. Overall I like that we would have an in memory solution, however I am concerned that this will make changing/adding new features more difficult and some of the tests/config introduce a fair bit of brittleness.

I am wondering whether writing the SQL version of the store + then using H2 would be a better approach. It would also offer the ability then for teams/orgs to use Postgres or similar if they cannot use Mongo, whilst offering us the in memory solution.

Not sure why this would be less brittle - obviously we can add as many implementations for backing store as we like and this change introduces the necessary changes to make different stores pluggable, which would be needed no matter what options we introduce.

I did originally consider H2 and ended up going with Nitrite to deliberately stick to the most similar storage option to Mongo for the first alternative, and it had the convenience of also offering a file backed option for simple startup.

To me, the brittle code here is all around bootstrapping; if we're happy to say we either don't care about bootstrapping this version, or provide a more native way to bootstrap then I think this is no better or worse than any other tech choice.

One thing that we could do to make it store agnostic is to actually provide a bootstrap script which could be used post-startup to bootstrap directly via the REST endpoints?

@rocketstack-matt
Copy link
Member Author

rocketstack-matt commented May 21, 2025

As discussed with @jpgough-ms we will remove the Nitrite bootstrapping code, as it is brittle. In a subsequent PR we will also remove the bootstrapping from mongo-init.js and replace it with bootstrap scripts to call the REST services, this will allow any implementation to be bootstrapped via the same mechanism.

@jpgough-ms jpgough-ms merged commit 4bef1f1 into finos:main May 22, 2025
10 checks passed
@rocketstack-matt rocketstack-matt deleted the calm/feature/nitratedb-standalone branch May 23, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calm-hub The Calm Hub Product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants