Reputation: 431
does a corda node support caching using corda engine? To cache data from a responder flow.
the use case is to cache a (known) respond from a respective party for example Oracle node so that the node would not always contact Oracle to get a fix properties via a network call.
eg. if the Oracle have set the FX rate today to 1.41
, can the node query once and subsequent calls for the day it uses the cache mechanism to avoid subsequent multiple queries to obtain the same result. because the Oracle will be swamped with the same query ( from different nodes ) which would lead to extremely high traffic to the oracle node which is only providing a static information.
Upvotes: 0
Views: 140
Reputation: 23140
Firstly, note that there are two points of interaction with an oracle:
The latter will always require interacting with the oracle, since each transaction has a different hash, and therefore requires a different signature (this is by design, see the technical white paper for more details).
The former doesn't necessarily require interacting with the oracle. You could take a guess at the data, or retrieve it via a web API, or cache it from previous requests. As long as the oracle judges the data included in the transaction to be correct, it will sign. It doesn't matter how it was accessed.
A mechanism for caching oracle data isn't built into the node, but could be achieved by reading and writing directly to the node's database during a flow or as part of a service. See the Flow DB sample here for an example of this.
Upvotes: 0