How to implement a write behind cache

I am writing to a Couchbase ephemeral bucket and I need to persist the data into Oracle Database. How do I implement this functionality. Does Couchbase provide any triggers when i write to the cache, where i can implement the writing to Oracle DB. What is the recommended approach.
I am using Couchbase as a caching layer for performance purpose

Hi Mari,

Does Couchbase provide any triggers when i write to the cache

Yes via the inventing service on any mutation whether it’s an insert update deletion or expiry a custom JavaScript function can be invoked on that data upon change.

Where i can implement the writing to Oracle DB.

Depending on the volume of data as in documents per second say up to 50K/second.you might choose a variety of solutions if it’s very low in you could use curl direct from the Eventing service’s JavaScript function. You merely need an fast external REST API endpoint that writes data to Oracle (the endpoint should support dozens of concurrent connections and HTTP keep-alive)

I believe form 50K/sec. up to 200K/sec. using the standard SDKs and custom code should be able to do your integration tasks.

If it’s a very high rate 200K/sec. and beyond you could use Java and the Couchbase’s Kafka connector instead of Eventing but this requires a lot custom code and more complexity and not officially supported. Although I don’t recommend it the Java DCP SDK can also achieve high rates but has due to high complexity hard to get right and again is not officially supported.

Alternatively might could consider the commercial product GlueSync by Molo17 (which uses Couchbase’s Eventing service under the hood) for real time bidirectional synchronization between Couchbase and Oracle.

What is the recommended approach.
I am using Couchbase as a caching layer for performance purpose

Without knowing more I can only give general recommendations as above

Best

Jon Strabala

Thanks Jon for these solutions. IT is really helpful.

Regards,
Mari