Using Couchbase to connect to AWS ElastiCache Memcached


I’m using CouchbaseNetClient to connect to local instance and everything works pretty well with the next code.
serviceCollection.AddCouchbase(client =>
client.Servers = new List { new Uri(“my local url”) };
client.Username = “admin”;
client.Password = “password”;
client.UseSsl = false;
client.ConfigurationProviders = ServerConfigurationProviders.HttpStreaming;
public MemcachedService(IMemcachedConfiguration configuration, IBucketProvider bucketProvider)
this.bucketProvider = bucketProvider;
bucket = bucketProvider.GetBucket(“bucket-name”);

But when I try to put this code to AWS I face with terminology issues. ElastiCache Memcached doesn’t have buckets and doesn’t use username/password. AWS ElastiCache Memcached operates with clusters and configuration endpoints:
Cluster: my-cluster-name
Also there are some nodes and node endpoints that looks like:

Passing configuration endpoint value to Servers during initialization and and cluster name as bucket name doesn’t work (I’m getting a timeout) so I think that I’m passing wrong values as server or bucket. Is there any working example of accessing ElastiCache Memcached using CouchbaseNetClient?



To the best of my knowledge, the Couchbase SDK can only connect to a Couchbase Server cluster. While there is support for the memcached protocols in the SDK, the bootstrapping process of the SDK is very specific to APIs only provided by Couchbase Server. The memcached support is there because the Couchbase wire protocol is based on memcached, and because Couchbase Server can operate memcached buckets alongside Couchbase buckets.


1 Like