January 23, 2012

Introducing the Couchbase .NET Client Library 1.0

What's in a Name?

With the release of Couchbase Server 1.8, both the server and client libraries are getting a number of bug fixes.  But the change that will mean the most to long time users is the new name.  Membase Server is now Couchbase Server and the Membase .NET Client Library is now the Couchbase .NET Client Library.  This refactoring isn't like renaming your AccountManager class to AccountService, it goes beyond that

Getting the Client

There are a couple of ways to get the Couchbase .NET Client Library, or simply "the client."  The easiest way, is use Nuget, the .NET package manager for Visual Studio.    You can get the Couchbase Nuget package by opening the Package Manager Console under View -> Other Windows and typing:

Install-Package CouchbaseNetClient
A second option is to download a zip file with the assembly and dependencies.  You can also grab the latest source from Github.   See the notes readme.mdown to build from the source. 
 

Hello, Couchbase!

Checkout the client's home page for a walkthrough on how to get started with the client.  The API documentation provides sample code for the primary methods you'll use when working with the client.  The snippets below give you the basics of the client. 

//standard app.config settings may also be used
var config = new CouchbaseClientConfiguration { Bucket = "default" };
config.Urls.Add(new Uri("http://127.0.0.1:8091/pools/default"));

var beer = new Beer { Name = "Atlantic Amber", Brewery = "New England Brewing Co." }
var client = new CouchbaseClient(config);
client.Store(StoreMode.Add, "beer_12345", beer);

var savedBeer = client.Get<Beer>("beer_12345");

Breaking Changes

With the product name change comes a new name for the client.  This update means that your code that used to look like:

var client = new MembaseClient();

now looks like:

var client = new CouchbaseClient();
The config section has changed as well.  See the release notes for more examples.
 

Looking Forward

Couchbase Server 1.8 and the .NET Client Library 1.0 are only a few hours old (well, they've only been released for a few hours), but we're already thinking about Couchbase Server 2.0 and the new client libraries.   So keep an eye on this blog for the latest samples and information. 

 

Comments