Understanding Wide-Column Stores
To understand the concept more clearly, let’s start with an example of Relational database:
Customers
| |||||||||||
Id
|
Product
|
FN
|
Date
|
Country
| |||||||
1
|
Dell
|
Harry
|
17/04/2018
|
India
| |||||||
2
|
Dell
|
Harry
|
17/04/2018
|
India
| |||||||
3
|
Apple
|
Ron
|
17/04/2018
|
India
| |||||||
4
|
Sony
|
Ron
|
17/04/2018
|
South Africa
| |||||||
5
|
Sony
|
Hermione
|
17/04/2018
|
South Africa
| |||||||
When we convert this to a Column Store, this is how it looks like:
FN
|
LN
|
Product
|
Date
|
Country
| |||||||||
Id
|
Value
|
Id
|
Value
|
Id
|
Value
|
Id
|
Value
|
Id
|
Value
| ||||
1-2
|
Harry
|
1-2
|
Potter
|
1-2
|
Dell
|
1-5
|
17/04/2018
|
1-3
|
India
| ||||
3-4
|
Ron
|
3-4
|
Weasley
|
3
|
Apple
|
4-5
|
South Africa
| ||||||
5
|
Hermione
|
5
|
Granger
|
4-5
|
Sony
|
Now a Wide Column store will Group the columns which are accessed frequently together into one , like
Id
|
Name
| |
1-2
|
FN
|
Harry
|
LN
|
Potter
| |
3-4
|
FN
|
Ron
|
LN
|
Weasley
| |
5
|
FN
|
Hermione
|
LN
|
Granger
|
Some key points are,
- Columns are created for each row rather than being predefined by the table structure. So, each row can have different columns.
- We can thing of wide columns as a key-value collection, where each value in the collection is either a simple data type or another key-value collection.
- In most systems, a third piece of data is usually held for each column: a timestamp that records when the data was added to the database or last modified. In above example, there would be one more column along with FN and LN to store timestamp.
- Unlike traditional databases, a column in a wide-column database is not something that you define in advance – they are created as needed when sending data to the database.
The advantage of this design is processing power and ability to work with truly massive data sets.
Two most popular NoSQL wide-column databases are Cassandra, HBase and Amazon SimpleDB.
Comments
Post a Comment