Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk Insert/Update Operation #379

Open
payalmujavadiya opened this issue May 26, 2021 · 2 comments
Open

Bulk Insert/Update Operation #379

payalmujavadiya opened this issue May 26, 2021 · 2 comments

Comments

@payalmujavadiya
Copy link

Please support for bulk insert and update queries at once

@payalmujavadiya payalmujavadiya changed the title Bulk Inser/Update Operation Bulk Insert/Update Operation May 26, 2021
@payalmujavadiya
Copy link
Author

We are using achilles in our application where we were using insert/update for single entity till now using crud().insert(entity).execute()
is there any way we can insert List of entities and execute it at once ?, just to save db calls

@doanduyhai
Copy link
Owner

In Cassandra CQL, there is no efficient way to batch multiple statements together.

Indeed there is a BATCH CQL command but it will just put the stress on the coordinator node. You'll not see any perf improvement with BATCH statement. The only scenario where BATCH statement is really faster is when all your insert statements belong to the same partition key

If it's the case, have a look at Batch Mode in Achilles

Otherwise, it'll be faster for you to loop through a list of insert statements and use the async API to make the inserts queries parallel.

Be careful when using async feature, do not forget to put a reasonable pause between async inserts otherwise you'll overwhelm the server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants