Cluster for live time of application

@evgeniya.bell

It is still expected that you should have a singleton instance of the Cluster for the application lifetime. We’ve just removed ClusterHelper, preferring to let you use your dependency injection system’s approach for singletons. If you are using Microsoft.Extensions.DependencyInjection (i.e. in .NET Core) then you can use our extension package, Couchbase.Extensions.DependencyInjection. For Ninject, just register with .InSingletonScope(). Other DI systems should have similar methods.

For the connection string, it still supports bootstrap via multiple servers. This is just using the more current syntax for your connection string. Here is an example:

couchbase://server1,server2,server3

Just comma-delimit the list of servers. You typically do not need to include port numbers any more for most use cases. If using TLS, then use “couchbases” instead of “couchbase” in the URL.

2 Likes