cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikael Wikblom <>
Subject CL - locally consistent ONE
Date Fri, 28 Oct 2011 09:33:19 GMT

We are using (or will use in later versions) cassandra as backend for a 
java based CMS called SiteVision. Cassandra runs in the same jvm as the 
servlet container and is started by the CMS webapp. Each cluster node is 
a stand-alone installation of the CMS. Our production environments 
includes clusters ranging from 1 to 5 nodes in house at around 150 
customers and the product has been around for about 10 years.

SiteVision uses cassandra to store the domain model where each domain 
object has an unique id corresponding to the row key and a number of 
aspects (uses a home made AOP framework) which are serialized java 
objects stored in columns. We set replication factor to the same as the 
number of nodes and read / write uses CL - ONE.

The application logic needs to be sure that a read preceded by a write 
always returns the written object. This is normally the case when the 
local node is the one that is the fastest. If the local node however for 
some reason is a bit slow, a remote node may answer faster which breaks 
the the consistent "write - read" scenario (has been proven to occur 
during tests). The obvious solution to this would be to to use CL - 
QUORUM, but this is to slow for us. What we would need is some kind of 
of CL - "locally consistent ONE" where cassandra makes sure that the 
local node is asked, even if it is not the fastest answering node.

I've patched the classes WriteResponseHandler and ReadCallback to make 
sure that the local node has returned before sending the condition 
signal. Can anyone see any drawbacks with this approach? I realize this 
will only work as long as the replication factor is the same as the 
number of nodes, but that is ok for our scenario.

Kind regards

Mikael Wikblom
Software Architect
SiteVision AB

View raw message