Monday, May 21, 2012

What NoSQL solutions are out there for .NET?


What NoSQL solutions are out there for .NET?



Which have the best integration with C#? Which integrate with LINQ ? Also which would be easiest to integrate into an application?



Source: Tips4all

1 comment:

  1. You don't state what your requirements are (i.e. has to run on Windows), so I'll throw out the 2 that I've used successfully.

    MongoDB is a document database that has prebuilt binaries for 32bit and 64bit Windows. That's always a nice thing to see.

    Client access can be done with this driver. It isn't an official client from the MongoDB team itself, but I've used it. And in my usage, it has supported what I need. There is some LINQ stuff in the repo, but I haven't tried it.

    // from the wiki
    using MongoDB.Driver;
    Mongo db = new Mongo();
    db.Connect(); //Connect to localhost on the default port.
    Document query = new Document();
    query["field1"] = 10;
    Document result = db["tests"]["reads"].FindOne(query);
    db.Disconnect();


    I was able to run both client and server on Windows with no problems.

    CouchDB is an option as well. There are some native .NET clients, but all of CouchDB is done with REST. So HttpWebRequest/Response will serve you well here. A blog post by Rinat Abdullin shows how some of the pieces fit together. There is also CouchBrowse. I've never used a native client. GET/PUT/POST have worked very well for me.

    I got CouchDB to work on Windows (it's written in Erlang), but my performance testing showed that Linux was faster. My guess is maybe in how Erlang itself is implemented? I dunno. But it runs on both Windows and Linux. And I was able to call the Linux instance from Windows easily (it's just REST).

    This next one I've never tried, but I've got a friend who is a committer on the HBase project. And he thinks that the Thrift interface to HBase should be usable from .NET (since Thrift will generate C#). The big thing here is the fact that Hadoop/HBase are focused more on *nix environments. But there is no reason you couldn't run HBase on a Linux cluster and connect to it from .NET on Windows for production. For development, you can run HBase on Windows using Cygwin. A good set of instructions on how to do this is here.

    There are others (Valdemort, Cassandra, etc.) but I have no real experience with them so I won't pretend to say how they integrate with C#/.NET. The big thing to look at is what their API looks like - if it has a Thrift interface, REST, etc. you should be able to connect to them with no problems. You might not be able to run the NoSQL Service on Windows OS as efficiently as Linux, but maybe that isn't a big deal.

    EDIT Changed that there are some native CouchDB clients. I'm not familiar with them as I always use raw HTTP and my own little wrapper classes.

    ReplyDelete