@petabridge Petabridge.com Event-Driven Architectures with Cassandra Aaron Stannard, CTO & Cofounder Petabridge DataStax MVP 2015
@petabridge Petabridge.com Crash Course in EDA
@petabridge Petabridge.com Successful Product
@petabridge Petabridge.com Struggling Business
@petabridge Petabridge.com A Radical New Product
@petabridge Petabridge.com Allow our customers to start conversations with specific types of users.
@petabridge Petabridge.com Had to be done in real-time for best results.
@petabridge Petabridge.com Prototype: HTTP + Database
@petabridge Petabridge.com (Read after Write)
@petabridge Petabridge.com Theory
@petabridge Petabridge.com Reality
@petabridge Petabridge.com Breakthrough!
@petabridge Petabridge.com I had STATEFUL, REACTIVE, STREAM PROCESSING problem!
@petabridge Petabridge.com Implementation: HTTP -> EDA -> C*
@petabridge Petabridge.com Why Do We Care About EDA?
@petabridge Petabridge.com Databases Aren’t Magical
@petabridge Petabridge.com Event-Driven Architecture Concepts
@petabridge Petabridge.com Key Terms • Event – a significant change in “state” • Message – a notification of an event • Emitter – detect, gather, transfer events • Sinks – react to events immediately • Channels – conduit between emitters and sinks
@petabridge Petabridge.com Goals & Benefits • Extreme decoupling • Easily distributed • Inherently asynchronous and concurrent
@petabridge Petabridge.com EDA Styles • Simple Event Processing • Event Stream Processing • Complex Event Processing (CEP)
@petabridge Petabridge.com Event Stream Processing w/ FSMs
@petabridge Petabridge.com
@petabridge Petabridge.com
@petabridge Petabridge.com
@petabridge Petabridge.com CQL Schema CREATE TABLE IF NOT EXISTS FSMState ( persistence_id text, state_id int, state_data blob, PRIMARY KEY (persistence_id, state_id) )
@petabridge Petabridge.com Event Sourcing with C*
@petabridge Petabridge.com
@petabridge Petabridge.com
@petabridge Petabridge.com EDA + C* Tips and Tricks • Large number of small sinks works best • Define simple, reusable journals and snapshots • C* == durable backup, App = single source of truth • TTL everywhere your business domain supports it
@petabridge Petabridge.com Have questions? Ask us! http://petabridge.com/

Using Event-Driven Architectures with Cassandra

Editor's Notes

  • #17 C* users should care about their application architecture for the simple reason that C* isn’t magic and can’t do everything. Cassandra can’t solve the problem of real-time correlation or reaction at the application layer. Developers have to solve these problems themselves, and Cassandra is just one part of the solution.
  • #21 Event Stream Processing and CEP play nicely with Cassandra, and that’s what we’ll be focusing on
  • #26 Intentionally small and stupid