What is the most efficient way of inserting multiple rows in cassandra column family. Is it possible to do this in a single call.
Right now my approach is to addinsert m
There is a batch insert operation in Cassandra. You can batch together inserts, even in different column families, to make insertion more efficient.
In Hector, you can use HFactory.createMutator
then use the add
methods on the returned Mutator to add operations to your batch. When ready, call execute()
.
If you're using CQL, then you group things into a batch by starting the batch with BEGIN BATCH
and ending with APPLY BATCH
.