- [Instructor] Next, let's talk about
NoSQL columnar databases,
which are also sometimes called column-oriented databases.
These are similar in concept to relational databases.
And in a relational database,
one of the most common things that we do
is using the data that's organized into rows of tables,
we'll perform select queries
that enable us to pick off specific columns of information
across either all of the rows
or only the rows that meet certain search criteria.
So one of the problems when you're dealing with
data in relational tables
is that such queries can actually perform really poorly
because you have to get every single matching row,
find the required column,
and throw away the rest of the row.
So columnar databases are basically optimized
for searching columns of data very rapidly
in big data applications.
So I provided a couple of links here
where you can learn a little bit more
about column-oriented databases.
But let's just take for consideration purposes
our authors table from the earlier examples in this lesson.
And as you can see, we have some ID numbers
for the different authors.
And we have first names and last names.
So we have rows representing authors,
and columns representing specific pieces of data
for those authors.
And the ID column was one of the three columns in our table.
What you're seeing here is the way it got displayed
as a data frame when we rendered that table
after querying its total contents.
Now in a columnar database,
rather than storing the data on an author by author basis,
we store the data based on an attribute by attribute basis.
So the first column, the ID numbers,
is going to be stored in order by row.
The second set of values will be the first names
in the same order.
And then we'll have the last names
in the same order as well.
So because the column elements are maintained in row order,
when you get the value at a particular index
from one of the columns,
you can get the corresponding pieces of data
from the other columns if you need them
by accessing the same index number in those columns as well.
And a couple of the popular columnar databases
are MariaDB's ColumnStore and HBase.