SlideShare a Scribd company logo
JavaScript in the Database
Frank Celler & Lucas Dohmen
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
The NoSQL Movement
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
CAP
www.arangodb.org (c) f.celler@triagens.de
ACID
BASE
Samstag, 1. Juni 13
www.arangodb.org (c) f.celler@triagens.de
nosql.eventbrite.com
distributed structured
data storage
Samstag, 1. Juni 13
Your Entities
A Person has a
Name, first and last
one or more addresses, emails,
telephone
a list of hobbies, skills, tags
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
Relational World
www.arangodb.org (c) f.celler@triagens.de
PersonPersonPerson
AddressAddressAddress
HobbyHobbyHobby
emailemailemail
n-to-mn-to-mn-to-m
n-to-mn-to-mn-to-m
n-to-mn-to-mn-to-m
Samstag, 1. Juni 13
Use Aggregates
Do not Normalize
www.arangodb.org (c) f.celler@triagens.de
{ name: { first: „Frank“, last: „Celler“ },
address: { home: { street: „...“, city: „...“ } },
email: { work: „frank@celler.de“ },
hobbies: [ „C++“, „MRuby“, „JavaScript“ ] }
Samstag, 1. Juni 13
Document Databases
documents can be
as simple as key/value maps
or as complex as lists containing embedded
sub-documents
or anything in between
representated in JSON
Schema-less
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
www.arangodb.org (c) f.celler@triagens.de 9
Samstag, 1. Juni 13
www.arangodb.org (c) f.celler@triagens.de 10
Analytic Processing DBsTransaction Processing DBs
Managing the evolving state of an IT system
Map/Reduce
Graphs
Extensibility
Key/Value
Column-
Stores
Complex
Queries
Structured
Data
Massively
Distributed
Documents
Samstag, 1. Juni 13
Property Graphs
www.arangodb.org (c) f.celler@triagens.de
Type: inproceeding
Title: Finite Size Effects
Type: proceeding
Title: Neural Modeling
Type: person
Name: Anthony C. C. Coolen
Label: written
Label: published
Pages: 99-120
Type: person
Name: Snchez-Andrs
Label: edited
Just Documents
Samstag, 1. Juni 13
Multi-Model Databases
www.arangodb.org (c) f.celler@triagens.de
vertices and edges are documents
query them using geo-index, full-text,
SQL-like queries
relations are expressed as graphs
traverse them using graph algorithms
Samstag, 1. Juni 13
ArangoDB.explain()
www.arangodb.org (c) f.celler@triagens.de
{
"type": "NoSQL database",
"model": [ "document", "graph", "key-value" ],
"openSource": true,
"license“: "apache",
"version": 1.3,
"builtWith": [ "C", "C++", "js" ],
"Javascript": [ "client side", "server side" ],
"uses": [ "V8" ]
}
Samstag, 1. Juni 13
Why Use JavaScript?
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
JavaScript Everywhere
in the Browser
Application-Layer (Node.JS)
Database
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
Why is Node not enough?
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
JavaScript in a Database
MVC in the Browser and/or NODE.JS
Script-Language in the DB for
transactions as functions
graph traversal
no-backend, just API
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
db._create("accounts");
db.accounts.save({ _key: "john", amount: 423 });
db.accounts.save({ _key: "fred", amount: 197 });
db._executeTransaction({
collections: {
write: "accounts"
},
params: {
user1: "fred",
user2: "john",
amount: 10
},
action: function (params) {
var db = require("internal").db;
var account1 = db.accounts.document(params['user1']);
var account2 = db.accounts.document(params['user2']);
var amount = params['amount'];
if (account1.amount < amount) {
throw "account of user '" + user1 + "' does not have enough money!";
}
db.accounts.update(account1, { amount : account1.amount - amount });
db.accounts.update(account2, { amount : account2.amount + amount });
/* will commit the transaction and return the value true */
return true;
}
});
www.arangodb.org (c) f.celler@triagens.de
Transactions
Samstag, 1. Juni 13
db._executeTransaction({
collections: {
write: "accounts"
},
params: {
user1: "fred",
user2: "john",
amount: 10
},
action: function (params) {
var db = require("internal").db;
var account1 = db.accounts.document(params['user1']);
var account2 = db.accounts.document(params['user2']);
var amount = params['amount'];
if (account1.amount < amount) {
throw "account of user '" + user1 + "' does not have enough money!";
}
db.accounts.update(account1, { amount : account1.amount - amount });
db.accounts.update(account2, { amount : account2.amount + amount });
www.arangodb.org (c) f.celler@triagens.de
Transactions
Samstag, 1. Juni 13
function traverse (graph, start, depth, maxlen) {
var config = {
datasource: traversal.collectionDatasourceFactory(graph._edges),
strategy: Traverser.BREADTH_FIRST,
expander: traversal.anyExpander,
filter: traversal.maxDepthFilter,
maxDepth: depth,
uniqueness: { edges: Traverser.UNIQUE_GLOBAL, vertices: Traverser.UNIQUE_NONE },
visitor: coauthorVisitor(maxlen)
};
var traverser = new Traverser(config);
var result = { positions: {}, vertices: [], links: [], minYear: 0, maxYear: 0 };
var first = graph._vertices.firstExample({ name: start });
if (first !== null) {
traverser.traverse(result, first);
}
return {
start: start,
depth: depth,
minYear: result.minYear,
maxYear: result.maxYear,
vertices: result.vertices,
links: result.links };
}
www.arangodb.org (c) f.celler@triagens.de
Graph Traversal
Samstag, 1. Juni 13
function traverse (graph, start, depth, maxlen) {
var config = {
datasource: traversal.collectionDatasourceFactory(graph._edges),
strategy: Traverser.BREADTH_FIRST,
expander: traversal.anyExpander,
filter: traversal.maxDepthFilter,
maxDepth: depth,
uniqueness: { edges: Traverser.UNIQUE_GLOBAL,
vertices: Traverser.UNIQUE_NONE },
visitor: coauthorVisitor(maxlen)
};
www.arangodb.org (c) f.celler@triagens.de
Graph Traversal
Samstag, 1. Juni 13
No Back-End?
www.arangodb.org (c) f.celler@triagens.de
Samstag, 1. Juni 13
To Be Continued ... Now
Fork me on github
Google Group: ArangoDB
Twitter: @fceller & @arangodb
www.arangodb.org
www.arangodb.org (c) f.celler@triagens.de
Stay in Touch:
Samstag, 1. Juni 13

More Related Content

What's hot (20)

PDF
Hands on with Ruby & MongoDB
Wynn Netherland
 
PDF
FOXX - a Javascript application framework on top of ArangoDB
ArangoDB Database
 
PDF
iOS: Web Services and XML parsing
Jussi Pohjolainen
 
PPT
Introduction to couch_db
Romain Testard
 
PDF
Big Data Processing using Apache Spark and Clojure
Dr. Christian Betz
 
PDF
OrientDB: Unlock the Value of Document Data Relationships
Fabrizio Fortino
 
ODP
DrupalCon Chicago Practical MongoDB and Drupal
Doug Green
 
PPT
2011 Mongo FR - MongoDB introduction
antoinegirbal
 
PDF
OrientDB & Node.js Overview - JS.Everywhere() KW
gmccarvell
 
PPTX
MongoDB
Bembeng Arifin
 
PDF
RDF APIs for .NET Framework
Adriana Ivanciu
 
PDF
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...
DECK36
 
PDF
DataFrame: Spark's new abstraction for data science by Reynold Xin of Databricks
Data Con LA
 
PPT
Mapreduce in Search
Amund Tveit
 
PPTX
OrientDB the graph database
Artem Orobets
 
PPT
Introduction to MongoDB
Nosh Petigara
 
PPT
2011 mongo FR - scaling with mongodb
antoinegirbal
 
PPTX
RDFa Tutorial
Ivan Herman
 
PDF
Small Overview of Skype Database Tools
elliando dias
 
PDF
Brief Intro to Apache Spark @ Stanford ICME
Paco Nathan
 
Hands on with Ruby & MongoDB
Wynn Netherland
 
FOXX - a Javascript application framework on top of ArangoDB
ArangoDB Database
 
iOS: Web Services and XML parsing
Jussi Pohjolainen
 
Introduction to couch_db
Romain Testard
 
Big Data Processing using Apache Spark and Clojure
Dr. Christian Betz
 
OrientDB: Unlock the Value of Document Data Relationships
Fabrizio Fortino
 
DrupalCon Chicago Practical MongoDB and Drupal
Doug Green
 
2011 Mongo FR - MongoDB introduction
antoinegirbal
 
OrientDB & Node.js Overview - JS.Everywhere() KW
gmccarvell
 
RDF APIs for .NET Framework
Adriana Ivanciu
 
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...
DECK36
 
DataFrame: Spark's new abstraction for data science by Reynold Xin of Databricks
Data Con LA
 
Mapreduce in Search
Amund Tveit
 
OrientDB the graph database
Artem Orobets
 
Introduction to MongoDB
Nosh Petigara
 
2011 mongo FR - scaling with mongodb
antoinegirbal
 
RDFa Tutorial
Ivan Herman
 
Small Overview of Skype Database Tools
elliando dias
 
Brief Intro to Apache Spark @ Stanford ICME
Paco Nathan
 

Viewers also liked (20)

PDF
Multi-model databases and node.js
Max Neunhöffer
 
PDF
GraphDatabases and what we can use them for
Michael Hackstein
 
PDF
Backbone using Extensible Database APIs over HTTP
Max Neunhöffer
 
PDF
Complex queries in a distributed multi-model database
Max Neunhöffer
 
PDF
Hotcode 2013: Javascript in a database (Part 2)
ArangoDB Database
 
PDF
Extensible Database APIs and their role in Software Architecture
Max Neunhöffer
 
PDF
Domain Driven Design & NoSQL
ArangoDB Database
 
PDF
Domain Driven Design & NoSQL
ArangoDB Database
 
PDF
ArangoDB – Persistência Poliglota e Banco de Dados Multi-Modelos
Helder Santana
 
PDF
Jan Steemann: Modelling data in a schema free world (Talk held at Froscon, 2...
ArangoDB Database
 
PDF
Multi model-databases
ArangoDB Database
 
PDF
Is multi-model the future of NoSQL?
Max Neunhöffer
 
PDF
Processing large-scale graphs with Google(TM) Pregel by MICHAEL HACKSTEIN at...
Big Data Spain
 
PDF
Overhauling a database engine in 2 months
Max Neunhöffer
 
PDF
guacamole: an Object Document Mapper for ArangoDB
Max Neunhöffer
 
PDF
Domain driven design @FrOSCon
ArangoDB Database
 
PDF
Processing large-scale graphs with Google Pregel
Max Neunhöffer
 
PDF
Wir sind aber nicht Twitter
ArangoDB Database
 
PDF
Domain Driven Design and NoSQL TLV
ArangoDB Database
 
PDF
Introduction to ArangoDB (nosql matters Barcelona 2012)
ArangoDB Database
 
Multi-model databases and node.js
Max Neunhöffer
 
GraphDatabases and what we can use them for
Michael Hackstein
 
Backbone using Extensible Database APIs over HTTP
Max Neunhöffer
 
Complex queries in a distributed multi-model database
Max Neunhöffer
 
Hotcode 2013: Javascript in a database (Part 2)
ArangoDB Database
 
Extensible Database APIs and their role in Software Architecture
Max Neunhöffer
 
Domain Driven Design & NoSQL
ArangoDB Database
 
Domain Driven Design & NoSQL
ArangoDB Database
 
ArangoDB – Persistência Poliglota e Banco de Dados Multi-Modelos
Helder Santana
 
Jan Steemann: Modelling data in a schema free world (Talk held at Froscon, 2...
ArangoDB Database
 
Multi model-databases
ArangoDB Database
 
Is multi-model the future of NoSQL?
Max Neunhöffer
 
Processing large-scale graphs with Google(TM) Pregel by MICHAEL HACKSTEIN at...
Big Data Spain
 
Overhauling a database engine in 2 months
Max Neunhöffer
 
guacamole: an Object Document Mapper for ArangoDB
Max Neunhöffer
 
Domain driven design @FrOSCon
ArangoDB Database
 
Processing large-scale graphs with Google Pregel
Max Neunhöffer
 
Wir sind aber nicht Twitter
ArangoDB Database
 
Domain Driven Design and NoSQL TLV
ArangoDB Database
 
Introduction to ArangoDB (nosql matters Barcelona 2012)
ArangoDB Database
 
Ad

Similar to Hotcode 2013: Javascript in a database (Part 1) (20)

PDF
Multi model-databases
Michael Hackstein
 
PDF
Oslo bekk2014
Max Neunhöffer
 
PDF
NoSQL overview #phptostart turin 11.07.2011
David Funaro
 
PDF
Data Modeling with Neo4j
Neo4j
 
PDF
[ModernWeb2018] Graph Database應用思考模式
Freddy Fan
 
PDF
Fishing Graphs in a Hadoop Data Lake
ArangoDB Database
 
PDF
Polyglot Persistence & Multi Model-Databases at JMaghreb3.0
ArangoDB Database
 
PDF
Analysis of Fraud Detection Of ArangoDB Oasis
Ashish Kumar
 
PDF
Max Neunhöffer – Joins and aggregations in a distributed NoSQL DB - NoSQL mat...
NoSQLmatters
 
PDF
Multi model-databases 29-10-2014 LJC
ArangoDB Database
 
PDF
Polyglot Persistence & Multi-Model Databases (FullStack Toronto)
ArangoDB Database
 
PDF
Graph Databases and Web Frameworks (NodeJS, AngularJS, GridFS, OpenLink Virtu...
João Rocha da Silva
 
PDF
Oslo baksia2014
Max Neunhöffer
 
PPTX
Conceptos básicos. Seminario web 1: Introducción a NoSQL
MongoDB
 
PPTX
20181215 introduction to graph databases
Timothy Findlay
 
PDF
ArangoDB – A different approach to NoSQL
ArangoDB Database
 
ODP
Graph databases
Karol Grzegorczyk
 
PPTX
Introduction to Graph Databases
Max De Marzi
 
ZIP
The InfoGrid Graph DataBase
InfoGrid.org
 
PDF
Fishing Graphs in a Hadoop Data Lake
DataWorks Summit/Hadoop Summit
 
Multi model-databases
Michael Hackstein
 
Oslo bekk2014
Max Neunhöffer
 
NoSQL overview #phptostart turin 11.07.2011
David Funaro
 
Data Modeling with Neo4j
Neo4j
 
[ModernWeb2018] Graph Database應用思考模式
Freddy Fan
 
Fishing Graphs in a Hadoop Data Lake
ArangoDB Database
 
Polyglot Persistence & Multi Model-Databases at JMaghreb3.0
ArangoDB Database
 
Analysis of Fraud Detection Of ArangoDB Oasis
Ashish Kumar
 
Max Neunhöffer – Joins and aggregations in a distributed NoSQL DB - NoSQL mat...
NoSQLmatters
 
Multi model-databases 29-10-2014 LJC
ArangoDB Database
 
Polyglot Persistence & Multi-Model Databases (FullStack Toronto)
ArangoDB Database
 
Graph Databases and Web Frameworks (NodeJS, AngularJS, GridFS, OpenLink Virtu...
João Rocha da Silva
 
Oslo baksia2014
Max Neunhöffer
 
Conceptos básicos. Seminario web 1: Introducción a NoSQL
MongoDB
 
20181215 introduction to graph databases
Timothy Findlay
 
ArangoDB – A different approach to NoSQL
ArangoDB Database
 
Graph databases
Karol Grzegorczyk
 
Introduction to Graph Databases
Max De Marzi
 
The InfoGrid Graph DataBase
InfoGrid.org
 
Fishing Graphs in a Hadoop Data Lake
DataWorks Summit/Hadoop Summit
 
Ad

More from ArangoDB Database (20)

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

Recently uploaded (20)

PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 

Hotcode 2013: Javascript in a database (Part 1)

  • 1. JavaScript in the Database Frank Celler & Lucas Dohmen www.arangodb.org (c) [email protected] Samstag, 1. Juni 13
  • 5. Your Entities A Person has a Name, first and last one or more addresses, emails, telephone a list of hobbies, skills, tags www.arangodb.org (c) [email protected] Samstag, 1. Juni 13
  • 6. Relational World www.arangodb.org (c) [email protected] PersonPersonPerson AddressAddressAddress HobbyHobbyHobby emailemailemail n-to-mn-to-mn-to-m n-to-mn-to-mn-to-m n-to-mn-to-mn-to-m Samstag, 1. Juni 13
  • 7. Use Aggregates Do not Normalize www.arangodb.org (c) [email protected] { name: { first: „Frank“, last: „Celler“ }, address: { home: { street: „...“, city: „...“ } }, email: { work: „[email protected]“ }, hobbies: [ „C++“, „MRuby“, „JavaScript“ ] } Samstag, 1. Juni 13
  • 8. Document Databases documents can be as simple as key/value maps or as complex as lists containing embedded sub-documents or anything in between representated in JSON Schema-less www.arangodb.org (c) [email protected] Samstag, 1. Juni 13
  • 10. www.arangodb.org (c) [email protected] 10 Analytic Processing DBsTransaction Processing DBs Managing the evolving state of an IT system Map/Reduce Graphs Extensibility Key/Value Column- Stores Complex Queries Structured Data Massively Distributed Documents Samstag, 1. Juni 13
  • 11. Property Graphs www.arangodb.org (c) [email protected] Type: inproceeding Title: Finite Size Effects Type: proceeding Title: Neural Modeling Type: person Name: Anthony C. C. Coolen Label: written Label: published Pages: 99-120 Type: person Name: Snchez-Andrs Label: edited Just Documents Samstag, 1. Juni 13
  • 12. Multi-Model Databases www.arangodb.org (c) [email protected] vertices and edges are documents query them using geo-index, full-text, SQL-like queries relations are expressed as graphs traverse them using graph algorithms Samstag, 1. Juni 13
  • 13. ArangoDB.explain() www.arangodb.org (c) [email protected] { "type": "NoSQL database", "model": [ "document", "graph", "key-value" ], "openSource": true, "license“: "apache", "version": 1.3, "builtWith": [ "C", "C++", "js" ], "Javascript": [ "client side", "server side" ], "uses": [ "V8" ] } Samstag, 1. Juni 13
  • 15. JavaScript Everywhere in the Browser Application-Layer (Node.JS) Database www.arangodb.org (c) [email protected] Samstag, 1. Juni 13
  • 16. Why is Node not enough? www.arangodb.org (c) [email protected] Samstag, 1. Juni 13
  • 17. JavaScript in a Database MVC in the Browser and/or NODE.JS Script-Language in the DB for transactions as functions graph traversal no-backend, just API www.arangodb.org (c) [email protected] Samstag, 1. Juni 13
  • 18. db._create("accounts"); db.accounts.save({ _key: "john", amount: 423 }); db.accounts.save({ _key: "fred", amount: 197 }); db._executeTransaction({ collections: { write: "accounts" }, params: { user1: "fred", user2: "john", amount: 10 }, action: function (params) { var db = require("internal").db; var account1 = db.accounts.document(params['user1']); var account2 = db.accounts.document(params['user2']); var amount = params['amount']; if (account1.amount < amount) { throw "account of user '" + user1 + "' does not have enough money!"; } db.accounts.update(account1, { amount : account1.amount - amount }); db.accounts.update(account2, { amount : account2.amount + amount }); /* will commit the transaction and return the value true */ return true; } }); www.arangodb.org (c) [email protected] Transactions Samstag, 1. Juni 13
  • 19. db._executeTransaction({ collections: { write: "accounts" }, params: { user1: "fred", user2: "john", amount: 10 }, action: function (params) { var db = require("internal").db; var account1 = db.accounts.document(params['user1']); var account2 = db.accounts.document(params['user2']); var amount = params['amount']; if (account1.amount < amount) { throw "account of user '" + user1 + "' does not have enough money!"; } db.accounts.update(account1, { amount : account1.amount - amount }); db.accounts.update(account2, { amount : account2.amount + amount }); www.arangodb.org (c) [email protected] Transactions Samstag, 1. Juni 13
  • 20. function traverse (graph, start, depth, maxlen) { var config = { datasource: traversal.collectionDatasourceFactory(graph._edges), strategy: Traverser.BREADTH_FIRST, expander: traversal.anyExpander, filter: traversal.maxDepthFilter, maxDepth: depth, uniqueness: { edges: Traverser.UNIQUE_GLOBAL, vertices: Traverser.UNIQUE_NONE }, visitor: coauthorVisitor(maxlen) }; var traverser = new Traverser(config); var result = { positions: {}, vertices: [], links: [], minYear: 0, maxYear: 0 }; var first = graph._vertices.firstExample({ name: start }); if (first !== null) { traverser.traverse(result, first); } return { start: start, depth: depth, minYear: result.minYear, maxYear: result.maxYear, vertices: result.vertices, links: result.links }; } www.arangodb.org (c) [email protected] Graph Traversal Samstag, 1. Juni 13
  • 21. function traverse (graph, start, depth, maxlen) { var config = { datasource: traversal.collectionDatasourceFactory(graph._edges), strategy: Traverser.BREADTH_FIRST, expander: traversal.anyExpander, filter: traversal.maxDepthFilter, maxDepth: depth, uniqueness: { edges: Traverser.UNIQUE_GLOBAL, vertices: Traverser.UNIQUE_NONE }, visitor: coauthorVisitor(maxlen) }; www.arangodb.org (c) [email protected] Graph Traversal Samstag, 1. Juni 13
  • 23. To Be Continued ... Now Fork me on github Google Group: ArangoDB Twitter: @fceller & @arangodb www.arangodb.org www.arangodb.org (c) [email protected] Stay in Touch: Samstag, 1. Juni 13