Databases Reference
In-Depth Information
The listing above demonstrates RedisTemplate in the context of the TagSynonyms example. The data
access class interacts with Redis via the template and uses the methods defi ned in the RedisTemplate
to push an element, run a range query, and delete an element.
That's all for this rudimentary example but I hope you get a sense of the available and emerging
abstractions that would allow you to work smoothly among NoSQL products and between RDBMS
and NoSQL options.
MIGRATING FROM RDBMS TO NOSQL
Migrating from a structured schema to a schema-less form is not very hard. In many cases you
could simply export the data from RDBMS tables and move them into NoSQL collections.
However, things get complicated when the NoSQL database is a column-family, sorted ordered, or a
key/value store. Changes in paradigm often lead to redesign efforts.
The greater impedance mismatch is around ad-hoc querying and secondary indexes, which are
often diffi cult to support in a NoSQL environment. NoSQL looks at the data store from a query
perspective and not from a generic storage viewpoint.
To facilitate data importation from RDBMS to Hadoop for NoSQL-style manipulations, Cloudera
has created an open-source product called Sqoop. Sqoop is a command-line tool with the following
capabilities:
Imports individual RDBMS tables or entire databases to fi les in HDFS
Generates Java classes to allow you to interact with your imported data
Provides the ability to import from SQL databases straight into your Hive data warehouse
You can learn more about Sqoop at https://github.com/cloudera/sqoop .
SUMMARY
This chapter presented a case for polyglot persistence. It showed the path to using RDBMS and
NoSQL side-by-side. Examples of large popular social media venues were cited to draw inspiration.
Facebook, Twitter, and LinkedIn examples were included.
Subsequently, the chapter provided a brief overview of the products that bridge the gap between
the RDBMS and the NoSQL world. Popular frameworks like Rails, Django, and Spring and their
support for both RDBMS and NoSQL were illustrated with the help of a few examples.
Last but not least, a brief conversation on migrating data from RDBMS to NoSQL was included
to show how data can be moved from tables to structures that are more amenable to MapReduce-
style analytics.
The next chapter covers a few topics that pertain to performance tuning.
Search WWH ::




Custom Search