In the world of NoSQL, each database has its own strengths and weaknesses. Understanding which open source database is "the right tool for the job" is half the battle if you want to start building better applications quickly. IBM developer advocate Glynn Bird explores practical examples of how two popular NoSQL databases - the Cloudant JSON document store and the Redis in-memory key-value store - can be used together to create performant and scalable Web applications. It also includes real world use cases you can try today, for free, using the IBM Cloud Data Services suite of fully managed NoSQL databases-as-a-service.
4. RDBMS
• Relational Database Management Systems
• SQL language developed by IBM in the 1970s
• RDBMS power lots of IT systems
• Oracle, IBM DB2, MySQL, PostgreSQL, etc.
9. Redis
• Key-value store
• In-memory storage
• Simple data storage structures
• Libraries for many programming languages
• Available as-a-service through Compose.io
! Auto-failover
! Free daily backups
! Scalable
! Enterprise Edition
15. What is Apache CouchDB?
• Free, open-source, NoSQL database
• JSON data store
• Built for the web - HTTP
• RESTful API
• It syncs!
• http://couchdb.apache.org
18. 18!
CRUD – Document
Primary
Index
Secondary Index
(view)
Search
Index
GeoSpatial Index
Cloudant
Query
• Direct document
look up by _id!
• Exists “OOTB”!
• stored in a b-tree!
• Primary key "
doc._id!
• Built using
MapReduce!
• stored in a b-tree!
• Key " user-
defined field(s)!
• Built using
Lucene!
• FTI: Any or all
fields can be
indexed!
• stored in R*, TPR,
KD tree!
• Lat/Long
coorindates in
GeoJSON!
• “Mongo-style”
querying!
• Built natively in
erlang!
• Use when you
want a single
document and
can find by its _id!
• Use when you
can find
documents based
on their _id!
• Pull back a range
of keys!
• Use when you
need to analyze
data or get a
range of keys!
• Ex: count data
fields, sum/
average numeric
results, advanced
stats, group by
date, etc.!
• Ad-hoc queries!
• Find documents
based on their
contents!
• Can do groups,
facets, and basic
geo queries (bbox
& sort by
distance)!
• Complex
geometries
(polygon,
circularstring,
etc.) !
• Advanced
relations
(intersect,
overlaps, etc.)!
• Ad-hoc queries!
• Lots of operators
(>, <, IN, OR,
AND, etc.)!
• Intuitive for
people coming
from Mongo or
SQL backgrounds!
20. Simple Search Service
• Free, open-source Bluemix App – install
with one click
• Upload your .csv or .tsv
# Imports data into cloudant
# Indexes everything for search
# Presents HTTP Search API
• Demo!
https://developer.ibm.com/clouddataservices/simple-search-service
24. Cloudant Use Cases
• Big Data – Large Data Sets
• Scalable operational data store
• Search – faceted, full-text search
• Geospatial – geographic, GIS systems, GeoJSON
• Offline-first – replicated data to mobile devices