Super Column Family
   HOME

TheInfoList



OR:

A super column family is a
NoSQL NoSQL (originally meaning "Not only SQL" or "non-relational") refers to a type of database design that stores and retrieves data differently from the traditional table-based structure of relational databases. Unlike relational databases, which ...
object that contains column families. It is a
tuple In mathematics, a tuple is a finite sequence or ''ordered list'' of numbers or, more generally, mathematical objects, which are called the ''elements'' of the tuple. An -tuple is a tuple of elements, where is a non-negative integer. There is o ...
(pair) that consists of a key–value pair, where the key is mapped to a value that are column families. In analogy with relational databases, a super column family is something like a "view" on a number of tables. It can also be seen as a map of tables.


Benefits

It is useful when making a data model to have some kind of a view on a number of tables. Using a super column family is something similar to that in
distributed data store A distributed data store is a computer network where information is stored on more than one node, often in a replicated fashion. It is usually specifically used to refer to either a distributed database where users store information on a ''numb ...
s. There are, however, no "
joins Join may refer to: * Join (law), to include additional counts or additional defendants on an indictment *In mathematics: ** Join (mathematics), a least upper bound of sets orders in lattice theory ** Join (topology), an operation combining two top ...
" between the "tables", as data stores like
Apache Cassandra Apache Cassandra is a free and open-source software, free and open-source database management system designed to handle large volumes of data across multiple Commodity computing, commodity servers. The system prioritizes availability and scalab ...
are non-relational.


Sorting and querying

There is no way to sort super columns after they have been inserted, nor to query an arbitrary query in
distributed data store A distributed data store is a computer network where information is stored on more than one node, often in a replicated fashion. It is usually specifically used to refer to either a distributed database where users store information on a ''numb ...
s. Super columns are sorted when they are added to the column family, and it is also possible to use a different sorting attribute for the contained
columns A column or pillar in architecture and structural engineering is a structural element that transmits, through compression, the weight of the structure above to other structural elements below. In other words, a column is a compression member ...
of a super column. Similar to the
standard column family The standard column family is a NoSQL object that contains columns of related data. It is a tuple (pair) that consists of a key–value pair, where the key is mapped to a value that is a set of columns. In analogy with relational databases, a stan ...
, sorting is defined by an attribute. This attribute is called the CompareSubcolumnsWith in
Apache Cassandra Apache Cassandra is a free and open-source software, free and open-source database management system designed to handle large volumes of data across multiple Commodity computing, commodity servers. The system prioritizes availability and scalab ...
and have the following values: * AsciiType * BytesType * LexicalUUIDType * LongType * TimeUUIDType * UTF8Type Although it is possible to sort the super columns in a way, the columns inside the super columns another way, it is not allowed to treat part of the super columns in a special way.


Code example

Here is an example of a super column family that contains other column families: UserList= Where "Cath" and "Terry" are row keys; "username", "address", and "account" are super column names; and "firstname", "lastname", "city", etc. are column names.


See also

* Column family types


References


External links


The Apache Cassandra data model
Distributed data stores NoSQL {{database-stub