Misuse of BATCH statement

How to misuse a BATCH statement.

Misused, BATCH statements can cause many problems in a distributed
database like Cassandra. Batch operations that involve multiple nodes are a definite
anti-pattern. Keep in mind which partitions data will be written to when grouping
INSERT and UPDATE statements in a
BATCH statement. Writing to several partitions might require
interaction with several nodes in the cluster, causing a great deal of latency for
the write operation.

Procedure

This example shows an anti-pattern since the BATCH statement
will write to several different partitions, given the partition key
id.