Equivalent to consumer group in Cassandra

Viewed 43

I'm trying to create a sort of a consumer group as it exist in Kafka but for Cassandra. The goal is to have a request been paginated and each page done by one instance of an App. Is there any notion like the consumer group one in Cassandra ?

2 Answers

The TL;DR; is that no, the consumer-group notion doesn't exist in the clients in Cassandra. The burden of which client processes what is entirely on the app developer.

You can use Cassandra's tokens to do selective paging.

Assuming 2 clients (easy example) Client 1 pages from -2^63 to 0 Client 2 pages from 1 to 2^63 - 1

The above idea assumes you want to page through all the data in something similar to a batch process which wouldn't be a good fit for Cassandra.

If you're after the latest N results, where the 1st half is sent to client 1 and the second to client 2 you can use a logical bucket in your partitioning key.

If you're looking to scale the processing of a large number of Cassandra rows, you might consider a scalable execution platform like Flink or Storm. You'd be able to parallelize both the reading of the rows and the processing of the rows, although a parallelizable source (or spout in Storm) is not something you can get out of the box.

Related