Cloudant Querying Options



Similar documents
Technical Overview: Anatomy of the Cloudant DBaaS

Scaling up = getting a better machine. Scaling out = use another server and add it to your cluster.

Certified Apache CouchDB Professional VS-1045

Why NoSQL? Your database options in the new non- relational world IBM Cloudant 1

Perl & NoSQL Focus on MongoDB. Jean-Marie Gouarné jmgdoc@cpan.org

Analytics March 2015 White paper. Why NoSQL? Your database options in the new non-relational world

L7_L10. MongoDB. Big Data and Analytics by Seema Acharya and Subhashini Chellappan Copyright 2015, WILEY INDIA PVT. LTD.

Dr. Chuck Cartledge. 15 Oct. 2015

Getting Started with MongoDB

Building Internet of Things Apps with Cloudant DBaaS. Andy Ellicott, Cloudant John David Chibuk, Kiwi Wearables

MongoDB: document-oriented database

The evolution of database technology (II) Huibert Aalbers Senior Certified Executive IT Architect

Please ask questions! Have people used non-relational dbs before? MongoDB?

MongoDB Aggregation and Data Processing Release 3.0.4

Real-time Data Analytics mit Elasticsearch. Bernhard Pflugfelder inovex GmbH

MongoDB Aggregation and Data Processing

Offline-First Apps with PouchDB and IBM Cloudant

NoSQL replacement for SQLite (for Beatstream) Antti-Jussi Kovalainen Seminar OHJ-1860: NoSQL databases

MongoDB Developer and Administrator Certification Course Agenda

Big Data: Using ArcGIS with Apache Hadoop. Erik Hoel and Mike Park

Spring Data, Jongo & Co. Java Persistenz-Frameworks für MongoDB

Overview of Databases On MacOS. Karl Kuehn Automation Engineer RethinkDB

NoSQL, But Even Less Security Bryan Sullivan, Senior Security Researcher, Adobe Secure Software Engineering Team

MongoDB. An introduction and performance analysis. Seminar Thesis

In Memory Accelerator for MongoDB

Big Data Spatial Analytics An Introduction

NOSQL INTRODUCTION WITH MONGODB AND RUBY GEOFF

Oracle Big Data Spatial and Graph

Open source, high performance database

NoSQL Database - mongodb

The MongoDB Tutorial Introduction for MySQL Users. Stephane Combaudon April 1st, 2014

Big Data and Analytics: A Conceptual Overview. Mike Park Erik Hoel

Querying MongoDB without programming using FUNQL

extensible record stores document stores key-value stores Rick Cattel s clustering from Scalable SQL and NoSQL Data Stores SIGMOD Record, 2010

NoSQL: Going Beyond Structured Data and RDBMS

10. Creating and Maintaining Geographic Databases. Learning objectives. Keywords and concepts. Overview. Definitions

.NET User Group Bern

Search and Real-Time Analytics on Big Data

Introduction to Polyglot Persistence. Antonios Giannopoulos Database Administrator at ObjectRocket by Rackspace

NoSQL - What we ve learned with mongodb. Paul Pedersen, Deputy CTO paul@10gen.com DAMA SF December 15, 2011

NoSQL web apps. w/ MongoDB, Node.js, AngularJS. Dr. Gerd Jungbluth, NoSQL UG Cologne,

NoSQL Roadshow Berlin Kai Spichale

Big data and urban mobility

INTRODUCING AZURE SEARCH

Brad Dayley. NoSQL with MongoDB

CSCC09F Programming on the Web. Mongo DB

MongoDB in the NoSQL and SQL world. Horst Rechner Berlin,

Elasticsearch for Lua Developers. Pablo Musa

Introducing DocumentDB

IBM Cloudant: The Do-More NoSQL Data Layer IBM Redbooks Solution Guide

An Approach to Implement Map Reduce with NoSQL Databases

IBM Cognos 8 Business Intelligence Analysis Discover the factors driving business performance

Module 9 Ad Hoc Queries

MongoDB. Or how I learned to stop worrying and love the database. Mathias Stearn. N*SQL Berlin October 22th, gen

Product Navigator User Guide

Tuning Tableau and Your Database for Great Performance PRESENT ED BY

Introduction to NoSQL and MongoDB. Kathleen Durant Lesson 20 CS 3200 Northeastern University

NATIONAL INSTITUTE OF HOTEL MANAGEMENT, KOLKATA

Office of the Registrar. Introduction to PeopleSoft Reporting Tools Query

Saturday, 13 June CouchDB. Apache

Big Data With Hadoop

<Insert Picture Here> Oracle SQL Developer 3.0: Overview and New Features

Audit TM. The Security Auditing Component of. Out-of-the-Box

Oracle Big Data Spatial and Graph: Spatial Features

ifinder ENTERPRISE SEARCH

