Sometimes a nanosecond makes all the difference

In the Cassandra database there is a type known as TimeUUID. Which I have talked about a couple times on my blog and even created a pretty well received class for generating them. This type is typically used for log data, because it helps you create a unique value in the database that has an extractable timestamp. Because of how .NET creates DateTime.Now you rarely get a resolution smaller than a millisecond in the DateTime, even though DateTime supports a notion of a tick which is equivalent to 100 nanoseconds or 1/10,000 of a millisecond. As you can see there is plenty of room for more resolution, and this extra room not being used causes pain when you need a resolution smaller than milliseconds, which many high performance logging situations demand, so that all your log entries are put in order especially when you are receiving more than one in a millisecond time span. ...

September 20, 2012 · 3 min · 624 words · Nick Berardi

FluentCassandra Primer

Getting Started To get started you have to understand the basic terminology of the Cassandra database. Unlike relational databases (i.e. SQL Server, MySQL, etc) Cassandra is what is known as a Key/Value pair database. The Cassandra data model has 4 main concepts which are cluster, keyspace, column family and super column. A Cluster (also called as ring) is several servers (or nodes) functioning together to act as a single Cassandra database occurrence. A cluster will contain at least one node, and each cluster can contain many keyspaces. A Keyspace can contain many column families. A Column Family contains multiple columns referenced by a record keys. A Column contains a name, value, and a timestamp. The column name can be a static label (such as “name” or “email”) or it can be set to a wide range of values (ex. a date of a log entry). The actual columns that make up a row are can be determined by the client application or pre set in a more traditional method using CQL. To better understand what all this means lets do a naming remapping from relational databases to Cassandra. ...

June 17, 2012 · 3 min · 619 words · Nick Berardi

Run Cassandra As A Windows Service

One of the main issues that comes up over and over again for Cassandra is: How do I run Cassandra as a Windows Service? In this post I am going to answer that question and in the process demonstrate how to do it in less than 10 minutes. Background Cassandra is mainly developed by Linux developers so very little attention has been paid to the Windows developer or administrator as far as Cassandra goes. So as Windows developers we have to hop through a couple more hoops than just clicking on an install.exe file and and letting it do all the work. However lucky for us, those hoops are easy and quickly hopped through. ...

June 17, 2010 · 3 min · 455 words · Nick Berardi

Your First Fluent Cassandra Application (part 2)

Last time I demonstrated how to create your first Fluent Cassandra app. After we finished learning about how to create records and save them to the database, I issued a challenge to implement comments for our command line blog app we created. I hinted at how I would have done it with this column family configuration: <ColumnFamily Name="Comments" ColumnType="Super" CompareWith="TimeUUIDType" CompareSubcolumnsWith="UTF8Type" /> And this is what we are going to implement today. ...

June 6, 2010 · 6 min · 1140 words · Nick Berardi

Your First Fluent Cassandra Application

As your are probably aware by now if you follow my Twitter status or have looked in to some of my recent posts. I am developing a library called FluentCassandra which is a .NET library for using the Cassandra database in a .NETty way. The project has progressed quite nicely in the last couple of months and I am finally ready to start talking about it and giving examples on how it can be used in your applications. So lets gets started… ...

June 2, 2010 · 6 min · 1160 words · Nick Berardi

That No SQL Thing: Column (Family) Databases

Just wanted to mention a very well written post that explains Column Family Databases, like that of Cassandra, in the most straight forward way that I have found to explain the concept to .NET developers. I have no doubt that most of you who read Ayende’s blog have already seen this, but for those that might have missed the post, or don’t follow him, here it is: http://ayende.com/Blog/archive/2010/05/14/that-no-sql-thing-column-family-databases.aspx The fictitious fluent interface that he demonstrates in this blog post was a great inspiration to my own Fluent Querying that I have included in Fluent Cassandra.

May 24, 2010 · 1 min · 95 words · Nick Berardi

TimeUUID only makes sense with version 1 UUIDs

In a world where we are all use to dealing with objects we often forget that everything gets reduced to ones and zeros before being transmitted over the wire to the destination. Most times the destination easily handles converting this object back in to an object on the other side that is easily understood and consumed. The frustration comes when we run in to a situation where the other side doesn’t understand our transmitted data. This can often cause us to pull our hair out, become irritable, and throw out hands up in disgust. Well recently I have been doing all that when trying to solve what sounds like simple problem on the surface. Sending the bytes of a Type 1 UUID, or GUID, over the wire from .NET to a server running on Java. ...

May 16, 2010 · 4 min · 720 words · Nick Berardi

Creating a Time UUID (GUID) in .NET

Previously I had written about how to setup Cassandra as a database on your Windows machine. As I was diving in deeper to learn more about the subject, I realized that .NET lacks a critical type to Cassandra, for column comparison and sorting, called TimeUUIDType. TimeUUIDType is a Version 1 UUID used in the CompareWith attribute of the storage config file. A Version 1 UUID is defined as the following: Conceptually, the original (version 1) generation scheme for UUIDs was to concatenate the UUID version with the MAC address of the computer that is generating the UUID, and with the number of 100-nanosecond intervals since the adoption of the Gregorian calendar in the West. In practice, the actual algorithm is more complicated. This scheme has been criticized in that it is not sufficiently “opaque”; it reveals both the identity of the computer that generated the UUID and the time at which it did so. ...

April 5, 2010 · 4 min · 759 words · Nick Berardi

Cassandra Jump Start For The Windows Developer

Recently I have been exploring the NoSQL options for .NET and specifically a database called Cassandra. In case you haven’t heard of Cassandra before, it is a decentralized, fault-tolerant, elastic database designed by Facebook for high availability. As Wikipedia describes it: Cassandra is an open source distributed database management system. It is an Apache Software Foundation top-level project, as of February 17, 2010, designed to handle very large amounts of data spread out across many commodity servers while providing a highly available service with no single point of failure. It is a NoSQL solution that was initially developed by Facebook and powers their Inbox Search feature. Jeff Hammerbacher, who led the Facebook Data team at the time, has described Cassandra as a BigTable data model running on an Amazon Dynamo-like infrastructure. ...

March 30, 2010 · 6 min · 1166 words · Nick Berardi