high performance .NET driver for Apache Cassandra
C# Thrift XSLT
Permalink
Failed to load latest commit information.
.nuget update nuget Jul 5, 2017
Apache.Cassandra renamed version files Jan 31, 2016
CassandraSharp.Interfaces fix collection serialization Nov 13, 2017
CassandraSharp fix init keyspace Nov 15, 2017
CassandraSharpUnitTests fix documentation and samples Nov 17, 2017
Samples fix documentation and samples Nov 17, 2017
ThirdParties nuget support in solution Feb 12, 2013
Thrift fix assembly info for thrift Jan 31, 2016
cqlplus implement prepare query + header Nov 13, 2017
.gitignore Adapted unit tests project for .NET 4 environment Mar 3, 2014
Build.cmd produce all nuget packages in one shot Mar 12, 2013
CHANGES.txt fix documentation and samples Nov 17, 2017
Changes.xslt change the way release notes are generated Apr 27, 2013
Install.ps1 correctly fixed NuGet references Mar 22, 2013
InstallationDummyFile.txt correctly fixed NuGet references Mar 22, 2013
LICENSE-2.0.txt moving to github Dec 11, 2012
NEWS.txt prepared readme for 3.0 release Feb 17, 2013
Publish.cmd fixed publish Mar 12, 2013
README.md fix documentation and samples Nov 17, 2017
TODO.txt release 2.3.0 Feb 13, 2013
Version.xml prepare for version 4 Nov 17, 2017
build.sh worker refactoring & unix build script May 31, 2014
cassandra-sharp-AssemblyInfo.cs fix documentation and samples Nov 17, 2017
cassandra-sharp-core.nuspec use System.Reactive now instead of Rx- Jul 5, 2017
cassandra-sharp-info.cs prepared readme for 3.0 release Feb 17, 2013
cassandra-sharp-interfaces-AssemblyInfo.cs fix documentation and samples Nov 17, 2017
cassandra-sharp-interfaces.nuspec modified instrumentation interface: TracingSession is now only availa… May 14, 2013
cassandra-sharp-tools.nuspec modified instrumentation interface: TracingSession is now only availa… May 14, 2013
cassandra-sharp.nuspec modified instrumentation interface: TracingSession is now only availa… May 14, 2013
cassandra-sharp.sln dropped .net 4.0 support. Fixed 82 & 83 Sep 13, 2014
cassandra-sharp.sln.DotSettings prepared readme for 3.0 release Feb 17, 2013
cassandra-sharp.snk snk is publicly available Jan 29, 2013
cassandra-sharp.targets use System.Reactive now instead of Rx- Jul 5, 2017

README.md

cassandra-sharp - high performance .NET driver for Apache Cassandra

build status

The philosophy of cassandra-sharp is to be really simple and fast: no Linq provider, no complex API. Just CQL, simple object mapping and great performance :)

With version 4, cassandra-sharp is only speaking native protocol 4 - basically, this means you are required to use Cassandra 3.

cassandra-sharp supports async operations exposed as Rx subscriptions or TPL tasks. Efficient memory usage can be achieve using the push model of Rx.

A command line tool is also available (cqlplus) to access a Cassandra cluster. It's also a great tool to understand what's happening under the cover.

Getting binaries

Binaries are available through NuGet : http://www.nuget.org/packages/cassandra-sharp

Copyright & License

cassandra-sharp - high performance .NET driver for Apache Cassandra
Copyright (c) 2011-2017 Pierre Chalamet

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
 
http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Features

  • async operations (TPL tasks / Rx subscriptions)
  • Rx interface (IObservable / IObserver) for result streaming
  • TPL Task for future operations
  • Linq friendly
  • extensible rowset mapping (poco and map provided out of the box)
  • blazing fast object marshaler (dynamic gen'ed code)
  • robust connection handling (connection recovery supported)
  • ability to understand performance issues (client and server side)
  • multiple extension points
  • command line tool (cqlplus)
  • .NET 4.0+ support (Microsoft .NET / Mono)

How to build

To build cassandra-sharp, load cassandra-sharp.sln in Visual Studio 2017. To build from command line and to regenerate thrift proxy, use Build.cmd.

Sample configuration

<configSections>
	<section name="CassandraSharp" type="CassandraSharp.SectionHandler, CassandraSharp.Interfaces" />
</configSections>

<CassandraSharp>
	<Cluster name="TestCassandra">
		<Endpoints>
			<Server>localhost</Server>
		</Endpoints>
	</Cluster>
</CassandraSharp>

Sample client

public class SchemaKeyspaces
{
    public string KeyspaceName { get; set; }
    public bool DurableWrites { get; set; }
    public Dictionary<string, string> Replication { get; set; }
}
	
public static class Sample
{
    private static void DisplayKeyspace(SchemaKeyspaces ks)
    {
        Console.WriteLine("KeyspaceName={0} DurableWrites={1} Class={2} ReplicationFactor={3}",
                          ks.KeyspaceName,
                          ks.DurableWrites,
                          ks.Replication["class"],
                          ks.Replication["replication_factor"]);
    }
	
    public static async Task QueryKeyspaces()
    {
        XmlConfigurator.Configure();
        using (ICluster cluster = ClusterManager.GetCluster("TestCassandra"))
        {
            var cmd = cluster.CreatePocoCommand();
            const string cqlKeyspaces = "SELECT * from system_schema.keyspaces";

            // async operation with streaming
            cmd.WithConsistencyLevel(ConsistencyLevel.ONE)
               .Execute<SchemaKeyspaces>(cqlKeyspaces)
               .Subscribe(DisplayKeyspace);

            // future
            var kss = await cmd.Execute<SchemaKeyspaces>(cqlKeyspaces).AsFuture();
            foreach (var ks in kss)
                DisplayKeyspace(ks);
        }

        ClusterManager.Shutdown();
    }
}

Thanks

JetBrains provided a free licence of Resharper for the cassandra-sharp project. Big thanks for the awesome product. ReSharper

This projects also relies on the following third parties:

Thanks to all contributors for ideas, bug fix and feedbacks!

githalytics.com alpha