Archive

Archive for June, 2014

Cassandra, C# and async await.. Oh my

June 11, 2014 Leave a comment

 

Cassandra is really cool stuff. Especially for time series. Even though  you are new to NOSQL the transition is pretty fast once. But first of all you need to learn to unlearn what you know before about relational database.

You need to download it first from DataStax. You can find the step by step installation from here

A couple of things you need to keep in mind is this principle :

 

  1. Don’t model your data. Model your query.
  2. Don’t afraid of data duplication
  3. Denormalization is Good

You also need to be familiar with Brewer’s CAP theorm and BASE.

Ok. Enough talking. Now let’s get down to code.

Cassandra is cool, so we need to find the programming language that’s totally awesome to access it. Smile 

C# it is !!

 

You can easily find the Cassandra library from Nuget. It’s DataStax library too.

 

image

 

The problem is of course the documentation. You can find the sample code from github project actually. Also from here. But dude… it’s still using TPL and ContinueWith callback model.

image

 

Can you imagine if you would try to execute that from loop ? Sad smile

Anders Helsjberg would cry for that one.

What is so hard about changing that one into this one. Everyone will rejoice about that.

image

 

Also I think DataStax need to support Reactive Extensions for their library. Instead of enumerable row it should return Observable.

I saw the another library that support TPL, Async Await and Rx from Nuget.

image

You can found it’s github here. I will definitely check that out later.

 

Until then please spend your time to understand concept, data modeling and architecture in Cassandra. Please read the following books. It’s the latest book that I think will safe you some time when you have a trouble with Cassandra.

imageimageimage

image

 

Have a great time with the pretty Cassandra.

 

Cheers

Advertisement
Categories: Uncategorized