I am developing a REST API with spring boot and open source cassandra. When an insert request comes from client to my API, I need to insert my main table and other source of truth tables in same keyspace.
I have to insert 5 - 10 partitions and the operation is need to be atomic insert. I am using CassandraBatchOperations from CassandraTemplete for batch. There is a batch size limit in cassandra (default 50kb). I want to handle this batch size. For example: Client sends an object to API for insert data to database and then API prepares the batch. I want to check this batch size before batch execute. If batch size < 50kb i will insert the data then return true as a respone to client. If batch size > 50kb then return false as a repsonse to client.
I tried many ways and i couldnt handle it.
Is anybody try this before?