Database Reference
In-Depth Information
Discretely writable collections
While it's useful for records to be internally structured into discrete fields, a given property
of a record isn't always a single value like a string or an integer. One simple way to handle
fields that contain collections of values is to serialize them using a format like JSON, and
then save the serialized collection into a text field. However, in order to update collections
stored in this way, the serialized data must be read from the database, decoded, modified,
and then written back to the database in its entirety. If two clients try to perform this kind
of modification to the same record concurrently, one of the updates will be overwritten by
the other.
For this reason, many databases offer built-in collection structures that can be discretely
updated: values can be added to, and removed from collections, without reading and rewrit-
ing the entire collection. Cassandra is no exception, offering list, set, and map collections,
and supporting operations like "append the number 3 to the end of this list". Neither the cli-
ent nor Cassandra itself needs to read the current state of the collection in order to update it,
meaning collection updates are also blazingly efficient.
Search WWH ::




Custom Search