Runtime components : Service components : Remote cache service : How remote cache works
  
How remote cache works
High level architecture
The remote cache makes use of Redis, an in-memory data structure store that can be used as a database, cache, and message broker. For more information, see https://redis.io/.
This graphic is described in the surrounding text.
UDTT data flow and APIs
UDTT data uses APIs to pull, push, and drop data to and from the remote cache.
This graphic is described in the surrounding text.
There are also lock and unlock APIs:
lock(resoure): to obtain a lock to prevent data being updated while an operation is in progress
unlock(resoure): to release the lock
The APIs mentioned here are pseudo code. for the actual APIs, see Class and API reference.
Note The remote cache can speed up data access and improve application efficiency but there is a performance impact associated with accessing the cache. The more frequently you push and pull data to and from the cache, the lower the performance due to the network activity and the overhead that is associated with managing access to the shared resource.
Access data with no coding required
To reduce development effort, a special operation class is provided:
com.unicomsi.udtt.rcache.RCacheOperation
where RCacheOperation is an enhanced copy of BTTServerOperation class, see class RCacheOperation.
To read, write, or delete data to/from the cache, you define an operation with this class (or its extension), and define the data of the operation with the following parameters:
remoteCache : value
where value is a string with one of the following values:
NULL or empty: the remote cache is not used
R: read/pull data from the remote cache before the operation
W: write/push data to the remote cache after the operation
D: delete/drop data from the remote cache after the operation
remoteKey : value
where value is a string with one of the following values:
NULL or empty: use the name of the data element as the key, that is:
key = dataElement.getName()
the key of the remote data to read, write, or delete to/from the remote cache
$string (a string that is prefaced with the ‘$’ character): retrieve the key from the current context, that is:
key = thisContext.getValueAt("string")
No additional coding is required.
For example, as shown in the following image, you can define an operation:
implClass= com.unicomsi.udtt.rcache.RCacheOperation;
quota(data parameters)
    remoteCache=R
    remoteKey=$fund.code
This graphic is described in the surrounding text.
When you run the operation, data is read from the cache by using the value of fund.code (in the current context) as the key. See Access data by using RCacheOperation for the detailed steps.
See also:
Remote cache service