|
Couchbase C++ SDK 1.4.0 (rev. 59aa900)
|
Connecting through a Cloud Native Gateway instead of directly to cluster nodes.
A connection string with the couchbase2:// scheme routes every operation over gRPC to a single Cloud Native Gateway (CNG) endpoint, rather than opening MCBP and HTTP connections to each node of a cluster. The gateway performs the routing the library would otherwise do itself.
The public API is the same one used for couchbase:// and couchbases://. No type or method is specific to this transport; what changes is which operations a cluster can serve, and how a connection string is written.
couchbase:// or couchbase2://. What is uncommitted is the behaviour of running it over this transport at all.Support is a compile-time option and is off by default. A library built without COUCHBASE_CXX_CLIENT_BUILD_COUCHBASE2 refuses a couchbase2:// connection string, reporting feature_not_available from connect rather than attempting a handshake the gateway cannot answer.
The scheme implies TLS: a couchbase2:// connection is always encrypted, and the default port is 18098. Neither is inferred from the scheme name, so an endpoint published on another port must say so explicitly, and a private certificate authority must be trusted as it would be for couchbases://.
Two further rules apply to couchbase2:// that do not apply to the other schemes:
preserve_bootstrap_nodes_order is set, so which one is not predictable from the order they were written in. The log records the endpoint chosen and that the rest were ignored.These report feature_not_available without reaching the gateway, because the transport has no way to carry them:
Two things are not served either, but do not report feature_not_available and are not turned away before work begins. Both need the bucket configuration and the per-node connections this transport does not open, so they fail on that path instead, and the error describes that failure rather than the missing feature.
The first is scan.
The second is poll-based durability, and it is the one to know about, because the mutation is already applied by the time it fails.
It is requested by passing persist_to and replicate_to to common_durability_options. The mutation is sent to the gateway and applied, and only the polling that follows fails, so the document is already written when the error arrives and the durability it asked for has not been established.
Level-based durability, requested with a durability_level, is served normally and is the durability to use over this transport.
Anything not listed above is sent to the gateway, which decides whether it can serve it. An operation the gateway does not implement is reported in the gateway's own terms, so the set of working operations depends on the gateway version as well as on this library.