Is Data Change Protocol public?


Is DCP a publicaly supported protocol? Can I safely use DSP Java client?
Where can I find API documentation for DCP?


The DCP Java client is not officially supported. With earlier releases of Couchbase server, it was possible to get the system into a poorly performing state with a DCP client that didn’t manage resources well enough or failed. That’s less the case these days, but there are enough pitfalls that without the proper tribal knowledge, it can be difficult to use DCP effectively.

DCP itself is a protocol, not an API. In addition to the Java API, there are notes on DCP on github. You’re welcome to dive in, but please watch out for sharp rocks (to extend the metaphor).

There are a few other paths too. Spark Streaming, the Kafka Connector and some of the Couchbase tools do provide supported interfaces.

1 Like


DCP is a great way to get changes but it does require a lot of work.


  • If you are doing 10,000-1,000,000 updates/SET()s per second do you want the JAVA Client listen to the fire hose of changes coming from the Couchbase server?

  • If you shard the DCP stream so that not all the changes goes to one app how are you going to handle DCP sharding and which JAVA App is listening to which DCP stream(s)?

  • If one of your JAVA app goes down which JAVA app(s) is going to take over and what parts of the DCP stream has already been process and consumed by the JAVA app that just went down?

Couchbase Eventing
If you are wanting to do some basic eventing/functions like features Couchbase will have eventing soon. It will abstract a lot of the above for you: DCP sharding , DCP checkpoint management … etc. With eventing you can simple write JavaScript in the new Eventing Service in Couchbase to:

  • Create/Update docs in any bucket in the cluster
  • Set TTL on document(s)
  • Send emails
  • Do HTTP PUT/POST/GETS to outside URLs
  • Do N1QL queries
  • Do FTS searches
  • Write to a log in the cluster for auditing or tracking

Thank you, it is very useful!