Giter Club home page Giter Club logo

cassandra-sharp's Introduction

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 :)

Starting from version 2, only CQL 3 binary protocol is supported and as a consequence, Cassandra 1.2+ is required. Also, only .NET 4.0+ is supported. If you are looking for a Thrift compatible driver, or have to use Cassandra 1.0/1.1 or require .NET 3.5 support, please consider using version 0.6.4 of cassandra-sharp.

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

Zip archive are also available at Google Code (since GitHub removed binaries uploads) : http://code.google.com/p/cassandra-sharp/downloads/list

Copyright & License

cassandra-sharp - high performance .NET driver for Apache Cassandra
Copyright (c) 2011-2013 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 (compatible with C# 5 async) 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 2012. 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 bool DurableWrites { get; set; }

    public string KeyspaceName { get; set; }

    public string StrategyClass { get; set; }

    public string StrategyOptions { get; set; }
}

public static class Sample
{
    private static void DisplayKeyspace(SchemaKeyspaces ks)
    {
        Console.WriteLine("DurableWrites={0} KeyspaceName={1} strategy_Class={2} strategy_options={3}",
                          ks.DurableWrites,
                          ks.KeyspaceName,
                          ks.StrategyClass,
                          ks.StrategyOptions);
    }

    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

cassandra-sharp's People

Contributors

axle-h avatar cj525 avatar dedale avatar eplowe avatar hjarraya avatar pchalamet avatar philiptromans avatar stuart-beattie avatar virus-x avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.