Informix SQL & NoSQL -- for Chat with the labs on 4/22

17
IBM Informix for SQL & NoSQL Keshav Murthy [email protected] Architect, IBM Informix

description

Informix SQL and NoSQL

Transcript of Informix SQL & NoSQL -- for Chat with the labs on 4/22

Page 1: Informix SQL & NoSQL -- for Chat with the labs on 4/22

IBM Informix forSQL & NoSQL

Keshav Murthy [email protected]

Architect, IBM Informix

Keshav Murthy [email protected]

Architect, IBM Informix

Page 2: Informix SQL & NoSQL -- for Chat with the labs on 4/22

2

Page 3: Informix SQL & NoSQL -- for Chat with the labs on 4/22

3

Applications must support mobile

Interoperate with modern applications with agility

Enterprise infrastructure

Ability to scale to big data

Commodity hardware and software

Use case are driving big data

Data base layer meets web app requirements

Strategy: more interactions with customers

Systems of engagement needed!

71% CIOs see move toward social/digital collaboration

New class of applications are based on NoSQL

Global C-suite Study, http://www-935.ibm.com/services/us/en/c-suite/csuitestudy2013/

Explosion of mobile devices

Business Trends Driving NoSQL Adoption

Page 4: Informix SQL & NoSQL -- for Chat with the labs on 4/22

4

SQL NoSQLDefine Schema first Write the program first

Relational Key-value, Document, column family, graph and text

Changing schema is hard

Assumes dynamic schema

Scale-up Scale-out

ACID consistency BASE consistency

Transactions No Transactions

SQL Proprietary API; Sometimes has the “spirit” of SQL

Page 5: Informix SQL & NoSQL -- for Chat with the labs on 4/22

5

Martin Fowler says: “aggregate-oriented”What you're most likely to access as a unit.

Key Value Store Couchbase Riak Citrusleaf Redis BerkeleyDB Membrain ...

Document MongoDB CouchDB RavenDB Couchbase ... Graph

OrientDB DEX Neo4j GraphBase ...

Column HBase Hypertable Cassandra ...

NoSQL Landscape

Page 6: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Informix

NoSQL Applications on Informix

New Listener supports MongoDB drivers Use the same driver for Informix & MongoDB

MongoDB native Client

MongoDB native Client

MongoDB web

browser

MongoDB web

browser

MobileMobile

ApplicationsApplications

MongoDB Wire

Protocol

Informix

MongoDB

driver

MongoDB

driver

6

Informix

Page 7: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Application Development Tools

The MEAN StackThe MEAN Stack

Page 8: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Basic Translation Terms/Concepts

8

Mongo/NoSQL Terms

Traditional SQL Terms

Database Database

Collection Table

Document Row

Field Column

Index Index

{"name":"John","age":21, state:”CA”}{"name":"Tim","age":28, Provence: “BC”}{"name":"Scott","age":30, country: “UK”, status:1}

Name Age

John 21

Tim 28

Scott 30

Collection

DocumentKey Value

Table

Row

Page 9: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Informix JSON Store Benefits

Row locking on the individual JSON document

Large documents, up to 2GB maximum size

Ability to compress documents

Ability to intelligently cache commonly used documents

Use existing storage options and management tools.

9

Page 10: Informix SQL & NoSQL -- for Chat with the labs on 4/22

•Supports B-Tree indexes on any key-value pairs.

•Typed indices could be on simple basic type (int, decimal,)

•Type-less indices could be created on BSON and use BSON type comparison

•Translate ensureIndex() to CREATE INDEX

•Translate dropIndex() to DROP INDEX

Indexing

10

Mongo Operation SQL Operation

db.customers.ensureIndex( {orderDate:1, zip:-1})

CREATE INDEX IF NOT EXISTS v_customer_2 ON customer (bson_extract(data,‘orderDate') ASC, bson_extract(data,‘zip') DESC) USING BSON

db.customers.ensureIndex( {orderDate:1},{unique:true})

