Running .NET CouchDB applications on AppHarbor
CouchDB is an advanced and mature NoSQL database that has been around since 2005. CouchDB stores data in a JSON format and uses Javascript for queries and to define views. It also has great HTTP-based REST API. These features makes CouchDB extremely accessible and easy to use by web developers.
On AppHarbor you can get fast, hosted CouchDB by using the add-on provided by our friends at Cloudant (Cloudant was in the illustrious first batch of AppHarbor add-ons).
The Cloudant guys have great resources to get .NET developers started with CouchDB. If you don’t want to use the raw REST API, there are a bunch of solid libraries that make using CouchDB from .NET very simple. These include:
Sample application
To make getting started with CouchDB on AppHarbor even faster, we have developed a simple ASP.NET MVC application that uses CouchDB as its backing store. The sample uses relax-net to talk to CouchDB. relax-net handles interaction with CouchDB service and abstracts away all JSON serialization and deserialization of .NET objects.
relax-net also comes with a strongly-typed, fluent query-syntax for fetching documents out of CouchDB. The neat thing is that these relax-net queries are automatically converted to Javascript-defined CouchDB views. This means that queries, after the first, one are going to be super fast, even if query parameters change. Below is a screenshot of the Cloudant administration interface showing a view automatically generated by the query on age found in the sample code.
var repository = new Repository<T>("connectionString")
var peopleAgeFiftyOrOlder = repository.Where(x => x.Age).Ge(50)
Don’t miss out on this great piece of technology and go provision the Cloudant add-on right now!
*