This article covers the difference between a supercolumn and a subcolumn in Cassandra.
Let me cut to the chase: there is no difference. They are two terms for exactly the same thing.
If you are familiar with a typical keystore->column family->row->super column->column structure, such as the one pictured below, then you could safely replace all instances of the phrase “super column” with “subcolumn” without changing the meaning.
The confusion around “super column” vs. “sub column” is fueled largely by the Cassandra configuration file. In your “storage-conf.xml” file you will see XML “ColumnFamily” configuration elements like this:
<ColumnFamily Name="Super1"
ColumnType="Super"
CompareWith="BytesType"
CompareSubcolumnsWith="BytesType" />
If this was was a plain old “ColumnFamily” entry, you would only see this:
<ColumnFamily Name="Regular1"
CompareWith="BytesType" />
…but this is a “Super Column Family”, so there are two extra attributes:
- ColumnType=”Super” to tell Cassandra that this column family will contain super columns.
- CompareSubcolumnsWith=”BytesType” to tell Cassandra that our sub columns will be sorted through bit-by-bit comparison.
Confused? If so, go back and read the last two bullets again while telling yourself:
“super column = sub column = supercolumn = subcolumn…”
Published on Monday July 12, 2010 at 09:49am
