Hi ,
What is efficient way to insert multiple rows in cassandra db from java.
I am using spring-data and it took 2 minutes to insert 600 rows
Hi ,
What is efficient way to insert multiple rows in cassandra db from java.
I am using spring-data and it took 2 minutes to insert 600 rows
Hello,
The bottleneck of inserting these 600 rows maybe not Spring Data Cassandra, but spring boot.
If your Cassandra code is used from the spring boot and invoked via HTTP, you may want to consider increasing the number of threads in spring (thread pool)
Regarding Spring-Data-Cassandra and possible performance improvements:
1. If you are using CqlTemplate, consider reworking your logic to async version: AsyncCqlTemplate, or reactive: ReactiveCqlTemplate
2. Leverage PrerparedStatement (instead of SimpleStatement) and use it in subsequent queries to reduce overhead when sending each query
3. Use BatchStatement to batch N statements that will be sent as a one batch request.
5 People are following this question.
Can we leverage DataStax Java Driver 4.x with Spring Data Cassandra?
How do I monitor client connections in Spring Data Cassandra?
How do I implement connection pooling in Spring Data Cassandra 3.0.5?
How can we create a keyspace with IF NOT EXISTS in Spring Data using XML config?
Issue with spring-boot-starter-data-cassandra and spark-cassandra-connector?
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use