Frictionless Persistence in.net with MongoDB. Mogens Heller Grabe Trifork

Big Data Storage: Should We Pop the (Software) Stack? Michael Carey Information Systems Group CS Department UC Irvine. #AsterixDB

Intro to Mail Merge. Contents: David Diskin for the University of the Pacific Center for Professional and Continuing Education. Word Mail Merge Wizard

Welcome to The Future of Analytics In Action

How to Design and Create Your Own Custom Ext Rep

IBM Content Navigator

An Introduction to Open Source Geospatial Tools

CS242 PROJECT. Presented by Moloud Shahbazi Spring 2015

X3 Intelligence Reporting

Frequently Asked Questions Sage Pastel Intelligence Reporting

Big Systems, Big Data

Using CAD Data in ArcGIS

Resco CRM Server Guide. How to integrate Resco CRM with other back-end systems using web services

Apache Cassandra for Big Data Applications

Databases for text storage

Understanding NoSQL Technologies on Windows Azure

Adam Rauch Partner, LabKey Software Extending LabKey Server Part 1: Retrieving and Presenting Data

A WEB GIS FOR WETLANDS OF KERALA USING OPEN SOURCE GEOSPATIAL SOFTWARE. Santosh Gaikwad* and S Narendra Prasad**

Toad for Data Analysts, Tips n Tricks

OpenText Information Hub (ihub) 3.1 and 3.1.1

Cloud Scale Distributed Data Storage. Jürmo Mehine

INTRODUCTION TO APACHE HADOOP MATTHIAS BRÄGER CERN GS-ASE

Microsoft Access 3: Understanding and Creating Queries

DbSchema Tutorial with Introduction in MongoDB

Geodatabase Programming with SQL

MongoDB Aggregation and Data Processing

Building Your First MongoDB Application

Investigating Hadoop for Large Spatiotemporal Processing Tasks

ADVANCED DATA STRUCTURES FOR SURFACE STORAGE

SURVEY ON MONGODB: AN OPEN- SOURCE DOCUMENT DATABASE

Transcription:

Cloudant Querying Options

Agenda Indexing Options Primary Views/MapReduce Search Geospatial Cloudant Query Review What s New Live Tutorial 5/20/15 2

Reading & Writing Basics POST /<database> /_bulk_docs GET /<database>/<doc_id> /_all_docs 5/20/15 3

Indexes & Queries 5/20/15 4

Options Primary Secondary/Views (MapReduce) Cloudant Query Search (Lucene) Geospatial 5/20/15 5

Cloudant Indexes Primary Index Exists out-of-the-box Views (MapReduce), Search & Geospatial Indexes Define access patterns, not just for speed-ups Built incrementally Index functions are written in JavaScript Stored in _design documents

Primary Index /_all_docs?startkey= a &endkey= d &include_docs=true Notes Primary Key = doc._id Exists OOTB Stored in a b-tree Use Cases Use when you can find documents based on their _id Pull back a range of keys (_id) Retrieve either only _ids and _revs, or full doc bodies Data exports 5/20/15 7

Views (MapReduce) /_design/app/_view/count_by_user?group=true Notes Built using MapReduce Stored in a b- tree Key = userdefined field(s) Use Cases Use when you need to analyze data or get a range of secondary keys Time series analytics Examples: count data fields, sum/average numeric results, advanced stas, group by date, etc. 5/20/15 8

Search (Lucene) /_design/app/_search/animals?q=l* AND class:mammal Notes Built using Lucene FTI: Any or all fields can be indexed Use Cases Ad hoc queries Lucene sytnax (wildcards, fuzzy, ranges, etc.) Groups/facets on fields Basic geo: bbox & sort by distance 5/20/15 9

Geospatial /_design/app/_geo/geoidx?lat=-42&lon=-71&radius=1000 Notes Stored in R* tree TPR/MVR trees for temporal Lat/long coordinates stored in GeoJSON Use Cases Complex geometries (polygon, circularstring, etc.) Advanced relations (intersect, overlaps, etc.) 5/20/15 10

Cloudant Query 5/20/15 11

Cloudant Query is the place to start Cloudant Query is designed to be the logical starting point for developers new to Cloudant and to CouchDB In fact, we re contributing it back to the Apache CouchDB project "Apache", "CouchDB", "Apache CouchDB" and the CouchDB logo are trademarks or registered trademarks of The Apache Software Foundation. All other brands and trademarks are the property of their respective owners. 12

Cloudant Query Primary Map Adhoc Search _index _find Developer Familiarity SQL-like Mongo-like JSON everywhere Intuitive _design docs JavaScript functions Consistent API Powerful Operators & field filtering Auto-index all Natively compiled 5/20/15 13

