Intoduction to OrientDB
Click here to load reader
-
Upload
abdelmawla-talema -
Category
Technology
-
view
431 -
download
16
Transcript of Intoduction to OrientDB
Abdelmawla Mohamed (Abdo)Senior Developer
2nd generation of Multi-Model NoSQL
Page / Copyright ©2014 by Readify Limited2
Relational database› Data is presented to the user in the form of rows and columns (a relation)
› Data can be manipulated through relational operators in a tabular form
Page / Copyright ©2014 by Readify Limited3
Over Time› Data start grown in size› Data become heterogonous › Structured, semi-structured, unstructured
Page / Copyright ©2014 by Readify Limited4
Big Data
Page / Copyright ©2014 by Readify Limited5
Relational database lowIf the only tool you have is a relational database,
everything looks like a table.
Page / Copyright ©2014 by Readify Limited6
One tool doesn’t fit all› Scalability issues› Scale out
› Index intensive issues› Join data
Page / Copyright ©2014 by Readify Limited7
Issues with joins› the relationships are computed every time a query is performed
› time complexity grows with data: O(log n)› heavy runtime cost with large datasets› Index lookup does not help, it could speeds up searches but slows down inserts, updates, deletes. Imagine on billions of records.
Page / Copyright ©2014 by Readify Limited8
NoSQL movement› Not only SQL› Simplicity of design (through different data models)
› Being non-relational› Simpler horizontal scaling› Distributed
Page / Copyright ©2014 by Readify Limited9
NoSQL Models› Document
› MongoDB, CouchDB, ….› Key-value
› Cassandra, Redis, …› Column
› Hbase, Cassandra, ..› Graph
› Neo4j, ..
Page / Copyright ©2014 by Readify Limited10
But, all of them are one model
Page / Copyright ©2014 by Readify Limited11
NoSQL one model limitations› Document model: no relationships, no schema validation
› Graph model: no complex data, no schema
› key-value model: faster, but-key based access only
› no transactions
Page / Copyright ©2014 by Readify Limited12
So What ?
Page / Copyright ©2014 by Readify Limited13
Multi-model database
Key-value
Graph Object-oriented
Document
Page / Copyright ©2014 by Readify Limited14
Page / Copyright ©2014 by Readify Limited15
Why OrientDB› Native document store (schema-free, complex
properties)› Native graph store (index-free adjacent, fast
relationships traversal)› Object oriented concepts (classes,
inheritance, polymorphism)› ACID Transactions (no lock applied but at commit time,
the MVCC applied)› Rest / JSON interface› Distributed (multi-master replication / sharding)› SQL (extended)
Page / Copyright ©2014 by Readify Limited16
OrientDB data model
Page / Copyright ©2014 by Readify Limited17
Graph G = (V, E)Graph Vertices Edges
Graph
Edge
Vertex
Page / Copyright ©2014 by Readify Limited18
Graphdrives
name: Abdo
Vertices can have
properties
Vertices are directed
AudiAbdo
license: A134
model: Q7doors: 5Edges can
have properties
Page
Abdo Lyon
Visitedon: 2015
An Edge connects only 2 vertices
Use multiple edges to represent 1-N and N-M relationships
Workedon: 2015
1-N and N-M RelationshipsGraph
Page / Copyright ©2014 by Readify Limited20
Basic Concepts› Class› Used to represent type of data model
› Cluster› Stores group of records within a class
Class Car
Cluster USA_Car
Cluster Germany_Ca
r
Page / Copyright ©2014 by Readify Limited21
Vertices› Record Identifier (RID)› Each vertex has a unique self-assigned identifier (RID)
› Format: #:<cluster-id>:<cluster-position>› List of properties› Edge’s RID (in & out)
Page / Copyright ©2014 by Readify Limited22
Edges› Record identifier (RID)› Each record has it’s own self-assigned unique ID
› Composed of 2 parts#:<cluster-id>:<cluster-position>
› in (RID of the incoming vertex)› out (RID of the outgoing vertex)
Page / Copyright ©2014 by Readify Limited23
Relationships› Doesn't make use of JOINS like RDBMS› Physical links O(1)› Relationship managed by storing the edge’s RID in both vertices as “out” and “in”
› For 1-to-n relationship collections of rid are used
Page / Copyright ©2014 by Readify Limited24
Relationships
drives
out: [#14:10]name: Abdo
@class: Driver
#14:10
#13:20
out: [#13:20]in: [#15:20]
license: A134@class: Drives
#15:20
in: [#14:10]model: Q7doors: 5
name: BMW@class: Car
Page / Copyright ©2014 by Readify Limited25
Demo
Page / Copyright ©2014 by Readify Limited26
API Interfaces• 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
Page / Copyright ©2014 by Readify Limited27
Getting Started for FreeOrientDB Community Edition is FREE for any purpose (Apache 2 license)http://orientdb.com/docs
Udemy Getting Started Training is Free ★★★★★http://www.orientechnologies.com/getting-started
Page / Copyright ©2014 by Readify Limited28
?