- the 2nd generation
of
(Multi-Model) NoSQL
- the 2nd generation
of
(Multi-Model) NoSQL
And why GraphDB are the And why GraphDB are the 
starting point of this revolutionstarting point of this revolution
#OrientDB
Andrea Iacono
Software Engineer
OrientDB
http://www.orientdb.com
#OrientDB
How many of you have already used NoSQL technology?
How many of you are familiar with Graph Databases?
How many of you are already familiar with OrientDB?
Before We Start…
#OrientDB
“90% of the data 
in the world today 
has been created 
in the last two years alone.” 
­ IBM
#OrientDB
Order
#134
(Order)
Order
#134
(Order) John
(Provider)
John
(Provider)
CBM
Amiga 500
(Product)
CBM
Amiga 500
(Product)
Frank
(Customer)
Frank
(Customer)
Monitor
40”
(Product)
Monitor
40”
(Product)
Mouse
(Product)
Mouse
(Product)
Bruno
(Provider)
Bruno
(Provider)
#OrientDB
Order
#134
(Order)
Order
#134
(Order) John
(Provider)
John
(Provider)
CBM
Amiga 500
(Product)
CBM
Amiga 500
(Product)
Frank
(Customer)
Frank
(Customer)
Monitor
40”
(Product)
Monitor
40”
(Product)
Mouse
(Product)
Mouse
(Product)
Bruno
(Provider)
Bruno
(Provider)
Data by itself has little value, it’s the relationship
between data that gives it
incredible value
#OrientDB
CBM
Amiga 500
(Product)
CBM
Amiga 500
(Product)
(Sells)
Frank
(Customer)
Frank
(Customer)
(Has)
(Makes)
Monitor
40”
(Product)
Monitor
40”
(Product)
(Sells)(Has)
Mouse
(Product)
Mouse
(Product)
(Sells)
(Has)
Order
#134
(Order)
Order
#134
(Order) John
(Provider)
John
(Provider)
Bruno
(Provider)
Bruno
(Provider)
#OrientDB
Key/Value Databases
Document Databases
Graph Databases
Column Databases
#OrientDB
Key/Value Databases
Document Databases Graph Databases
Column Databases
#OrientDB
Why do most NoSQL products
avoid
managing relationships?
#OrientDB
ID Name
10 John
11 John
24 Mike
28 Mike
CustomerID CityID
10 24
10 33
32 44
ID City
24 Milan
33 London
18 Paris
18 Madrid
44 Moscow
Customers CustomersCities Cities
#OrientDB
What’s wrong
with JOIN?
#OrientDB
ID Name
10 John
11 John
24 Mike
28 Mike
CustomerID CityID
10 24
10 33
32 44
ID City
24 Milan
33 London
18 Paris
18 Madrid
44 Moscow
Customers CustomersCities CitiesJoins are executed every time
you cross relationships
Querying million of records 
joining 3­4 tables could 
generate billions of 
combinations
#OrientDB
This is why the database
query performance
suffers as the database
increases in size
O(Log N)
#OrientDB
RDBMS performance on traversal
#OrientDB
Solution: Graph Database!
#OrientDB
Graph Theory crash course
#OrientDB
Basic Graph
Andrea Rome
#OrientDB
Vertices are
directed
* https://github.com/tinkerpop/blueprints/wiki/Property-Graph-Model
Property Graph Model*
Rome
country: Italy
Andrea
company: OrientDB
Vertices and Edges
can have properties
Visited
year: 2016
#OrientDB
Andrea Rome
Visited
year: 2012
An Edge connects only 2 vertices
Use multiple edges to represent 1-N
and N-M relationships
Worked
year: 2016
1­N and N­M Relationships
#OrientDB
Congrats! This is your diploma in
«Graph Theory»
#OrientDB
How does a true*
Graph Database
manage relationships?
*a “Graph” layer on top of a DBMS doesn’t qualify as a true GraphDB
#OrientDB
Andrea
RomeRome
Visited
year: 2012
#13:55
#15:99
Each element in the
Graph has own
immutable Record
ID
Each element in the
Graph has own
immutable Record
ID
#22:11
(Edge)
(Vertex)
(Vertex)
Each element in the
Graph has own
immutable Record
ID
Each element in the
Graph has own
immutable Record
ID
Each element in the
Graph has own
immutable
Record ID
Each element in the
Graph has own
immutable
Record ID
#OrientDB
Connections
use persistent
pointers
Connections
use persistent
pointers
Andrea
RomeRome
Visited
on: 2012#13:55
#15:99
out = #22:11
in = #22:11
#22:11
(Edge)
(Vertex)
(Vertex)
src = #13:55 dst = #15:99
#OrientDB
Andrea
RomeRome
Visited
on: 2012#13:55
#15:99
out = #22:11
in = #22:11
#22:11
(Edge)
(Vertex)
(Vertex)
src = #13:55 dst = #15:99
#OrientDB
Andrea
RomeRome
Visited
on: 2012#13:55
#15:99
out = #22:11
in = #22:11
#22:11
(Edge)
(Vertex)
(Vertex)
src = #13:55 dst = #15:99
#OrientDB
A Graph Database creates the
relationship just once
(when the edge is created)
VS
RDBMS computes the
relationship every time
you query a database
#OrientDB
When you move from a RDBMS
to a Graph Database you jump
from a O(log N) speed to a near O(1)
With a Graph Database, the
traversing time is
not affected by database size!
This is huge in the BigData age
#OrientDB
No costs to traverse relationships:
• Recommendation engines
• Social Applications
• Spatial Apps
• Master Data Management
• Information Clustering
John
Thriller
Comedy
Pulp
Fiction
Mr Bean
Theater
B
Theater
A
Theater
C
NYC
San Josè
Lives in
Likes
Likes
Has
Has
Is
Is
Plays
Has
Plays
#OrientDB
So the Graph Model
Is the only solution to efficiently
manage relationships
But what about data complexity?
And data consistency?
And scaling?
#OrientDB
Relationships Complexity >
Data Complexity >
Relational
Key Value
Column
Graph
Document
First Generation NoSQLFirst Generation NoSQL
#OrientDB
First Generation NoSQL: Polyglot PersistenceFirst Generation NoSQL: Polyglot Persistence
RDBMSRDBMS
Key/Value StoreKey/Value Store
Document
Database
Document
Database
Graph
Database
Graph
Database
ApplicationApplication
ETL
            
