Conversation
* Add NitriteDB support for an in process mongo like DB * Enable file backed persistence for running in standalone mode with persistence
jpgough-ms
left a comment
There was a problem hiding this comment.
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.
calm-hub/src/main/java/org/finos/calm/store/producer/DomainStoreProducer.java
Show resolved
Hide resolved
calm-hub/src/test/java/org/finos/calm/store/nitrite/TestNitriteCoreSchemaStoreShould.java
Outdated
Show resolved
Hide resolved
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? |
|
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.
|
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.jarAdding 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.