Database Reference
In-Depth Information
Map columns in column families
Although maps might seem like the most complex of the three collection column types,
their column family level representation is actually simpler than that of lists, so we'll save
lists for last. To get a sense of what map columns look like at the column family level, let's
take a look at the social_identities map in alice 's user record:
GET users['alice'];
Again, we'll focus solely on the interesting cells in the result:
The structure of the cell names looks identical to the cell names used by set columns.
However, unlike set columns, the cells encoding map columns have values in them. In a
map, the map keys are stored in cell names, and the map values are stored in cell values.
We can thus visualize a map like this:
The relationship between the underlying representations of map columns and set columns
should come as no great surprise; many programming languages implement their set data
type using an underlying map whose values are not meaningful.
Our reasoning about the process of insertion and deletion in sets also carries over to maps.
Since, for any given map key that needs to be inserted or deleted, the CQL abstraction can
calculate the corresponding cell name, map key-value pairs can be directly inserted and de-
leted without Cassandra needing to read the full contents of the column.
Search WWH ::




Custom Search