Events with Persistence using Cassandra

akka
scala

(Anthony Garo) #1

Hi,

current tech stack: Scala, Akka, Play, Cassandra

I’m experimenting with events as first-class citizens in my current architecture.
The services that produce events use Cassandra as the backend.
One of the techniques to guarantee message delivery is persisting these events before putting them on a message bus. If failures happen, then they can be retried later.

I was wondering if there was any advice on how to achieve this with Cassandra? All research shows using Cassandra as a queue (for retrying messages) is an anti-pattern.
Also, there many instances of said services so concurrency issues is something to keep in mind.

Thank You.


(Ivano Pagano) #2

All I can say is that what you found about cassandra is correct, it’s not tailored as a queue, cause of tombstones accumulation and garbage generation.

What you want to achieve is usually done with Kafka, that’s the currently most used entry point for this kind of architectures. It’s pretty easy to set up even for small-scale and it’s ready out-of-the-box for distribution and up-scaling