Databases Reference
In-Depth Information
6
Querying NoSQL Stores
WHAT'S IN THIS CHAPTER?
Illustrating a few query mechanisms in NoSQL in sample data sets
Querying use cases in the context of MongoDB, HBase, and Redis
Creating advanced and complex queries in NoSQL
Using alternatives for rich querying capabilities without SQL
SQL is possibly the simplest yet most powerful domain-specifi c language created so far. It is
easy to learn because it has a limited vocabulary, unambiguous grammar, and a simple syntax.
It is terse and limited in scope but it does precisely what it's meant to do. It enables you to
manipulate structured data sets like a ninja. You can easily fi lter, sort, dice, and slice the data
sets. Based on relations, you can join data sets and create intersections and unions. You can
summarize data sets and manipulate them to group by a specifi c attribute or fi lter them on
the basis of their grouping criteria. There is one limitation, though: SQL is based on relational
algebra, which works well with relational databases only. As is evident from its name, there is
no SQL with NoSQL.
The absence of SQL does not mean that you need to stop querying data sets. After all, any
data is stored to be possibly retrieved and manipulated later. NoSQL stores have their own
ways of accessing and manipulating data and you have already seen some of that.
NoSQL should really have been NonRel, implying non-relational. Although the creators and
proponents of the so-called NoSQL databases were moved away from relational databases
because of the structural relational constraints it imposed and the ACID transactions that it
upheld, especially as these became impediments to scaling and dealing with large data sets,
they weren't necessarily opposed to SQL. In fact, some still crave SQL in the world of NoSQL
and as a result have created query languages that in syntax and style resemble the same old
SQL. Old habits die hard, and why shouldn't they if they are the virtuous ones!
Search WWH ::




Custom Search