Top Banner
NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage ThoughtWorks Inc. Tuesday, June 11, 13
87

NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Mar 09, 2018

Download

Documents

haphuc
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

NoSQL DistilledA guide to polyglot persistence

#NoSQLDistilled@pramodsadalageThoughtWorks Inc.

Tuesday, June 11, 13

Page 2: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Why RDBMS?

Tuesday, June 11, 13

Page 3: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

ACID TransactionsAtomicityConsistencyIsolationDurability

Tuesday, June 11, 13

Page 4: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Standard Query Interface

Tuesday, June 11, 13

Page 5: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Interact with many languages

Tuesday, June 11, 13

Page 6: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Everyone knows SQL

Tuesday, June 11, 13

Page 7: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Everyone knows SQL

Tuesday, June 11, 13

Page 8: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Limit less indexing

Tuesday, June 11, 13

Page 9: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Handles many data models

Tuesday, June 11, 13

Page 10: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Why NoSQL

Tuesday, June 11, 13

Page 11: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Schema changes are hard

Tuesday, June 11, 13

Page 12: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

line items:

customer: Ann

$4820321293533

$3910321601912

$5110131495054

$96

$39

$51

payment details:

Card: AmexCC Number: 12345expiry: 04/2001

ID: 1001orders

customers

order lines

credit cards

Impedance mismatchTuesday, June 11, 13

Page 13: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Application vs Integration databases

Billing

Inventory

Billing

Inventory

Integration Database

Application Database web service

Tuesday, June 11, 13

Page 14: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Running on clustersTuesday, June 11, 13

Page 15: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Un-Structured Data

Tuesday, June 11, 13

Page 16: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Un-Even rate of data growth

Tuesday, June 11, 13

Page 17: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Domain Models

Tuesday, June 11, 13

Page 18: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Domain driven data models

Tuesday, June 11, 13

Page 19: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

RDBMS dataTuesday, June 11, 13

Page 20: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Aggregate model (Embedding objects)

Tuesday, June 11, 13

Page 21: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Aggregate Data

// in customers{ "customer": { "id": 1, "name": "Martin", "billingAddress": [{"city": "Chicago"}], "orders": [ { "id":99, "orderItems":[ { "productId":27, "price": 32.45, "productName": "NoSQL Distilled" } ], "shippingAddress":[{"city":"Chicago"}] "orderPayment":[ { "ccinfo":"1000-1000-1000-1000", "txnId":"abelif879rft", "billingAddress": {"city": "Chicago"} } ], } ] }}

Tuesday, June 11, 13

Page 22: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Aggregate model (Referencing Objects)

Tuesday, June 11, 13

Page 23: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Aggregate data

// in Customers{ "id":1, "name":"Martin", "billingAddress":[{"city":"Chicago"}]}// in Orders{ "id":99, "customerId":1, "orderItems":[ { "productId":27, "price": 32.45, "productName": "NoSQL Distilled" } ], "shippingAddress":[{"city":"Chicago"}] "orderPayment":[ { "ccinfo":"1000-1000-1000-1000", "txnId":"abelif879rft", "billingAddress": {"city": "Chicago"} } ],}

Tuesday, June 11, 13

Page 24: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Aggregate Orientation

Tuesday, June 11, 13

Page 25: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

RDBMS’s have no concept of aggregates

Tuesday, June 11, 13

Page 26: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Aggregates reduce the need for ACID

Tuesday, June 11, 13

Page 27: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Better for clusters, can be distributed easily

Tuesday, June 11, 13

Page 28: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Key-ValueDocument

Column-Family

Tuesday, June 11, 13

Page 29: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Key Value Databases

Tuesday, June 11, 13

Page 30: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Key-ValueDatabase

•One Key-One Value•Value is opaque to database•Like a Hash•Some are distributed

Oracle Riak

instance cluster

table bucket

row key-value

row-id key

Tuesday, June 11, 13

Page 31: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

“key” (VIN) “value” (car facts)

JTTDR… …

make#Ford model#Mustang

year#2011 ….

Tuesday, June 11, 13

Page 32: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Document Databases

Tuesday, June 11, 13

Page 33: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Document Database

•One Key-One Value•Value is visible to database•Value can be queries•JSON/XML documents

Oracle MongoDB

instance mongod

schema database

table collection

row document

row_id _id

Tuesday, June 11, 13

Page 34: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

“id” (VIN) “document” (car facts)

JTTDR…

{… “make”: “Ford”, “model”: “Mustang”, “year”: 2011, … }

Tuesday, June 11, 13

Page 35: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Column-Family Databases

Tuesday, June 11, 13

Page 36: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Column-Family Database

•Data organized as columns•Each row has row key•Columns have versioned data

•Row data is sorted by column name

Oracle Cassandra

instance cluster

database keyspace

table column-family

row rowcolumns same for

every row

columns can be different for each row

Tuesday, June 11, 13

Page 37: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

