You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
frozen: when we need to have data available in an entity that won't change
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:
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:
The text was updated successfully, but these errors were encountered: