In last years NoSQL experienced a huge upward trend, offering new data models to solve problems where old RDBMS failed. Now people who have chosen NoSQL as an architecture component, realize that a single data model (even when richer that relational), is not enough for average needs. We will discuss why graph databases are at the heart of the multi-model revolution and why we're approaching the end of NoSQL's fragmented ecosystem where customers are forced to use multiple tools in their architectures. Benefits and compromises of this approach along with real world use cases will also be shared.
Automating Google Workspace (GWS) & more with Apps Script
OrientDB - the 2nd generation of (MultiModel) NoSQL - Luigi Dell Aquila - Codemotion Amsterdam 2016
1. - 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
11. #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
13. #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 34 tables could
generate billions of
combinations
14. #OrientDB
This is why the database
query performance
suffers as the database
increases in size
O(Log N)
20. #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
1N and NM Relationships
22. #OrientDB
How does a true*
Graph Database
manage relationships?
*a “Graph” layer on top of a DBMS doesn’t qualify as a true GraphDB
23. #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
27. #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
28. #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
29. #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
30. #OrientDB
So the Graph Model
Is the only solution to efficiently
manage relationships
But what about data complexity?
And data consistency?
And scaling?
36. #OrientDB
What’s a MultiModel DBMS?What’s a MultiModel 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
37. Confidential
Polyglot vs Multimodel
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/Multimodel_databasehttp://www.jamesserra.com/archive/2015/07/whatispolyglotpersistence/
ECOMMERCE
PRODUCT CATALOG
SHOPPING
CART
RECOMMENDATI
ON
ECOMMERCE
PRODUCT CATALOG
SHOPPING
CART
RECOMMENDATI
ON
TRANSACTIONA
L TRANSACTIONA
L
SEARCH
SEARCH
SPATIAL
SPATIAL
38. #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
42. #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
43. #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
44. #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
45. #OrientDB - @ldellaquila
• Full Backup and Restore
• Delta Backup (v2.2) Enterprise Edition and Restore is available
• Studio web tool
• Command line Console
Administration
46. #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
47. #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