Gimm
Gimm

Reputation: 153

bluemix DataCache sync to DB2

I'm using BlueMix's DataCache service infront of DB2 service.

Is there any way I can sync the cache to DB2 service easily?

Upvotes: 2

Views: 129

Answers (2)

Paul Chen
Paul Chen

Reputation: 61

Here are some links may help to make Data Cache client API call, it is quite simple to do by the way.

  1. Build Java Application with the IBM Data Cache service http://www.ibm.com/developerworks/cloud/library/cl-datacache-app/

  2. Build an Enterprise Application with both IBM Data Cache and Session Cache service https://g01acxwass069.ahe.pok.ibm.com/cms/developerworks/cloud/library/cl-cacheservices-app/index.html

  3. Use the indexing feature of the IBM Bluemix DataCache service
    http://www.ibm.com/developerworks/cloud/library/cl-indexing-datacache-app/index.html

  4. More Examples https://hub.jazz.net/project/abchow/CachingSamples/overview https://hub.jazz.net/project/abchow/CachingSamples/overview https://hub.jazz.net/project/rvennam/CloudTrader/overview

Note: you can also get "Java Cache Web Boiletplate" from BlueMix console catalog page, and then download the code from "Start code" in your Dashboard. The example will show you how you can code with the side cache pattern.

Upvotes: 0

Paul Chen
Paul Chen

Reputation: 61

You mentioned that you have Bluemix DataCache in front of DB2 service, so I assume that you are trying with the inline cache use case - which is having your app sending distributed cache to DataCache and have DataCache write behind to the DB2.

If this is the use case that you try to do, the DataCache service in Bluemix currently didn't support this inline (write behind) cache.

One way I can see working for you is to use a side cache pattern. Have your application check the cached data in Data Cache service. If no entries are in the distributed cache, get it from DB2 service and then put it into the cache service. When data is needed to be changed by the application, you invalidate the cached data from Data Cache service and then update DB2 entries from your application. This is a typical side cache pattern that Data Cache services are supporting.

Upvotes: 4

Related Questions