“id” (VIN) “column families”(car facts)

JTTDR…

{… “car”:{“make”: “Ford”, “model”: “focus”…} “service”:{…} }

Tuesday, June 11, 13

Page 38: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Key-Points Aggregate Databases

Tuesday, June 11, 13

Page 39: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Inter-aggregate relations are hard to maintain

Tuesday, June 11, 13

Page 40: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Schema-less means implicit schema

Tuesday, June 11, 13

Page 41: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Graph Databases

Tuesday, June 11, 13

Page 42: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Tuesday, June 11, 13

Page 43: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Graph Databases

•Is multi-relational graph•Relationships are first-class citizens

•Traversal algorithms•Nodes and Edges can have data (key-value pairs)

Tuesday, June 11, 13

Page 44: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Graph databases work best for data with complex

relations

Tuesday, June 11, 13

Page 45: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Key-Value Database Usage

Tuesday, June 11, 13

Page 46: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Session Storage

Tuesday, June 11, 13

Page 47: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

User Profiles/Preferences

Tuesday, June 11, 13

Page 48: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Shopping Cart

Tuesday, June 11, 13

Page 49: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Single user analytics

Tuesday, June 11, 13

Page 50: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Document Database Usage

Tuesday, June 11, 13

Page 51: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Event Logging

Tuesday, June 11, 13

Page 52: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Prototype development

Tuesday, June 11, 13

Page 53: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

eCommerce Application

Tuesday, June 11, 13

Page 54: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Content Management Applications

Tuesday, June 11, 13

Page 55: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Column-Family Database Usage

Tuesday, June 11, 13

Page 56: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Large write volume

Tuesday, June 11, 13

Page 57: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Content Management

Tuesday, June 11, 13

Page 58: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

eCommerce Application

Tuesday, June 11, 13

Page 59: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Graph Database Usage

Tuesday, June 11, 13

Page 60: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Connected Data

Tuesday, June 11, 13

Page 61: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Routing things/money

Tuesday, June 11, 13

Page 62: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Location Services

Tuesday, June 11, 13

Page 63: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Recommendation engines

Tuesday, June 11, 13

Page 64: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Schema-less really?

Tuesday, June 11, 13

Page 65: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Schema-free does not mean no schema-migration

Tuesday, June 11, 13

Page 66: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Schema is implicit in code

Tuesday, June 11, 13

Page 67: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Data must be migrated, when schema in code is

changed

Tuesday, June 11, 13

Page 68: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

All data need not be migrated at the same time

(lazy migration)

Tuesday, June 11, 13

Page 69: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Polyglot Persistence

Tuesday, June 11, 13

Page 70: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Use different data storage technology for varying

needs

Tuesday, June 11, 13

Page 71: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Can be across the enterprise or in single

application

Tuesday, June 11, 13

Page 72: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Encapsulate data access through services

Tuesday, June 11, 13

Page 73: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Order persistence service

Document store

e-commerce platform

Session/Cart storage service

Key-Value store

Inventory and Price service

RDBMS(Legacy DB)

Nodes and Relations service

Graph store

Shopping cart and session data

Completed Orders

Inventoryand

Item Price Customer social graph

Tuesday, June 11, 13

Page 74: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

RDBMS

e-commerce platform

Shopping cart data

Completed Orders

Session dataSOLR

Searchrequests

Update Indexed Data

Update indexed data, batch or realtime

Tuesday, June 11, 13

Page 75: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

martinfowler.com/bliki/PolyglotPersistence.html

Session Storage

Financial Data

Shopping Cart

Recommendationengine

Product Catalog

Reporting Analytics User Activity Logs

Speculative Retail Web Application

Redis RDBMS Riak Neo4J

MongoDB RDBMS Cassandra Cassandra

Tuesday, June 11, 13

Page 76: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Experience

Tuesday, June 11, 13

Page 77: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

e-learning (before)

Tuesday, June 11, 13

Page 78: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

e-learning (after)

Tuesday, June 11, 13

Page 79: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

e-commerce (before)

Tuesday, June 11, 13

Page 80: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

e-commerce (after)

Tuesday, June 11, 13

Page 81: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

How do I choose?

Tuesday, June 11, 13

Page 82: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Choose for programmer productivity

Tuesday, June 11, 13

Page 83: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Choose for data access performance

Tuesday, June 11, 13

Page 84: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Choose to stick with the default

Tuesday, June 11, 13

Page 85: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Choose by testing your expectations

Tuesday, June 11, 13

Page 86: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Try the databases, they are all open-source

Tuesday, June 11, 13

Page 87: NoSQL Distilled - GOTO Conference - GOTO Blognosqlroadshow.com/dl/NoSQL-sanfran-2013/NoSQLPolyglot... · NoSQL Distilled A guide to polyglot persistence #NoSQLDistilled @pramodsadalage

Thanks#NoSQLDistilled

@pramodsadalagesadalage.com

Tuesday, June 11, 13