Super column family

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
File:Super column family (data store).png
A super column family consists of a row key and a number of super columns.

A super column family is a NoSQL object that contains column families. It is a tuple (pair) that consists of a key-value pair, where the key is mapped to a value that are column families.[1] 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.[2]

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 stores. There are, however, no "joins" between the "tables", as data stores like Apache Cassandra 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 stores. 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 of a super column. Similar to the standard column family, sorting is defined by an attribute. This attribute is called the CompareSubcolumnsWith in Apache Cassandra 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.[3]

Super column families vs. views

Column families have a schemeless nature so that each of their "row"s can contain a different number of columns, and even different column names could be in each row.[4] So, they are a very different concept than the rows in relational database management system (RDBMS)s. This is one of the reasons why the concept is not trivial for an experienced RDBMS expert.

Code example

Here is an example of a super column family that contains other column families:[4]

 UserList={ 
   Cath:{
     username:{firstname:”Cath”,lastname:”Yoon”}
     address:{city:”Seoul”,postcode:”1234”}
   }
   Terry:{
     username:{firstname:”Terry”,lastname:”Cho”}
     account:{bank:”hana”,accounted:”1234”}
   }
 }

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

References

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. 4.0 4.1 Lua error in package.lua at line 80: module 'strict' not found.

External links

<templatestyles src="Asbox/styles.css"></templatestyles>