200
F. Firouzi and B. Farahani
be contained in relational columns. Databases that are column-oriented are housed
on disk column-wise. The most obvious benefit of this database is that queries
can resolve quickly. For example, when exploring the average age of users, you
could move to the location where age data is kept and read the required information
rather than searching for age row-by-row as you would in a row-oriented database.
Therefore, Cassandra allows you to ignore irrelevant data easily (see Fig. 4.16) [16,
19].
Cassandra’s model is comprised of columns, column families, keys (column
names), and keyspaces. Table 4.2 compares each element of the Cassandra model to
its counterpart in an RDBMS model.
Query Language Cassandra Query Language (CQL) is similar to SQL, reducing
barriers for users more familiar with relational databases. CQL also uses queries
similar to SQL; however, CQL differs in that it does not support joins, group by,
or foreign keys. Excluding these elements makes writing and retrieving Cassandra
data more efficient.
Name
Born
Died
Country
Type
Humphrey
Bogart
1899
1957
USA
Actor
Al Pacino
1940
-
USA
Actor
Columns
c
Born
1899
Died
1957
Country
USA
Type
Actor
Humphrey
Bogart
c
Born
1940
Died
-
Country
USA
Type
Actor
Al Pacino
c
c
c
c
Column family view
Table view
Row
Row
Cell
Fig. 4.16 How a table view can be converted to a column family model
Table 4.2 Relationship of
RDBMS terminology with
Cassandra
RDBMS
Cassandra
Database
Keyspace
Table
Column family
Primary key
Partition key
Column name Column name/key
Column value Column value
Précédent

- 207/647

Suivant