The first beta of Apache Cassandra 2.0 has been out for a while now. This new release contains a number of exiting new features that makes Cassandra more powerful and easier to work with.

Over the next few weeks I’ll have a look at some of the new features to expect. If you want to dive in and try it yourself check out the 2.0.0-beta1 branch from the Cassandra repository on GitHub.

First up is:

Triggers

The most anticipated feature, according to the number of watchers on the feature request in JIRA , is the inclusion of trigger support. Inclusion of triggers in Apache Cassandra has been a long running discussion and is still considered very experimental (expect some breaking API changes in later version), so be sure to try them out and provide feedback to the Cassandra development team if they’re something you would like to use but be prepared to rework your triggers in the future.

Triggers are currently purely JVM-based and are provided by classes implementing the ITrigger interface. Triggers are executed once on the co-ordinator node and run before data is written.

Triggers can be declared using the following syntax:

For a real example of a trigger see the inverted index example in the Cassandra repository.

Due to the experimental nature of triggers there isn’t a whole lot of management support around them. For example, you will need to copy the jar containing your triggers to each node. Expect to see better trigger management support in 2.1.

Update

Cassandra 2.0 Release Candidate 1 is out!

Shares
Share This