#OrientDB
Key/Value StoreKey/Value Store
Document
Database
Document
Database
Graph
Database
Graph
Database
ApplicationApplication
ETL
            
First Generation NoSQL: Polyglot PersistenceFirst Generation NoSQL: Polyglot Persistence
- No standard between NoSQL Products
- Multiple vendors = multiple skills
- ETL + synchronization code is
expensive to write and maintain
- Performance and Reliability is
hard to predict
RDBMSRDBMS
#OrientDB
2nd Generation NoSQL
is
Multi-Model
2nd Generation NoSQL
is
Multi-model
#OrientDB
What’s a Multi­Model DBMS?What’s a Multi­Model DBMS?
GraphDocument
Object
Key/Valu
e
Multi-Model represents the
intersection
of multiple models in just one
product
Full-Text
Spatial
#OrientDB
What’s a Multi­Model DBMS?What’s a Multi­Model DBMS?
GraphDocument
Object
Key/Valu
e
Full-Text
Spatial
- Just one product to learn and maintain
- Just one vendor relationship to manage
- No ETL, no synchronization required
- Performance and Reliability is easy to test from the beginning
- Just one product to learn and maintain
- Just one vendor relationship to manage
- No ETL, no synchronization required
- Performance and Reliability is easy to test from the beginning
Multi-Model represents the
intersection
of multiple models in just one
product
Confidential
Polyglot vs Multi­model
Polyglot (NoSQL 1.0) Multimodel (NoSQL 2.0)
Polyglot Persistence is a fancy term to mean
that when storing data, it is best to use
multiple data storage technologies, chosen
based upon the way data is being used by
individual applications or components
Multi-model databases are intended to offer
the data modeling advantages of polyglot
persistence without its disadvantages.
complexity, in particular, is reduced. The
first multi-model database was OrientDB.
https://en.wikipedia.org/wiki/Multi­model_databasehttp://www.jamesserra.com/archive/2015/07/what­is­polyglot­persistence/
ECOMMERCE
PRODUCT CATALOG
SHOPPING
CART
RECOMMENDATI
ON
ECOMMERCE
PRODUCT CATALOG
SHOPPING
CART
RECOMMENDATI
ON
TRANSACTIONA
L TRANSACTIONA
L
SEARCH
SEARCH
SPATIAL
SPATIAL
#OrientDB
`
{
”@rid": “12:382”,
”@class": ”Customer",
“name”: “Frank”,
“surname” : “Raggio”,
“phone” : “+39 33123212”,
“details”: {
“city”:”London",
“tags”:”millennial”
}
}
Frank
Order
M
akes
General purpose solution:
• JSON
• Schema-less
• Schema-full
• Schema-hybrid
• Nested documents
• Rich indexing and querying
• Developer friendly
#OrientDB - @ldellaquila
Second Generation NoSQL
RelationshipComplexity>
Data Complexity >
Relational
Key Value
Column
Graph
Document
Multi-Model
#OrientDB
With a true Graph, Document and Object Oriented engine
#OrientDB
•Support for TinkerPop standard for 
Graph DB: Gremlin language and 
Blueprints API
•SQL + extensions for graphs
•JDBC driver to connect any BI tool
•HTTP/JSON support
•Drivers in Java, Node.js, Python, 
PHP, .NET, Perl, C/C++ and more
API & Standards
#OrientDB - @ldellaquila
• OrientDB footprint is minimal and the embedded version can run with
few MB of RAM
• OrientDB needs a Java Run Time
• When run distributed, OrientDB uses Hazelcast (Apache2 licensed)
library embedded
Requirements and Dependencies
#OrientDB - @ldellaquila
• Basic HTTP authentication (+HTTPS/SSL)
• User/Role authentication system. One User can
have multiple Roles
• Privileges are managed in Roles
• Roles can inherit from other Roles
• Record-level security: every record can contain
the user/role can create/read/update/delete the
record
• Auditing available in Enterprise Edition
Security
#OrientDB - @ldellaquila
• HTTPS/SSL
• Starting from OrientDB v2.2:
- Support for Kerberos
- Encryption at REST using AES and DES of the
entire database or portions
- PBKDF2 HASH algorithm with a 24-bit length
Salt per user for a configurable number of
iterations
Encryption
#OrientDB - @ldellaquila
• Full Backup and Restore
• Delta Backup (v2.2) Enterprise Edition and Restore is available
• Studio web tool
• Command line Console
Administration
#OrientDB - @ldellaquila
• Import/Export in JSON
• Import from SQL script
• OrientDB ETL tool (http://orientdb.com/docs/last/ETL-Introduction.html)
• Teleporter (v2.2)
Data Extraction and Loading
#OrientDB - @ldellaquila
• Multi-Master architecture
• Tunable consistency through the usage of a
quorum, per database or single class (table)
• Synchronous and Asynchronous replication
• Zero config: if multicast is enabled the server is
attached to the cluster
Scale out and HA
#OrientDB
Master
Node
Master
Node
Master
Node
Master
Node
CC
CC CC CC
CCCC
CC
Multi-master
Replication
Atomic, Consistent, Isolated and Durable (ACID) multi­statement transactions
#OrientDB
Master
Node
Master
Node
Master
Node
Master
Node
CC
CC CC CC
CCCC
CC
Auto-
Discovered
Node
Auto-
Discovered
Node
#OrientDB
ArchitecturesArchitectures
#OrientDB
Udemy Getting Started Training is 
★★★★★ and Free
http://www.orientechnologies.com/getting­started
OrientDB Enterprise is Free for 
Development
OrientDB Community is FREE for any 
purpose (APACHE 2 license)
#OrientDB
DEMO
#OrientDB
Thank you!
Q/A

OrientDB - the 2nd generation of (MultiModel) NoSQL - Luigi Dell Aquila - Codemotion Amsterdam 2016