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

Improve data storing on Cassandra #18

Open
VincenzoFerme opened this issue Dec 12, 2015 · 0 comments
Open

Improve data storing on Cassandra #18

VincenzoFerme opened this issue Dec 12, 2015 · 0 comments
Assignees
Milestone

Comments

@VincenzoFerme
Copy link
Member

We should check that we take care of different aspect of the Cassandra design.

As reported on http://www.ipponusa.com/blog/10-tips-and-tricks-for-cassandra/, we should:

Don’t use PreparedStatement if you insert empty columns
If you have an empty column in your PreparedStatement, the CQL driver will in fact insert a null value in Cassandra, which will end up being a tombstone.

This is a very bad behavior, as:

  • Those tombstones of course take up valuable resources.
  • As a result, you can easily reach the tombstone_failure_threshold (by default at 100,000 which is in fact quite a high value).

The only solution is to have one PreparedStatement per type of insert query, which can be annoying if you have a lot of empty columns! But if you have multiple empty columns, shouldn’t you have used a Map to store that data in the first place?

Some other interesting references:

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

No branches or pull requests

2 participants