2

Is there a PUB-SUB feature for Cassandra using nodejs?

I have a table TableA with TTL value, If any row in the table got evicted Is there a way to catch the events in nodejs?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Harry
  • 3,072
  • 6
  • 43
  • 100

1 Answers1

3

There is no such thing...

On server side you can either get changes with CDC, or via triggers (although their use is discouraged). And I'm not really sure that both of these methods will capture expiration via TTL...

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • any nodejs example for Triggers? – Harry Feb 01 '18 at 10:51
  • 1
    No - triggers need to be written in Java because they are executed inside Cassandra. You can look into documentation (https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlCreateTrigger.html) & examples (https://stackoverflow.com/questions/35161747/example-of-creating-triggers-in-cassandra-and-does-this-support-only-for-java), but as I mentioned in my answer, it's discouraged to use them as they may heavily impact Cassandra. – Alex Ott Feb 01 '18 at 11:25