Cloudant Query _index POST /_index create index type : json for fast lookups on secondary keys type : text for full adhoc querying capability GET /_index list indexes 5/21/15 14

Cloudant Query _find POST /_find query your database Operator $lt $lte $eq $ne $gt $gte $text $exists $type $in $nin $size $mod $regex Operator $and $or $not $nor $all Less than Less than or equal to Equal to Not equal to Greater than Greater than or equal to Usage ( text type ONLY) matches any field using default analyzer Boolean (exists or it does not) Check document field s type Field must exist in the provided array of values Field must not exist in the provided array of values Length of array field must match this value [Divisor, Remainder]. Returns true when the field equals the remainder after being divided by the divisor. Matches provided regular expression Usage Matches if all selectors in the array match Matches if any selectors in the array match Matches if the given selector does not match Matches if none of the selectors (multiple) match Matches an array value if it contains all element of argument array $elemmatch Returns first element (if any) matching value of argument 5/21/15 15

SQL vs. Cloudant Query selector - which subset of the data to return; the equivalent of the WHERE part of an SQL statement fields - the fields to be returned; the equivalent of the SELECT part of an SQL statement sort - how the result set is to be ordered ; the equivalent of the ORDER BY part of an SQL statement limit - how many results to return 16

Let s go to the movies The dataset we re using in the following example is a small subset of IMDB data that the service makes available for non-commercial and educational purposes. Here, we ve denormalized the separate tables for Actor, Movie, and Person to fit within Cloudant s JSON document-oriented model. Replicate me! https://examples.cloudant.com/query-movies In accordance with IMDb s Conditions of Use statement, we d like to add: Information courtesy of IMDb (http://www.imdb.com). Used with permission. 17

Best Practices on Querying Start with Cloudant Query! Find by _id OOTB Use CQ json for fast lookups on fixed secondary keys Use CQ text for full adhoc querying capability Use MapReduce/Views for online analytical use cases, group-level capabilities, or map-side joins. Use Search for Lucene goodies (wildcards, facets, fuzzy, etc.) or basic geo bbox Use Geospatial for advanced spatial queries, polygons, 4D 5/21/15 18

Resources Get an account and try it out: http://docs.cloudant.com/guides/cloudant-query.html Create an account at https://cloudant.com/sign-up/ Sample db: https://examples.cloudant.com/query-movies Check out the full docs for Cloudant Query: https://docs.cloudant.com/api.html#query Watch videos, read the docs, and try tutorials in the IBM Cloudant Learning Center: https://cloudant.com/learning-center/ 19

Thank you! 5/20/15 20

Appendix 5/20/15 21

Cloudant Index/Query Options Unique to Cloudant (not in CouchDB) Check out Index and Query intro video! CRUD Document Primary Index Secondary Index (view) Search Index Geospatial Index Cloudant Query Direct document lookup by _id Exists OOTB Stored in a b-tree Primary key > doc._id Built by using MapReduce Stored in a b-tree Key > user-defined fields Built by using Lucene FTI: Any or all fields can be indexed Stored in R* tree Lat/Long coordinates in GeoJSON Mongo-style querying Built natively in erlang Wraps Primary, views, and Search Use when you want a single document and can find by its _id Docs For Developers Tutorial Use when you can find documents based on their _id Pull back a range of keys Docs For Developers Tutorial Video Use when you need to analyze data or get a range of keys Examples: count data fields, sum/average numeric results, advanced stats, group by Docs date, and so on. For Developers Tutorial Example Ad hoc queries Find documents based on their contents Can do groups, facets, and basic geo queries (bbox and sort by distance) Docs For Developers Tutorial Example Complex geometries (polygon, circularstring, etc.) Advanced relations (intersect, overlaps, etc.) Docs Example Ad hoc queries Many operators (>, <, IN, OR, AND, and so on) Intuitive for people who come from Mongo or SQL backgrounds Docs Blog post Example

Cloudant Index Cheat Sheet Feature CRUD Document Primary Index View (MapReduce) Search Index Geospatial Index Cloudant Query Select ion Group ing Sortin g Result s Primary key lookup X X X X X Primary key range X X X X X Secondary key lookup X X X Secondary key range X X X List of keys X X X X Complex (ex: array) keys X X Adhoc lookup/range on multiple keys X X Boolean operations (AND, OR, NOT, etc.) X X Lucene: wildcards, fuzzy, boosting terms, proximity, facets, analyzers, X etc. Geo: bounding box X X Geo: polygon, geometries, 4D, radius, relations Joins (via map-side linked keys) Group by (count) X X Group by range/facet Group by (analytics) Group by (hierarchical analytics à group_level) Sort by key(s) X X X X Adhoc sort on multiple keys X X Sort by distance 200 results max X X Filter on fields at query time limit X X X X X skip X X X bookmark X X X stale=ok X X X X X X X X X X