ROME 11-12 april 2014 ROME 11-12 april 2014 OrientDB: a Document-Graph Database ready for the Cloud OrientDB Committer OrientDB Academy Coordinator at Orient Technologies LTD Project Manager at AssetData S.r.l. Email: l.dellaquila – at – orientechnologies.com Twitter: @ldellaquila Luigi Dell’Aquila
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
ROME 11-12 april 2014ROME 11-12 april 2014
OrientDB: a Document-Graph Database ready for the Cloud
OrientDB CommitterOrientDB Academy Coordinator at Orient Technologies LTDProject Manager at AssetData S.r.l.
Email: l.dellaquila – at – orientechnologies.comTwitter: @ldellaquila
Luigi Dell’Aquila
ROME 11-12 april 2014 - Luigi Dell’Aquila
Relational Databases:
Everybody knows what a TABLE is
Everybody knows SQL
ROME 11-12 april 2014 - Luigi Dell’Aquila
These are tables,Data ARE Tables!
ROME 11-12 april 2014 - Luigi Dell’Aquila
These are tables,Data ARE Tables!
ROME 11-12 april 2014 - Luigi Dell’Aquila
These are tables,Data ARE Tables!
ROME 11-12 april 2014 - Luigi Dell’Aquila
But this is not
ROME 11-12 april 2014 - Luigi Dell’Aquila
But this is not
ROME 11-12 april 2014 - Luigi Dell’Aquila
But this is not
ROME 11-12 april 2014 - Luigi Dell’Aquila
But this is not
ROME 11-12 april 2014 - Luigi Dell’Aquila
But this is not
ROME 11-12 april 2014 - Luigi Dell’Aquila
These are
GRAPHS!
ROME 11-12 april 2014 - Luigi Dell’Aquila
And sometimesRepresenting them in tables
Can be difficultAnd
Inefficient
ROME 11-12 april 2014 - Luigi Dell’Aquila
Think about it…
ROME 11-12 april 2014 - Luigi Dell’Aquila
When you write your codeYou have to deal with
Links, References, Pointers
ROME 11-12 april 2014 - Luigi Dell’Aquila
When you write your codeYou have to deal with
Collections and Maps(and dynamic data structures!)
ROME 11-12 april 2014 - Luigi Dell’Aquila
When you write your codeYou have to deal with
Nested and complex objects
ROME 11-12 april 2014 - Luigi Dell’Aquila
When you write your codeYou have to deal with
Class hierarchies,Inheritance, Polymorphism
ROME 11-12 april 2014 - Luigi Dell’Aquila
Would You LikeA Storage Layer
That Supports ALLThese Conceps Out Of The Box?
ROME 11-12 april 2014
This is why
Was born
- Luigi Dell’Aquila
ROME 11-12 april 2014 - Luigi Dell’Aquila
Two data models:
Graphand
Document
ROME 11-12 april 2014 - Luigi Dell’Aquila
Classes, not Tables
create class Person
create class Student extends Person
select from Person
Polymorphic query: returns both instances of Person and Student
ROME 11-12 april 2014 - Luigi Dell’Aquila
Dynamic schema
create class Person
insert into Person (name, surname) values (“Luigi”, “Dell’Aquila”)
No need to fully specify the class structure, you can work in schemaless mode
ROME 11-12 april 2014 - Luigi Dell’Aquila
Complex attributes
Update person set address = {
“street”: “5th Ave”, “city”: “NY”
}, tags = [“developer”, “artist”, “geek”]
Collections and embedded properties
ROME 11-12 april 2014 - Luigi Dell’Aquila
Physical links(no Join!)
Update person set address.city = (select from city where name = ‘Rome’)
where name = ‘Luigi’
Select address.city.country.name from Person where name = ‘Luigi’
Dot notation instead of JoinNo need for foreign keys O(1) computational cost – compared to O(log N) in relational Join
ROME 11-12 april 2014 - Luigi Dell’Aquila
The Graph API(TinkerPop Blueprints)
Traverse out(“Friend”) from (select from Person where name =
‘Luigi’)while address.city = ‘Rome’
Find my friends network in my city (friends, firends of frineds, friends of friends of friends…)
Deep traversal, no need to know in advance HOW deep
• Accessing linked data is very efficient• No calculation *• Independent from cluster size **• Deep traversal is allowed and encouraged ***
* In RDMS, a Join is calculated EVERY TIME you execute a query ** RDBS use index-based optimization to speed up joins, but index access is O(log N), so it depends on data size – what about Big Data??? *** in RDMS multiple joins are inefficient (would you dare to write a query with 1000 joins?)