Using Event-Driven Architectures with Cassandra

Successfully reported this slideshow.

Using Event-Driven Architectures with Cassandra
@petabridge Petabridge.com
Event-Driven Architectures with
Cassandra
Aaron Stannard, CTO & Cofounder Petabridge
DataStax M...
@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
• Em...
@petabridge Petabridge.com
Goals & Benefits
• Extreme decoupling
• Easily distributed
• Inherently asynchronous and concur...
@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 ...
@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 jou...
@petabridge Petabridge.com
Have questions? Ask us!
http://petabridge.com/

Upcoming SlideShare

Loading in …5

×

  1. 1. @petabridge Petabridge.com Event-Driven Architectures with Cassandra Aaron Stannard, CTO & Cofounder Petabridge DataStax MVP 2015
  2. 2. @petabridge Petabridge.com Crash Course in EDA
  3. 3. @petabridge Petabridge.com Successful Product
  4. 4. @petabridge Petabridge.com Struggling Business
  5. 5. @petabridge Petabridge.com A Radical New Product
  6. 6. @petabridge Petabridge.com Allow our customers to start conversations with specific types of users.
  7. 7. @petabridge Petabridge.com Had to be done in real-time for best results.
  8. 8. @petabridge Petabridge.com Prototype: HTTP + Database
  9. 9. @petabridge Petabridge.com (Read after Write)
  10. 10. @petabridge Petabridge.com Theory
  11. 11. @petabridge Petabridge.com Reality
  12. 12. @petabridge Petabridge.com Breakthrough!
  13. 13. @petabridge Petabridge.com I had STATEFUL, REACTIVE, STREAM PROCESSING problem!
  14. 14. @petabridge Petabridge.com Implementation: HTTP -> EDA -> C*
  15. 15. @petabridge Petabridge.com Why Do We Care About EDA?
  16. 16. @petabridge Petabridge.com Databases Aren’t Magical
  17. 17. @petabridge Petabridge.com Event-Driven Architecture Concepts
  18. 18. @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
  19. 19. @petabridge Petabridge.com Goals & Benefits • Extreme decoupling • Easily distributed • Inherently asynchronous and concurrent
  20. 20. @petabridge Petabridge.com EDA Styles • Simple Event Processing • Event Stream Processing • Complex Event Processing (CEP)
  21. 21. @petabridge Petabridge.com Event Stream Processing w/ FSMs
  22. 22. @petabridge Petabridge.com
  23. 23. @petabridge Petabridge.com
  24. 24. @petabridge Petabridge.com
  25. 25. @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) )
  26. 26. @petabridge Petabridge.com Event Sourcing with C*
  27. 27. @petabridge Petabridge.com
  28. 28. @petabridge Petabridge.com
  29. 29. @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
  30. 30. @petabridge Petabridge.com Have questions? Ask us! http://petabridge.com/