NoSQL use-cases you can use today
Glynn Bird – Developer Advocate
March 2016
Practical NoSQL
Introduction
@glynn_bird glynn.bird@uk.ibm.com
Glynn Bird
Developer Advocate
IBM Cloud Data Services
http://www.glynnbird.com
Agenda
 NoSQL vs SQL
 Types of NoSQL
 Redis
 Cloudant
3
SQL vs NoSQL
RDBMs
 Releational Database Management Systems
 SQL language developed by IBM in the 1970s
 RDBMs power lots of IT systems
 Oracle, IBM DB2, MySQL, PostgreSQL etc
5
RDBMS downsides
 scalability
 availability
 price
6
NoSQL
 NoSQL = "Not only SQL"
 Response to use-cases that a RDBMS is not a good fit
 Easier to scale
7
8
Key-Value Document
BigTable Graph
Redis
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
10
Create a deployment
11
Demo
12
Simple Log Sharing Service
13
https://logshare.mybluemix.net/
Redis use-cases
 Cache – time-limited data
 Pubsub – sharing a data stream with many clients
 Queues – distributing work
 Leaderboards – sorted sets
 Counting – incrementing, unique users
 Auto-complete – custom indexes
14
Cloudant
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/
16
Graphite &
Riemann
Monitoring
Chef
Configuration
Management
rsyslog
Federated Logging
CollectD
Continuous
Integration
CouchDB
JSON storage, API,
Replication
Dynamo
Clustering, Scaling,
Fault Tolerance
Lucene
Text indexing &
Search
Haproxy
Geo-Load Balancing
GeoJSON
Geospatial indexing
& query
Jenkins
Continuous
Integration
Cloudant scales
 Distributed database
 Add nodes to scale
 Fault-tolerance
 RESTful API
18
19
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
Demo
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!
21
https://developer.ibm.com/clouddataservices/simple-search-service/
Simple Search Service Architecture
22
Simple Search Service – Production Architecture
23
https://developer.ibm.com/clouddataservices/simple-search-service/
https://cloudant.com/blog/turning-a-spreadsheet-into-a-faceted-search-
engine-with-cloudant/
Cloudant use-cases
 Big Data – Large data sets
 Scalable operational data store
 Search – faceted, full-text search
 Geo-spatial – geographic, GIS systems, GeoJSON
 Offline-first – replicating data to mobile devices
25
Glynn Bird
Developer Advocate, Cloud Data Services
glynn.bird@uk.ibm.com
@glynn_bird
github.com/glynnbird
www.glynnbird.com

Practical Use of a NoSQL Database