Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

3/7/2019

Reading time:1 min

Streaming from Cassandra with Triggers

by Suresh

Database TriggerA database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database.The trigger is mostly used for maintaining the integrity of the information on the database. For example, when a new record (representing a new worker) is added to the employees table, new records should also be created in the tables of the taxes, vacations and salaries.Cassandra TriggersFor supporting streaming from cassandra 1.2.x versions, lightweight Triggers are implemented as follows.An aspect is configured to track mutation events within cassandra systemThis aspect is called after the mutation operation and can see the row mutations of cassandraFor the respective column Family, The pre-configured triggers are executed.Configuring TriggerA column family is created to store the configured trigger classes for a given keyspace and column Family. These triggers are loaded initially when starting the cassandra server. If there is any change in Trigger configuration, There is an option provided to load triggers from JMX.ApplicationsThese lightweight triggers are a powerful mechanism that allows for data streaming from cassandra. This stream is pluggable with help of implemented triggers. We have configured streaming to Zeromq.Note: Triggers are part of apache cassandra distribution since v2.0. This work is done to support triggers for version 1.2.XReferenceshttp://en.wikipedia.org/wiki/Database_triggerhttp://maxgrinev.com/2010/07/23/extending-cassandra-with-asynchronous-triggers/
 Read Comments
 Leave a Comment
 

Illustration Image

Database Trigger

A database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database.

The trigger is mostly used for maintaining the integrity of the information on the database. For example, when a new record (representing a new worker) is added to the employees table, new records should also be created in the tables of the taxes, vacations and salaries.

Cassandra Triggers

For supporting streaming from cassandra 1.2.x versions, lightweight Triggers are implemented as follows.

  • An aspect is configured to track mutation events within cassandra system
  • This aspect is called after the mutation operation and can see the row mutations of cassandra
  • For the respective column Family, The pre-configured triggers are executed.

Configuring Trigger

A column family is created to store the configured trigger classes for a given keyspace and column Family. These triggers are loaded initially when starting the cassandra server. If there is any change in Trigger configuration, There is an option provided to load triggers from JMX.

Applications

These lightweight triggers are a powerful mechanism that allows for data streaming from cassandra. This stream is pluggable with help of implemented triggers. We have configured streaming to Zeromq.

Note: Triggers are part of apache cassandra distribution since v2.0. This work is done to support triggers for version 1.2.X

References

Related Articles

analytics
streaming
visualization

Keen - Event Streaming Platform

John Doe

2/3/2024

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

cassandra