CREATE UNIQUE INDEX IF NOT EXISTS v_customer_3 ON customer (bson_extract(data,'c1') ASC USING BSON

Page 11: Informix SQL & NoSQL -- for Chat with the labs on 4/22

scale out (sharding) + High Availability

App ServerMongo Driver

ListenerJDBC

Enterprise repliation + Flexible Grid

App ServerMongo Driver

ListenerJDBC

App ServerMongo Driver

ListenerJDBC

App ServerMongo Driver

ListenerJDBC

Informix/1Primary

Informix/1SDS/HDR

Informix/1RSS

Informix/2Primary

Informix/2SDS/HDR

Informix/2RSS

Informix/3Primary

Informix/3SDS/HDR

Informix/3RSS

Informix/4Primary

Informix/4SDS/HDR

Informix/4RSS

Informix/5Primary

Informix/5SDS/HDR

Informix/5RSS

Informix/6Primary

Informix/6SDS/HDR

Informix/6RSS

Page 12: Informix SQL & NoSQL -- for Chat with the labs on 4/22

1212

Explosion of mobile

devices – gaming and social apps

Advertising: serving ads

and real-time bidding

Social networking,

online communities

E-commerce, social

commerce

Machine data and real-time operational decisions

Smart Devices

NoSQL + Relational

Internet of Things

Page 13: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Hybrid Data Access:relational tables & JSON Collections

Relational Table JSON Collections

SQL API Standard ODBC, JDBC, .NET, OData, etc.Language SQL.

MongoDB API (NoSQL)

Mongo APIs for Java, Javascript, C++, C#, etc.

Direct SQL Access.Dynamic ViewsRow types

Mongo APIs for Java, Javascript, C++, C#, etc.

Page 14: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Hybrid Data Access

14

SQL Tables

JSON Collections

TimeSeries

MQ Series

SQL APIsJDBC, ODBC

SQL APIsJDBC, ODBC

Informix

IWA – BLU Acceleration

GenBSON: SQL to BSON

Text search

Spatial

MongoDB Drivers

MongoDB Drivers

Timeseries(JSON)

Page 15: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Mongo Application

IBM Wire Listener

IDXs

Logs

Enterprise replication + Flexible Grid + Sharding

Distributed Queries

Database

Tables

Tables

IDXs

Relational TablesRelational Tables

JSON CollectionsJSON Collections

SELECT bson_get(bson, ‘{}’) FROM customer WHERE bson_value_lvarchar(bson,‘state’)=“MO”SELECT bson_get(bson, ‘{}’) FROM customer WHERE bson_value_lvarchar(bson,‘state’)=“MO”

db.customer.find({state:”MO”})db.customer.find({state:”MO”}) db.partners.find({state:”CA”})db.partners.find({state:”CA”})

SELECT * FROM partners WHERE state=“CA”SELECT * FROM partners WHERE state=“CA”

CustomerCustomer

partnerspartners

JSON JSON

Access Relational

Access JSON

MongoAPI Accessing NoSQL & Relational Data

Page 16: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Tables

JDBC connections

IDXsLogs

Enterprise replication + Flexible Grid

Distributed Queries

Database

Tables

TablesIDXs

Relational TablesRelational Tables

JSON CollectionsJSON Collections

SELECT bson.customer::JSON,bson.state::lvarchar

FROM customer WHERE bson.state::lvarchar = “MO”

SELECT bson.customer::JSON,bson.state::lvarchar

FROM customer WHERE bson.state::lvarchar = “MO”

Select * from patners where state = “CA”;Select * from patners where state = “CA”;

CustomerCustomer

partnerspartners

Access Relational

Access JSON

SQL ApplicationsSQL Applications

SQL Accessing NoSQL & Relational Data

SQL TypesSQL Types

Page 17: Informix SQL & NoSQL -- for Chat with the labs on 4/22

Informix for NoSQL and SQL

Access consistent data from its source

Avoid ETL, continuous data sync and conflicts.

Exploit the power of SQL, MongoAPI seamlessly

Exploit the power of RDBMS technologies in MongoAPI: Cost based Optimizer & power of SQL

Spatial indices, Lucene text indices, and more.

Access all your data thru any interface: MongoAPI & SQL

Store data in one place and efficiently transform and use them on demand.

Existing SQL based tools and APIs can access new data in JSON