SlideShare a Scribd company logo
www.arangodb.com 
Polyglot Persistence 
& 
Multi-Model Databases 
London Java Community 
28-10-2014 
Michael Hackstein 
@mchacki
Michael Hackstein 
‣ ArangoDB Core Team 
‣ Web Frontend 
‣ Graph visualisation 
‣ Graph features 
! 
! 
‣ Host of cologne.js 
! 
! 
‣ Master’s Degree 
(spec. Databases and 
Information Systems) 
2
The Single Model era is over 
3 
Relational World
The Multi Model era begins 
‣ Normally based on key-value stores (each document still 
4 
NoSQL World 
Documents - JSON 
{ 
“type": "sweater", 
“color": "blue", 
“size": “M”, 
“material”: “wool”, 
“form”: “turtleneck" 
} 
{ 
“type“: "pants", 
“waist": 32, 
“length”: 34, 
“color": "blue", 
“material”: “cotton" 
} 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
has a unique key) 
‣ Allow to save documents with logical similarity in 
“collections” 
‣ Treat data records as attribute-structured documents 
(data is no more opaque) 
‣ Often allow querying and indexing document attributes 
‣ Focussed on m-to-n relations between entities 
‣ Stores property graphs: entities and edges can have 
‣ Easily query paths of variable length 
K => V 
K => V 
K => V 
K => V 
{ 
“type": "sweater", 
“color": "blue", 
“size": “M”, 
“material”: “wool”, 
“form”: “turtleneck" 
} 
attributes 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
K => V 
Graphs 
Key Value 
{ 
“type“: "television", 
“diagonal screen size": 46, 
“hdmi inputs": 3, 
“wall mountable": true, 
“built-in digital tuner": true, 
“dynamic contrast ratio”: “50,000:1”, 
Resolution”: “1920x1080” 
} 
‣ Map value data to unique string keys (identifiers) 
‣ Treat data as opaque (data has no schema) 
‣ Can implement scaling and partitioning easily
An e-commerce system in Relational World 
5 
Sales-History 
Shopping-Cart 
Recommendations Customer 
Product-Catalog
Polyglot Persistence 
6 
Shopping Cart 
Product Catalog 
MongoDB 
Reporting 
RDBMS 
Financial Data 
RDBMS 
Recommendations 
Neo4J 
Analytics 
Cassandra 
Product Catalog 
Document 
Source: Martin Fowler, http://martinfowler.com/articles/nosql-intro.pdf 
Riak 
User activity log 
Cassandra 
User Sessions 
Redis 
Shopping Cart 
KeyValue 
Reporting 
RDBMS 
Financial Data 
RDBMS 
Recommendations 
Graph 
Analytics 
Column 
User activity log 
Column 
User Sessions 
KeyValue
Single Model Databases 
7 
Sales-History Recommendations 
Customer 
{ 
“userID": 239178239, 
“productID”: 128623883, 
“number": 5, 
“price”: 12.20, 
} 
DocumentStore GraphStore DocumentStore 
{ 
“userID": 239178239, 
“productID”: 128623883, 
“number": 5, 
“price”: 12.20, 
} 
{ 
“Name": "Smith", 
“lastLogin”: “2012-11-01", 
“Visits": 121, 
“shipping address”: “abc”, 
“shipping address”: “def” 
} 
{ 
“Name": "Meyer", 
“lastLogin”: “2012-11-21", 
“Visits": 20, 
“shipping address”: “xyz”, 
} 
{ 
“type": "sweater", 
“color": "blue", 
“size": “M”, 
“material”: “wool”, 
“form”: “turtleneck" 
} 
{ 
“type": "sweater", 
“color": "blue", 
“size": “M”, 
“material”: “wool”, 
“form”: “turtleneck" 
} 
Shopping-Cart Product-Catalog 
423453453 
4328, “shirt”, “L”, 1, 12.99 
6378, “sweater”, “M”, 2, 37.95 
3245, “sweater”, “blue”, 1, 99.95 
3245, “pants”, “32/34”, “black”, 1, 99.95 
=> 
874365563 
5463, “shirt”, “S”, 1, 9.99 
6378, “sweater”, “M”, 2, 37.95 
3245, “pants”, “32/34”, “black”, 1, 99.95 
=> 
{ 
“type“: "pants", 
“waist": 32, 
“length”: 34, 
“color": "blue", 
“material”: “cotton" 
} 
{ 
“type“: "television", 
“diagonal screen size": 46, 
“hdmi inputs": 3, 
“wall mountable": true, 
“built-in digital tuner": true, 
“dynamic contrast ratio”: “50,000:1”, 
Resolution”: “1920x1080” 
} 
KeyValueStore DocumentStore
Benefits 
‣ Natural mapping of data 
into DB 
‣ DB optimized for the data 
format 
‣ Queries are tailored for 
your data format 
‣ Focus on writing business 
logic 
8 
& Overhead 
‣Data has to be stored 
redundantly and has to be 
kept in sync 
‣Several technologies 
involved 
‣Administration effort is 
huge
Solution: Multi Model Database 
‣ Can natively store several kinds of data models: 
‣ Key-value pairs 
‣ Documents 
‣ Graphs 
‣ Delivers query mechanisms for all data models 
9
Polyglot Persistence Revisited 
Financial Data 
ArangoDB 
Recommendations 
ArangoDB 
10 
User Sessions 
KeyValue 
Shopping Cart 
KeyValue 
Product Catalog 
Document 
Reporting 
RDBMS 
Financial Data 
RDBMS 
Recommendations 
Graph 
Analytics 
Column 
User activity log 
Column 
Shopping Cart 
ArangoDB 
Product Catalog 
ArangoDB 
Reporting 
RDBMS 
Source: Martin Fowler, http://martinfowler.com/articles/nosql-intro.pdf 
Analytics 
Cassandra 
User activity log 
Cassandra 
User Sessions 
ArangoDB
Use Case: Multi-Model-Databases 
11 
Sales-History Recommendations 
Customer 
{ 
“userID": 239178239, 
“productID”: 128623883, 
“number": 5, 
“price”: 12.20, 
} 
DocumentStore GraphStore DocumentStore 
{ 
“userID": 239178239, 
“productID”: 128623883, 
“number": 5, 
“price”: 12.20, 
} 
{ 
“Name": "Smith", 
“lastLogin”: “2012-11-01", 
“Visits": 121, 
“shipping address”: “abc”, 
“shipping address”: “def” 
} 
{ 
“Name": "Meyer", 
“lastLogin”: “2012-11-21", 
“Visits": 20, 
“shipping address”: “xyz”, 
} 
{ 
“type": "sweater", 
“color": "blue", 
“size": “M”, 
“material”: “wool”, 
“form”: “turtleneck" 
} 
{ 
“type": "sweater", 
“color": "blue", 
“size": “M”, 
“material”: “wool”, 
“form”: “turtleneck" 
} 
Shopping-Cart Product-Catalog 
423453453 
4328, “shirt”, “L”, 1, 12.99 
6378, “sweater”, “M”, 2, 37.95 
3245, “sweater”, “blue”, 1, 99.95 
3245, “pants”, “32/34”, “black”, 1, 99.95 
=> 
874365563 
5463, “shirt”, “S”, 1, 9.99 
6378, “sweater”, “M”, 2, 37.95 
3245, “pants”, “32/34”, “black”, 1, 99.95 
=> 
{ 
“type“: "pants", 
“waist": 32, 
“length”: 34, 
“color": "blue", 
“material”: “cotton" 
} 
{ 
“type“: "television", 
“diagonal screen size": 46, 
“hdmi inputs": 3, 
“wall mountable": true, 
“built-in digital tuner": true, 
“dynamic contrast ratio”: “50,000:1”, 
Resolution”: “1920x1080” 
} 
KeyValueStore DocumentStore
My four favorite features of 
‣ AQL offering joins & traversals 
‣ ACID including Multi Collection Transactions 
‣ MULTI-MODEL stores graphs and documents 
12 
‣ FOXX extend the API and adapt it to your needs
AQL 
‣Document Query: 
FOR user IN users FILTER user.active == true 
FOR game IN games FILTER game.player == user._id 
RETURN { 
username: user.name, 
score: game.score 
} 
‣ Modify Documents: 
FOR u IN users FILTER u.status == 'not active' 
UPDATE u WITH { active: false } IN users 
! 
‣ Graph Traversal: 
RETURN GRAPH_TRAVERSAL( 
"underground_plan", „stations/main_station", 
"outbound", {minDepth: 2, maxDepth: 5} 
) 
13
ACID - Transactions 
‣ Invoke a transaction: 
db._executeTransaction({ 
collections: { 
write: ["users", "products"], 
read: "recommendations" 
}, 
action: function() { 
// all operations go here 
! 
} 
}); 
14 
throw "failure"; // Triggers rollback
Benefits & Overhead 
‣ Native mapping of data into 
DB 
‣ DB optimized 
‣ Queries are tailored for 
your data format 
‣ Focus on writing business 
logic 
15 
‣Data has to be stored 
redundantly and has to be 
kept in sync 
‣Several technologies 
‣Administration effort is 
‣One technology involved
Foxx 
‣ Add your own customized and versioned REST-API on top of 
ArangoDB in JavaScript 
‣ Include as a web service in Rails, Node.js etc. 
‣ Use as storage for Web-frameworks like AngularJS, EmberJS, Backbone etc. 
‣ Built-in authentication using OAuth2.0 or HTTP-Basic Auth 
‣ Operations are encapsulated in the database 
‣ low network traffic, direct data access 
‣ increases data privacy 
➡Multi-device setups 
➡Microservices 
/ 
(~( 
) ) /_/ 
( _-----_(@ @) 
(  / 
/|/--| V 
" " " " 
16
‣ open source and free (Apache 2 license) 
‣ sharding & replication 
‣ JavaScript throughout (V8 built into server) 
‣ drivers for a wide range of languages 
‣ web frontend 
‣ good & complete documentation 
‣ professional as well as community support 
17 
An overview of other features
Join our growing community 
18 
.. working on the geo index, the full text search and 
many APIs: Ruby, Python, PHP, Java, D, Javascript, ...
Thank you 
! 
! 
! 
‣ Further questions? 
‣ Follow me on twitter/github: @mchacki 
‣ Write me a mail: mchacki@arangodb.com 
‣ Join or google group: https://groups.google.com/forum/#!forum/arangodb 
19

More Related Content

PDF
Multi model-databases
PDF
01 nosql and multi model database
PDF
Multi-model databases and node.js
PDF
FOXX - a Javascript application framework on top of ArangoDB
PDF
Processing large-scale graphs with Google Pregel
PDF
Michael Hackstein - Polyglot Persistence & Multi-Model NoSQL Databases - NoSQ...
PDF
Webinar: How native multi model works in ArangoDB
PDF
Extensible Database APIs and their role in Software Architecture
Multi model-databases
01 nosql and multi model database
Multi-model databases and node.js
FOXX - a Javascript application framework on top of ArangoDB
Processing large-scale graphs with Google Pregel
Michael Hackstein - Polyglot Persistence & Multi-Model NoSQL Databases - NoSQ...
Webinar: How native multi model works in ArangoDB
Extensible Database APIs and their role in Software Architecture

What's hot (20)

PPTX
Web Browser Controls in Adlib: The Hidden Diamond in the Adlib Treasure Chest
PDF
CenitHub: Introduction
PDF
An E-commerce App in action built on top of a Multi-model Database
PDF
Query Languages for Document Stores
PPTX
CData Data Today: A Developer's Dilemma
PPTX
DocumentDB - NoSQL on Cloud at Reboot2015
PDF
Analyze and visualize non-relational data with DocumentDB + Power BI
PPTX
Hands-On: Managing Slowly Changing Dimensions Using TD Workflow
PPTX
Jumpstart: MongoDB BI Connector & Tableau
PDF
MongoDB .local London 2019: MongoDB Atlas Data Lake Technical Deep Dive
PDF
Data persistence using pouchdb and couchdb
PPTX
Azure DocumentDB for Healthcare Integration
PDF
MongoDB .local Paris 2020: Devenez explorateur de données avec MongoDB Charts
PDF
Backbone using Extensible Database APIs over HTTP
PDF
MongoDB .local Chicago 2019: MongoDB Atlas Data Lake Technical Deep Dive
DOCX
SharePoint Content Database Sizing-BLOB-Crawl
PPTX
MongoDB .local Munich 2019: Telediagnosis@Daimler powered by MongoDB
PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PPTX
MongoDB and Azure Databricks
PPTX
C* Summit 2013: Optimizing the Public Cloud for Cost and Scalability with Cas...
Web Browser Controls in Adlib: The Hidden Diamond in the Adlib Treasure Chest
CenitHub: Introduction
An E-commerce App in action built on top of a Multi-model Database
Query Languages for Document Stores
CData Data Today: A Developer's Dilemma
DocumentDB - NoSQL on Cloud at Reboot2015
Analyze and visualize non-relational data with DocumentDB + Power BI
Hands-On: Managing Slowly Changing Dimensions Using TD Workflow
Jumpstart: MongoDB BI Connector & Tableau
MongoDB .local London 2019: MongoDB Atlas Data Lake Technical Deep Dive
Data persistence using pouchdb and couchdb
Azure DocumentDB for Healthcare Integration
MongoDB .local Paris 2020: Devenez explorateur de données avec MongoDB Charts
Backbone using Extensible Database APIs over HTTP
MongoDB .local Chicago 2019: MongoDB Atlas Data Lake Technical Deep Dive
SharePoint Content Database Sizing-BLOB-Crawl
MongoDB .local Munich 2019: Telediagnosis@Daimler powered by MongoDB
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB and Azure Databricks
C* Summit 2013: Optimizing the Public Cloud for Cost and Scalability with Cas...
Ad

Viewers also liked (13)

PDF
Wir sind aber nicht Twitter
PDF
PDF
Domain Driven Design and NoSQL TLV
PDF
CAP and the Architectural Consequences by martin Schönert
PDF
Polyglot Persistence & Multi Model-Databases at JMaghreb3.0
PDF
NoSQL meets Microservices
PDF
Creating Fault Tolerant Services on Mesos
PDF
Row or Columnar Database
PDF
Introduction to column oriented databases
PDF
Query mechanisms for NoSQL databases
PDF
Domain Driven Design und Nosql
PDF
Einführung in nosql // ArangoDB mit Symfony 2
PDF
SlideShare 101
Wir sind aber nicht Twitter
Domain Driven Design and NoSQL TLV
CAP and the Architectural Consequences by martin Schönert
Polyglot Persistence & Multi Model-Databases at JMaghreb3.0
NoSQL meets Microservices
Creating Fault Tolerant Services on Mesos
Row or Columnar Database
Introduction to column oriented databases
Query mechanisms for NoSQL databases
Domain Driven Design und Nosql
Einführung in nosql // ArangoDB mit Symfony 2
SlideShare 101
Ad

Similar to Multi model-databases 29-10-2014 LJC (20)

PDF
Polyglot Persistence & Multi-Model Databases (FullStack Toronto)
PDF
OSDC 2015: Ingo Friepoertner | Polyglot Persistence & Multi-Model NoSQL Datab...
PDF
Polyglot Persistence & Multi-Model Databases
PPTX
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
PPTX
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
PDF
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
PDF
NoSQL meets Microservices - Michael Hackstein
PDF
MongoDB World 2019: Building an Efficient and Performant Data Model: Real Wor...
PPTX
[MongoDB.local Bengaluru 2018] Keynote
PDF
MongoDB Meetup
PDF
IE9에서 HTML5 개발하기
PDF
Strongly Typed Languages and Flexible Schemas
PPTX
You know what iMEAN? Using MEAN stack for application dev on Informix
PPTX
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
PPTX
Webinar: Strongly Typed Languages and Flexible Schemas
PPTX
Windows8 lightningtalk
PPTX
Introduction To R
PPTX
MVP Cloud OS Week: 9 Sept, Track 1 Data Liberty
PPTX
MVP Cloud OS Week Track 1 9 Sept: Data liberty
PPTX
Building your First MEAN App
Polyglot Persistence & Multi-Model Databases (FullStack Toronto)
OSDC 2015: Ingo Friepoertner | Polyglot Persistence & Multi-Model NoSQL Datab...
Polyglot Persistence & Multi-Model Databases
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
NoSQL meets Microservices - Michael Hackstein
MongoDB World 2019: Building an Efficient and Performant Data Model: Real Wor...
[MongoDB.local Bengaluru 2018] Keynote
MongoDB Meetup
IE9에서 HTML5 개발하기
Strongly Typed Languages and Flexible Schemas
You know what iMEAN? Using MEAN stack for application dev on Informix
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Webinar: Strongly Typed Languages and Flexible Schemas
Windows8 lightningtalk
Introduction To R
MVP Cloud OS Week: 9 Sept, Track 1 Data Liberty
MVP Cloud OS Week Track 1 9 Sept: Data liberty
Building your First MEAN App

More from ArangoDB Database (20)

PPTX
ATO 2022 - Machine Learning + Graph Databases for Better Recommendations (3)....
PPTX
Machine Learning + Graph Databases for Better Recommendations V2 08/20/2022
PPTX
Machine Learning + Graph Databases for Better Recommendations V1 08/06/2022
PPTX
ArangoDB 3.9 - Further Powering Graphs at Scale
PDF
GraphSage vs Pinsage #InsideArangoDB
PDF
Webinar: ArangoDB 3.8 Preview - Analytics at Scale
PDF
Graph Analytics with ArangoDB
PDF
Getting Started with ArangoDB Oasis
PDF
Custom Pregel Algorithms in ArangoDB
PPTX
Hacktoberfest 2020 - Intro to Knowledge Graphs
PDF
A Graph Database That Scales - ArangoDB 3.7 Release Webinar
PDF
gVisor, Kata Containers, Firecracker, Docker: Who is Who in the Container Space?
PDF
ArangoML Pipeline Cloud - Managed Machine Learning Metadata
PDF
ArangoDB 3.7 Roadmap: Performance at Scale
PDF
Webinar: What to expect from ArangoDB Oasis
PDF
ArangoDB 3.5 Feature Overview Webinar - Sept 12, 2019
PDF
3.5 webinar
PDF
An introduction to multi-model databases
PDF
Running complex data queries in a distributed system
PDF
Guacamole Fiesta: What do avocados and databases have in common?
ATO 2022 - Machine Learning + Graph Databases for Better Recommendations (3)....
Machine Learning + Graph Databases for Better Recommendations V2 08/20/2022
Machine Learning + Graph Databases for Better Recommendations V1 08/06/2022
ArangoDB 3.9 - Further Powering Graphs at Scale
GraphSage vs Pinsage #InsideArangoDB
Webinar: ArangoDB 3.8 Preview - Analytics at Scale
Graph Analytics with ArangoDB
Getting Started with ArangoDB Oasis
Custom Pregel Algorithms in ArangoDB
Hacktoberfest 2020 - Intro to Knowledge Graphs
A Graph Database That Scales - ArangoDB 3.7 Release Webinar
gVisor, Kata Containers, Firecracker, Docker: Who is Who in the Container Space?
ArangoML Pipeline Cloud - Managed Machine Learning Metadata
ArangoDB 3.7 Roadmap: Performance at Scale
Webinar: What to expect from ArangoDB Oasis
ArangoDB 3.5 Feature Overview Webinar - Sept 12, 2019
3.5 webinar
An introduction to multi-model databases
Running complex data queries in a distributed system
Guacamole Fiesta: What do avocados and databases have in common?

Recently uploaded (20)

PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
IB Computer Science - Internal Assessment.pptx
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PDF
Business Analytics and business intelligence.pdf
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPT
Quality review (1)_presentation of this 21
PPTX
Business Acumen Training GuidePresentation.pptx
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPT
ISS -ESG Data flows What is ESG and HowHow
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
Supervised vs unsupervised machine learning algorithms
IBA_Chapter_11_Slides_Final_Accessible.pptx
climate analysis of Dhaka ,Banglades.pptx
IB Computer Science - Internal Assessment.pptx
Fluorescence-microscope_Botany_detailed content
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Acceptance and paychological effects of mandatory extra coach I classes.pptx
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Business Analytics and business intelligence.pdf
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Quality review (1)_presentation of this 21
Business Acumen Training GuidePresentation.pptx
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
ISS -ESG Data flows What is ESG and HowHow
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
STUDY DESIGN details- Lt Col Maksud (21).pptx

Multi model-databases 29-10-2014 LJC

  • 1. www.arangodb.com Polyglot Persistence & Multi-Model Databases London Java Community 28-10-2014 Michael Hackstein @mchacki
  • 2. Michael Hackstein ‣ ArangoDB Core Team ‣ Web Frontend ‣ Graph visualisation ‣ Graph features ! ! ‣ Host of cologne.js ! ! ‣ Master’s Degree (spec. Databases and Information Systems) 2
  • 3. The Single Model era is over 3 Relational World
  • 4. The Multi Model era begins ‣ Normally based on key-value stores (each document still 4 NoSQL World Documents - JSON { “type": "sweater", “color": "blue", “size": “M”, “material”: “wool”, “form”: “turtleneck" } { “type“: "pants", “waist": 32, “length”: 34, “color": "blue", “material”: “cotton" } K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V has a unique key) ‣ Allow to save documents with logical similarity in “collections” ‣ Treat data records as attribute-structured documents (data is no more opaque) ‣ Often allow querying and indexing document attributes ‣ Focussed on m-to-n relations between entities ‣ Stores property graphs: entities and edges can have ‣ Easily query paths of variable length K => V K => V K => V K => V { “type": "sweater", “color": "blue", “size": “M”, “material”: “wool”, “form”: “turtleneck" } attributes K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V K => V Graphs Key Value { “type“: "television", “diagonal screen size": 46, “hdmi inputs": 3, “wall mountable": true, “built-in digital tuner": true, “dynamic contrast ratio”: “50,000:1”, Resolution”: “1920x1080” } ‣ Map value data to unique string keys (identifiers) ‣ Treat data as opaque (data has no schema) ‣ Can implement scaling and partitioning easily
  • 5. An e-commerce system in Relational World 5 Sales-History Shopping-Cart Recommendations Customer Product-Catalog
  • 6. Polyglot Persistence 6 Shopping Cart Product Catalog MongoDB Reporting RDBMS Financial Data RDBMS Recommendations Neo4J Analytics Cassandra Product Catalog Document Source: Martin Fowler, http://martinfowler.com/articles/nosql-intro.pdf Riak User activity log Cassandra User Sessions Redis Shopping Cart KeyValue Reporting RDBMS Financial Data RDBMS Recommendations Graph Analytics Column User activity log Column User Sessions KeyValue
  • 7. Single Model Databases 7 Sales-History Recommendations Customer { “userID": 239178239, “productID”: 128623883, “number": 5, “price”: 12.20, } DocumentStore GraphStore DocumentStore { “userID": 239178239, “productID”: 128623883, “number": 5, “price”: 12.20, } { “Name": "Smith", “lastLogin”: “2012-11-01", “Visits": 121, “shipping address”: “abc”, “shipping address”: “def” } { “Name": "Meyer", “lastLogin”: “2012-11-21", “Visits": 20, “shipping address”: “xyz”, } { “type": "sweater", “color": "blue", “size": “M”, “material”: “wool”, “form”: “turtleneck" } { “type": "sweater", “color": "blue", “size": “M”, “material”: “wool”, “form”: “turtleneck" } Shopping-Cart Product-Catalog 423453453 4328, “shirt”, “L”, 1, 12.99 6378, “sweater”, “M”, 2, 37.95 3245, “sweater”, “blue”, 1, 99.95 3245, “pants”, “32/34”, “black”, 1, 99.95 => 874365563 5463, “shirt”, “S”, 1, 9.99 6378, “sweater”, “M”, 2, 37.95 3245, “pants”, “32/34”, “black”, 1, 99.95 => { “type“: "pants", “waist": 32, “length”: 34, “color": "blue", “material”: “cotton" } { “type“: "television", “diagonal screen size": 46, “hdmi inputs": 3, “wall mountable": true, “built-in digital tuner": true, “dynamic contrast ratio”: “50,000:1”, Resolution”: “1920x1080” } KeyValueStore DocumentStore
  • 8. Benefits ‣ Natural mapping of data into DB ‣ DB optimized for the data format ‣ Queries are tailored for your data format ‣ Focus on writing business logic 8 & Overhead ‣Data has to be stored redundantly and has to be kept in sync ‣Several technologies involved ‣Administration effort is huge
  • 9. Solution: Multi Model Database ‣ Can natively store several kinds of data models: ‣ Key-value pairs ‣ Documents ‣ Graphs ‣ Delivers query mechanisms for all data models 9
  • 10. Polyglot Persistence Revisited Financial Data ArangoDB Recommendations ArangoDB 10 User Sessions KeyValue Shopping Cart KeyValue Product Catalog Document Reporting RDBMS Financial Data RDBMS Recommendations Graph Analytics Column User activity log Column Shopping Cart ArangoDB Product Catalog ArangoDB Reporting RDBMS Source: Martin Fowler, http://martinfowler.com/articles/nosql-intro.pdf Analytics Cassandra User activity log Cassandra User Sessions ArangoDB
  • 11. Use Case: Multi-Model-Databases 11 Sales-History Recommendations Customer { “userID": 239178239, “productID”: 128623883, “number": 5, “price”: 12.20, } DocumentStore GraphStore DocumentStore { “userID": 239178239, “productID”: 128623883, “number": 5, “price”: 12.20, } { “Name": "Smith", “lastLogin”: “2012-11-01", “Visits": 121, “shipping address”: “abc”, “shipping address”: “def” } { “Name": "Meyer", “lastLogin”: “2012-11-21", “Visits": 20, “shipping address”: “xyz”, } { “type": "sweater", “color": "blue", “size": “M”, “material”: “wool”, “form”: “turtleneck" } { “type": "sweater", “color": "blue", “size": “M”, “material”: “wool”, “form”: “turtleneck" } Shopping-Cart Product-Catalog 423453453 4328, “shirt”, “L”, 1, 12.99 6378, “sweater”, “M”, 2, 37.95 3245, “sweater”, “blue”, 1, 99.95 3245, “pants”, “32/34”, “black”, 1, 99.95 => 874365563 5463, “shirt”, “S”, 1, 9.99 6378, “sweater”, “M”, 2, 37.95 3245, “pants”, “32/34”, “black”, 1, 99.95 => { “type“: "pants", “waist": 32, “length”: 34, “color": "blue", “material”: “cotton" } { “type“: "television", “diagonal screen size": 46, “hdmi inputs": 3, “wall mountable": true, “built-in digital tuner": true, “dynamic contrast ratio”: “50,000:1”, Resolution”: “1920x1080” } KeyValueStore DocumentStore
  • 12. My four favorite features of ‣ AQL offering joins & traversals ‣ ACID including Multi Collection Transactions ‣ MULTI-MODEL stores graphs and documents 12 ‣ FOXX extend the API and adapt it to your needs
  • 13. AQL ‣Document Query: FOR user IN users FILTER user.active == true FOR game IN games FILTER game.player == user._id RETURN { username: user.name, score: game.score } ‣ Modify Documents: FOR u IN users FILTER u.status == 'not active' UPDATE u WITH { active: false } IN users ! ‣ Graph Traversal: RETURN GRAPH_TRAVERSAL( "underground_plan", „stations/main_station", "outbound", {minDepth: 2, maxDepth: 5} ) 13
  • 14. ACID - Transactions ‣ Invoke a transaction: db._executeTransaction({ collections: { write: ["users", "products"], read: "recommendations" }, action: function() { // all operations go here ! } }); 14 throw "failure"; // Triggers rollback
  • 15. Benefits & Overhead ‣ Native mapping of data into DB ‣ DB optimized ‣ Queries are tailored for your data format ‣ Focus on writing business logic 15 ‣Data has to be stored redundantly and has to be kept in sync ‣Several technologies ‣Administration effort is ‣One technology involved
  • 16. Foxx ‣ Add your own customized and versioned REST-API on top of ArangoDB in JavaScript ‣ Include as a web service in Rails, Node.js etc. ‣ Use as storage for Web-frameworks like AngularJS, EmberJS, Backbone etc. ‣ Built-in authentication using OAuth2.0 or HTTP-Basic Auth ‣ Operations are encapsulated in the database ‣ low network traffic, direct data access ‣ increases data privacy ➡Multi-device setups ➡Microservices / (~( ) ) /_/ ( _-----_(@ @) ( / /|/--| V " " " " 16
  • 17. ‣ open source and free (Apache 2 license) ‣ sharding & replication ‣ JavaScript throughout (V8 built into server) ‣ drivers for a wide range of languages ‣ web frontend ‣ good & complete documentation ‣ professional as well as community support 17 An overview of other features
  • 18. Join our growing community 18 .. working on the geo index, the full text search and many APIs: Ruby, Python, PHP, Java, D, Javascript, ...
  • 19. Thank you ! ! ! ‣ Further questions? ‣ Follow me on twitter/github: @mchacki ‣ Write me a mail: mchacki@arangodb.com ‣ Join or google group: https://groups.google.com/forum/#!forum/arangodb 19