practical use of a nosql
TRANSCRIPT
![Page 1: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/1.jpg)
NoSQL use-cases you can use today Practical NoSQL Glynn Bird Developer Advocate, IBM Cloud Data Services [email protected] @glynn_bird
![Page 2: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/2.jpg)
Agenda • NoSQL vs. SQL
• Types of NoSQL
• Redis
• Cloudant
![Page 3: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/3.jpg)
SQL vs. NoSQL
![Page 4: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/4.jpg)
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.
![Page 5: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/5.jpg)
RDBMS downsides
• Scalability
• Availability
• Price
![Page 6: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/6.jpg)
NoSQL
• NoSQL = “Not Only SQL”
• Response to use-cases that an RDBMS is not a good fit
• Easier to scale
![Page 7: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/7.jpg)
Key-Value Document
BigTable Graph
![Page 8: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/8.jpg)
Redis
![Page 9: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/9.jpg)
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
![Page 10: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/10.jpg)
Create a deployment
![Page 11: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/11.jpg)
Demo
![Page 12: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/12.jpg)
Simple Log Sharing Service https://logshare.mybluemix.net/
!
![Page 13: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/13.jpg)
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
![Page 14: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/14.jpg)
Cloudant
![Page 15: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/15.jpg)
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
![Page 16: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/16.jpg)
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
![Page 17: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/17.jpg)
Cloudant scales
• Distributed database
• Add nodes to scale
• Fault-tolerance
• RESTful API
![Page 18: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/18.jpg)
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!
![Page 19: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/19.jpg)
Demo
![Page 20: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/20.jpg)
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
![Page 21: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/21.jpg)
Simple Search Service – Architecture
![Page 22: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/22.jpg)
Simple Search Service – Production Architecture
![Page 23: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/23.jpg)
https://developer.ibm.com/clouddataservices/simple-search-service/ https://cloudant.com/blog/turning-a-spreadsheet-into-a-faceted-search-engine-with-cloudant/
![Page 24: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/24.jpg)
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
![Page 25: Practical Use of a NoSQL](https://reader030.vdocuments.site/reader030/viewer/2022032613/58719ae91a28ab044e8b5a31/html5/thumbnails/25.jpg)
Developer Advocate [email protected] developer.ibm.com/clouddataservices/
Thanks!
Glynn Bird Twitter: @glynn_bird www.glynnbird.com !