Using Couchbase to connect to AWS ElastiCache Memcached

Hello,

I’m using CouchbaseNetClient to connect to local instance and everything works pretty well with the next code.
Initialization:
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;
});
Injection:
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
Configuration Endpoint:my-cluster-name.zxcvbnm.use2.cache.amazonaws.com:11211
Also there are some nodes and node endpoints that looks like: my-cluster-name.zxcvbnm.0001.use2.cache.amazonaws.com:11211

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?

Thanks!

@znnch

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.

Brant

1 Like