Cassandra batch query vs single insert performance

后端 未结 2 553
北恋
北恋 2021-01-05 06:08

I use Cassandra java driver.

I receive 150k requests per second, which I insert to 8 tables having different partition keys.

My question is whic

相关标签:
2条回答
  • 2021-01-05 06:33

    Please check my answer from below link:

    Cassandra batch query performance on tables having different partition keys

    Batches are not for improving performance. They are used for ensuring atomicity and isolation.

    Batching can be effective for single partition write operations. But batches are often mistakenly used in an attempt to optimize performance. Depending on the batch operation, the performance may actually worsen.

    https://docs.datastax.com/en/cql/3.3/cql/cql_using/useBatch.html

    If data consistency is not needed among those tables, then use single insert. Single requests are distributed or propagated properly (depends on load balancing policy) among nodes. If you are concerned about request handling and use batch, batches will burden so many extra works on coordinator nodes which will not be efficient I guess :)

    0 讨论(0)
  • 2021-01-05 06:39

    Batches have a HUGE impact on performance instead. The sollution that best suits you as I understand to split into diffirent lists per partition keys and then use batch statements. You will see a huge impact on performance.

    0 讨论(0)
提交回复
热议问题