Custom Context Store Module for IBM Cloudant DB

Node-red supports the creation of a custom Context Store.

I am interested in having/developing a custom context store using a Cloudant DB instance provisioned by IBM Cloud. Note that the idea is also that the node-red application is running in a container instance on the IBM Cloud.

Note that only the context should be stored in the Cloudant DB instance, not the flows, settings, package.json files. The rationale behind this request is that IBM cloud will remove the container instance when it is not used for some time which means that all the context variables are lost which I don't want. I would like the context to persist.

Regarding creating this new custom context store:
My issue is not how to access the Cloudant DB on IBM Cloud but how to write the custom Context Store module.

The following 2 pages already describe a good part of this:

How is it best to start this ? Is there already something similar that can be used as a start?

Hi - no idea but this may help - at least with the plugin project structure - GitHub - node-red/node-red-context-redis: A Node-RED Context store plugin backed by Redis

2 Likes

CloudantDB is based on CouchDB which is also compatible with PouchDB. Ages ago, I'd wanted to create a CouchDB/PouchDB context store but have just never had the time to get into it. So it would be great if you could create this and ensure it is compatible not just with the Cloudant cloud version. :grin:

One of the strengths of CouchDB I believe is its eventually-consistent, multi-level model such that you could update say a PouchDB locally but have it replicate upwards to Cloudant. And that should automatically work even if the local device was offline at the time of update since, once it came back online, the DB would automatically replicate.

must admit I recall this - Add PouchDB Context store plugin by KazuhiroItoh · Pull Request #1 · node-red/node-red-context-pouchdb · GitHub - but have not idea how close to working it is...

1 Like