SlideShare une entreprise Scribd logo
1  sur  54
1.0
May
2012

       www.orientechnologies.com
Artem Orobets
                    Senior Java Developer
                    in ExigenServices
                    1.5 year in Java

                    OrientDB committer

Andrey Lomakin
Software Architect
in ExigenServices
6+ years JEE experience

OrientDB committer
OrientDB
           =
 best features of newest NoSQL
            solutions
                +
best features of Relational DBMS
                +
       True Graph engine
                            www.orientechnologies.com
Relationships
              are direct links
no Relational JOINS to connect multiple tables
    Load trees and graphs in few ms!



                                       www.orientechnologies.com
Complex types
native support for collections, maps
               (key/value)
      and embedded documents
no more additional tables to handle them


                                   www.orientechnologies.com
Schema-mixed
schema with mandatory and optional fields + constraints
    the best of schema-less and schema-full modes




                                             www.orientechnologies.com
ACID Transactions
db.begin();

try{
  // your code
  ...
  db.commit();

} catch( Exception e ) {
  db.rollback();
}
                           www.orientechnologies.com
SQL
select * from employee where name like '%Jay%' and status=0




                                                www.orientechnologies.com
SELECT SUM(price) as prices, SUM(cost) as costs, prices-costs, margin/price
  FROM Balance

                                          VS
function (key, values) {
   var price = 0.0, cost = 0.0, margin = 0.0, marginPercent = 0.0;
   for (var i = 0; i < values.length; i++) {
      price += values[i].price;
      cost += values[i].cost;
   }
   margin = price - cost;
   marginPercent = margin / price;
   return {
      price:        price,
      cost:         cost,
      margin:        margin,
      marginPercent: marginPercent
   };
}
                                                                     www.orientechnologies.com
SQL & relationships
select from Account where address.city.country.name = 'Italy'

select from Account where addresses contains (city.country.name = 'Italy')




                                                                www.orientechnologies.com
SQL & schema-
           less
select from Profile where any() like '%Jay%'

select from Stock where all() is not null




                                               www.orientechnologies.com
HTTP
      RESTful
      firewall friendly
use it from the webbrowser
  use it from the ESB (SOA)
                          www.orientechnologies.com
Native
{
        JSON
    '@rid' = '26:10',
    '@class' = 'Developer',
    'name' : 'Luca',
    'surname' : 'Garulli',
    'out' : [ #10:33, #10:232 ]
}
                                  www.orientechnologies.com
Binary protocol
     available for Java
 and soon C, C++ and Ruby


                       www.orientechnologies.com
MVRB-Tree index
  the best of B+Tree and RB-Tree
fast on browsing, low insertion cost



                              www.orientechnologies.com
Hooks
              similar to   triggers
catch events against records, database and transactions
  implement custom cascade deletion algorithm
            enforce constraints


                                              www.orientechnologies.com
Security
users and roles, encrypted
         passwords
   fine grain privileges

                        www.orientechnologies.com
Multi-Master architecture
any node can read/write to the database
        this scale up horizontly
    adding nodes is straightforward
The actors
Leader Node   Only 1 per Leader per cluster, checks other nodes and
              notify changes to other Peer Nodes.

              Any server node in the cluster. Has a permanent
 Peer Node    connection to the Leader Node
              Clients are connected to Server Nodes no matter if Leader
   Client
              or Peer


  Database    Database, where data are stored


              Synchronous mode replication.


              Asynchronous mode replication.
Cluster auto-discovering
At start up each Server Node sends a IP Multicast message in broadcast to
       discover if any Leader Node is available to join the cluster.




                               Server #1
                                  (Leader)       DB DB
                                                DB DB
                                               DB DB




             Server #2
                 (Peer)


                  DB DB
                 DB DB
                DB DB
One Leader Multiple Peers
The first node to start is always the Leader but in case of failure can be elected
                                     any other.


                               Server #1
                                  (Leader)       DB DB
                                                DBDB
                                               DB DB




             Server #2                          Server #3
                 (Peer)                             (Peer)


                 DB DB
                DBDB
               DB DB                               DB DB
                                                  DBDB
                                                    DB
Security
To join a cluster the Server Node has to configure the cluster name and
                                password
         Broadcast messages are encrypted using the password

                           Server #1
                             (Leader)




         Server #2                             Join the cluster
             (Peer)                                 ONLY
                                            If knows the name
             DB DB
            DB DB
           DB DB                               and password
Multiple clusters
         Multiple separate clusters can coexist in the same network
            Clusters can't see each others. Are separated boxes
                 What identify a cluster is name + password
Cluster 'A', password
'aaa'

             Server #1              Cluster 'B', password
                (Leader)            'bbb'

                    Server #2                    Server #1
                         (Peer)                     (Leader)
      Server #3
          (Peer)                                        Server #2
                                                            (Peer)
                                          Server #3
                                              (Peer)
Synchronous Replication
Guarantees two databases are always consistent
      More expensive than asynchronous



     Server #1                Server #2


        DB-1                     DB-2
Synchronous Replication
                                              steps
                      Client #1
                                  6) Sends back OK to Client
1) Update record                  #1
request                                   3) Propagates the
                                          update
                    Server #1                                       Server #2

2) Update record to DB-1            5) Sends back OK to Server #1        4) update record to DB-2


                           DB-1                                        DB-2
Asynchronous Replication
 Changes are propagated without waiting for the answer
Two databases could be not consistent in the range of few
                          ms


        Server #1                 Server #2


           DB-1                       DB-2
Asynchronous Replication
                                               steps
                  (4a and 4b are executed in parallel)

                      Client #1
                                  4a) Sends back OK to Client #1
1) Update record request
                                          3) Propagates the update

                   Server #1                                         Server #2
  2) Update record to DB-1                                                4b) update record to DB-2


                           DB-1                                         DB-2
Conflict Management
The conflicts resolution strategy can be plugged by
         providing implementations of the
     OReplicationConflictResolver interface


                        Server #2


             Conflict Strategy   DB-2
Conflict Management
                  Default strategy

                                     Server #2
Default implementation:
Conflict mark is created
                              Default
and conflict should be        Conflict
                                               DB-2
  resolved manually           Strategy

                                Conflict Log
Graph Database model
 wrapper on top of Document Database
Few simple concepts: Vertex, Edge,
       Property and Index

                             www.orientechnologies.com
2 different API
             OGraphDatabase                                  All APIs
Native, damn fast, not the most beautiful API           are compatible
                                                         among them!
                                                          So use the
                                                            right one
                                                          for the right
                                                               case




                                          OrientGraph
                               TinkerPop Blueprints, slowest but:
                            common to other impls, Gremlin, SPARQL

                                                             www.orientechnologies.com
TinkerPop technologies
  sort of “standard” for GraphDB
 a lot of free open-source projects

      http://tinkerpop.com


                              www.orientechnologies.com
TinkerPop Blueprints
basic API to interact with GraphDB
   implements transactional and
 indexable property graph model
        bidirectional edges


                             www.orientechnologies.com
TinkerPop Gremli
     scripting language
 easy to learn and understand
Used for operations against graphs


                             www.orientechnologies.com
g.v(89).outE('followed_by')
         .inV.outE('sung_by')
.inV.has('name','Garcia').back(3).name
Inheritance
              OgraphVertex (V)                              OgraphEdge (E)




            Person                                Works        Reside             Knows
                                      Vehicle
             Address :
              Address
                                 brand : BRANDS                  s
                                                  since :      since : Date        Level :
                                                   Date         till : Date        LEVELS




Custome             Provider
   r                     totBuyed :
totSold : float             float

                                                                              www.orientechnologies.com
Polymorphic SQL Query
List<ODocument> result = database.query( new
OSQLSynchQuery(

           "select from Person where city.name = 'Rome'" ));




                         Queries are polymorphics
                      and subclasses of Person can be
                             part of result set


                                                     www.orientechnologies.com
Fetch plans
 Choose what to fetch on query and vertexes/edges loading
Vertexes/Edges not fetched will be lazy-loaded on request
               Optimizes network latency




                                              www.orientechnologies.com
Fetch plans
                               Load only the root vertex
Vertex                                   = *:1
 Luca
   |
   | lives                 city
   +---------> Vertex ------------> Vertex
   |         10th street            Italy
   | knows
   +--------->* [Vertex   Vertex   Vertex ]
                 [ Marko   John   Nicholas]




                                               www.orientechnologies.com
Fetch plans
                                  Load root + address
Vertex                               = *:1 lives:2
 Luca
   |
   | lives                 city
   +---------> Vertex ------------> Vertex
   |         10th street            Italy
   | knows
   +--------->* [Vertex   Vertex   Vertex ]
                 [ Marko   John   Nicholas]




                                               www.orientechnologies.com
Fetch plans
                                 Load root + all known
Vertex                               = *:1 knows:1
 Luca
   |
   | lives                 city
   +---------> Vertex ------------> Vertex
   |         10th street            Italy
   | knows
   +--------->* [Vertex   Vertex   Vertex ]
                 [ Marko   John   Nicholas]




                                               www.orientechnologies.com
Fetch plans
                               Load up 3rd level of depth
Vertex                                   = *:3
 Luca
   |
   | lives                 city
   +---------> Vertex ------------> Vertex
   |         10th street            Italy
   | knows
   +--------->* [Vertex   Vertex   Vertex ]
                 [ Marko   John   Nicholas]




                                               www.orientechnologies.com
Console
ORIENT database v.1.0.0 www.orientechnologies.com
Type 'help' to display all the commands supported.

> connect remote:localhost/demo admin admin
Connecting to database [remote:localhost/demo] with user 'admin'...OK

> select from profile where nick.startsWith('L')
---+--------+--------------------+--------------------+--------------------+
  #| REC ID |NICK                |SEX                 |AGE                 |
---+--------+--------------------+--------------------+--------------------+
  0|    10:0|Lvca                |male                |34
  1|    10:3|Leo                 |male                |22
  2|    10:7|Luisa               |female              |27
3 item(s) found. Query executed in 0.013 sec(s).

> close
Disconnecting from the database [demo]...OK

> quit
                                                               www.orientechnologies.com
OrientDB Studio/SQL query




                   Resultset is editable and
                   changes are immediately
                          persistent!

                              www.orientechnologies.com
OrientDB Studio/View graph




                             www.orientechnologies.com
Upcoming features
      New hash   Indexes,
    query performance boost,
    data consistency check,
new transaction lock mechanics,
    object DB improvements
Production usage
           Finance Solutions Of America
NuvolaBase.com     (beta)



          The first
       Graph Database
        on the Cloud
           always available
        few seconds to setup it
       use it from app & mobile
                            www.orientechnologies.com
User’s reasons to chose
 Only one graph DB with cloud computing
 support, high flexibility of data format,
 powerful data analyzes (SQL + Gremlin),
JDBC driver, huge reduction of integration
      time, good technical support.
Blueprints microbenchmarks
Module                    OrientDB                  Neo4j       DEX

Release                   1.0-SNAPSHOT              1.7M03      4.5.1
VertexTestSuite           11,628.98                 30,535.02   4,686.65
EdgeTestSuite             7,712.06                  41,206.89   58,671.90
GraphTestSuite            9,073.09                  55,102.35   7,428.25
IndexableGraphTestSuite   4,620.61                  11,299.02   1070.75
IndexTestSuite            2,072.23                  5,239.92    not supported
AutomaticIndexTestSuite   3,252.48                  9,402.59    not supported

TransactionGraphTestSuite 7,659.67                  22,787.29   not supported

GraphMLReaderTestSuite    4,064.23                  5,440.67    not supported


  git clone git://github.com/tinkerpop/blueprints.git
  mvn clean install
Always        Free
Open Source Apache 2 license
     free for any purposes,
       even commercials

                              www.orientechnologies.com
No dependencies
    with 3rd parties software
   no conflicts with other
            software
just 1 Mb of run-time libraries

                           www.orientechnologies.com
Ø config
 download, unzip, run!
  cut & paste the db
                     www.orientechnologies.com
Luca Garulli
                     Founder of OrientDB


                   Andrey Lomakin
                    Committer of OrientDB


                   Artem Orobets
   @lgarulli,       Commiter of OrientDB

@Andrey_Lomakin,
   @Dr_EniSh

                                   www.orientechnologies.com

Contenu connexe

Tendances

Top 30 Node.js interview questions
Top 30 Node.js interview questionsTop 30 Node.js interview questions
Top 30 Node.js interview questionstechievarsity
 
Scaling web applications with cassandra presentation
Scaling web applications with cassandra presentationScaling web applications with cassandra presentation
Scaling web applications with cassandra presentationMurat Çakal
 
Advance Java Programming (CM5I) 6.Servlet
Advance Java Programming (CM5I) 6.ServletAdvance Java Programming (CM5I) 6.Servlet
Advance Java Programming (CM5I) 6.ServletPayal Dungarwal
 
Advance Java Programming (CM5I)5.Interacting with-database
Advance Java Programming (CM5I)5.Interacting with-databaseAdvance Java Programming (CM5I)5.Interacting with-database
Advance Java Programming (CM5I)5.Interacting with-databasePayal Dungarwal
 
Advance Java Programming( CM5I) 4. Networking Basics
Advance Java Programming( CM5I) 4. Networking BasicsAdvance Java Programming( CM5I) 4. Networking Basics
Advance Java Programming( CM5I) 4. Networking BasicsPayal Dungarwal
 
A Locality Sensitive Hashing Filter for Encrypted Vector Databases
A Locality Sensitive Hashing Filter for Encrypted Vector DatabasesA Locality Sensitive Hashing Filter for Encrypted Vector Databases
A Locality Sensitive Hashing Filter for Encrypted Vector DatabasesJunpei Kawamoto
 
Apache con 2012 taking the guesswork out of your hadoop infrastructure
Apache con 2012 taking the guesswork out of your hadoop infrastructureApache con 2012 taking the guesswork out of your hadoop infrastructure
Apache con 2012 taking the guesswork out of your hadoop infrastructureSteve Watt
 
The Spring Data MongoDB Project
The Spring Data MongoDB ProjectThe Spring Data MongoDB Project
The Spring Data MongoDB ProjectMongoDB
 
Apache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and PerformanceApache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and Performanceaaronmorton
 
Cacheconcurrencyconsistency cassandra svcc
Cacheconcurrencyconsistency cassandra svccCacheconcurrencyconsistency cassandra svcc
Cacheconcurrencyconsistency cassandra svccsrisatish ambati
 
An introduction to the web
An introduction to the webAn introduction to the web
An introduction to the webClaudio Cicali
 
Cassandra presentation at NoSQL
Cassandra presentation at NoSQLCassandra presentation at NoSQL
Cassandra presentation at NoSQLEvan Weaver
 
Mongo DBを半年運用してみた
Mongo DBを半年運用してみたMongo DBを半年運用してみた
Mongo DBを半年運用してみたMasakazu Matsushita
 
BIS and COM in Action
BIS and COM in ActionBIS and COM in Action
BIS and COM in ActionJerry Merrill
 
Introduction to Apache Cassandra
Introduction to Apache CassandraIntroduction to Apache Cassandra
Introduction to Apache CassandraLuke Tillman
 

Tendances (19)

Cassandra NoSQL
Cassandra NoSQLCassandra NoSQL
Cassandra NoSQL
 
Top 30 Node.js interview questions
Top 30 Node.js interview questionsTop 30 Node.js interview questions
Top 30 Node.js interview questions
 
Scaling web applications with cassandra presentation
Scaling web applications with cassandra presentationScaling web applications with cassandra presentation
Scaling web applications with cassandra presentation
 
Advance Java Programming (CM5I) 6.Servlet
Advance Java Programming (CM5I) 6.ServletAdvance Java Programming (CM5I) 6.Servlet
Advance Java Programming (CM5I) 6.Servlet
 
Advance Java Programming (CM5I)5.Interacting with-database
Advance Java Programming (CM5I)5.Interacting with-databaseAdvance Java Programming (CM5I)5.Interacting with-database
Advance Java Programming (CM5I)5.Interacting with-database
 
Advance Java Programming( CM5I) 4. Networking Basics
Advance Java Programming( CM5I) 4. Networking BasicsAdvance Java Programming( CM5I) 4. Networking Basics
Advance Java Programming( CM5I) 4. Networking Basics
 
A Locality Sensitive Hashing Filter for Encrypted Vector Databases
A Locality Sensitive Hashing Filter for Encrypted Vector DatabasesA Locality Sensitive Hashing Filter for Encrypted Vector Databases
A Locality Sensitive Hashing Filter for Encrypted Vector Databases
 
Apache con 2012 taking the guesswork out of your hadoop infrastructure
Apache con 2012 taking the guesswork out of your hadoop infrastructureApache con 2012 taking the guesswork out of your hadoop infrastructure
Apache con 2012 taking the guesswork out of your hadoop infrastructure
 
The Spring Data MongoDB Project
The Spring Data MongoDB ProjectThe Spring Data MongoDB Project
The Spring Data MongoDB Project
 
Apache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and PerformanceApache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and Performance
 
Cacheconcurrencyconsistency cassandra svcc
Cacheconcurrencyconsistency cassandra svccCacheconcurrencyconsistency cassandra svcc
Cacheconcurrencyconsistency cassandra svcc
 
An introduction to the web
An introduction to the webAn introduction to the web
An introduction to the web
 
Cassandra presentation at NoSQL
Cassandra presentation at NoSQLCassandra presentation at NoSQL
Cassandra presentation at NoSQL
 
NLTK in 20 minutes
NLTK in 20 minutesNLTK in 20 minutes
NLTK in 20 minutes
 
Dcc
DccDcc
Dcc
 
Mongo DBを半年運用してみた
Mongo DBを半年運用してみたMongo DBを半年運用してみた
Mongo DBを半年運用してみた
 
Intro to J Ruby
Intro to J RubyIntro to J Ruby
Intro to J Ruby
 
BIS and COM in Action
BIS and COM in ActionBIS and COM in Action
BIS and COM in Action
 
Introduction to Apache Cassandra
Introduction to Apache CassandraIntroduction to Apache Cassandra
Introduction to Apache Cassandra
 

En vedette

En vedette (15)

Ebola
EbolaEbola
Ebola
 
Diapositivasdeinteligenciaemocional 130215172254-phpapp02
Diapositivasdeinteligenciaemocional 130215172254-phpapp02Diapositivasdeinteligenciaemocional 130215172254-phpapp02
Diapositivasdeinteligenciaemocional 130215172254-phpapp02
 
Tarea 3 m. nuñez m. montiel
Tarea 3 m. nuñez m. montielTarea 3 m. nuñez m. montiel
Tarea 3 m. nuñez m. montiel
 
Детский сад и центр Планета детства
Детский сад и центр Планета детстваДетский сад и центр Планета детства
Детский сад и центр Планета детства
 
Actividad de evaluación módulo 2
Actividad de evaluación módulo 2Actividad de evaluación módulo 2
Actividad de evaluación módulo 2
 
בריכת שחייה לעלון
בריכת שחייה לעלוןבריכת שחייה לעלון
בריכת שחייה לעלון
 
Biomolekul 1[1]
Biomolekul 1[1]Biomolekul 1[1]
Biomolekul 1[1]
 
El patito feo
El patito feoEl patito feo
El patito feo
 
Nk3
Nk3Nk3
Nk3
 
Franki
FrankiFranki
Franki
 
Precursores de las computadoras
Precursores de las computadorasPrecursores de las computadoras
Precursores de las computadoras
 
3 irt 笔记
3 irt 笔记3 irt 笔记
3 irt 笔记
 
Departamento de gestión integral de riesgos subsecretaria de agricultura
Departamento de gestión integral de riesgos subsecretaria de agriculturaDepartamento de gestión integral de riesgos subsecretaria de agricultura
Departamento de gestión integral de riesgos subsecretaria de agricultura
 
IAB Europe Webinar Deck: Building more Meaningful Consumer Relationships with...
IAB Europe Webinar Deck: Building more Meaningful Consumer Relationships with...IAB Europe Webinar Deck: Building more Meaningful Consumer Relationships with...
IAB Europe Webinar Deck: Building more Meaningful Consumer Relationships with...
 
Autonomous cruise control ppt
Autonomous cruise control pptAutonomous cruise control ppt
Autonomous cruise control ppt
 

Similaire à OrientDB the graph database

OrientDB distributed architecture 1.1
OrientDB distributed architecture 1.1OrientDB distributed architecture 1.1
OrientDB distributed architecture 1.1Luca Garulli
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataRoger Xia
 
Webinar Back to Basics 3 - Introduzione ai Replica Set
Webinar Back to Basics 3 - Introduzione ai Replica SetWebinar Back to Basics 3 - Introduzione ai Replica Set
Webinar Back to Basics 3 - Introduzione ai Replica SetMongoDB
 
Exchange 2010 ha ctd
Exchange 2010 ha ctdExchange 2010 ha ctd
Exchange 2010 ha ctdKaliyan S
 
Running Neutron at Scale - Gal Sagie & Eran Gampel - OpenStack Day Israel 2016
Running Neutron at Scale - Gal Sagie & Eran Gampel - OpenStack Day Israel 2016Running Neutron at Scale - Gal Sagie & Eran Gampel - OpenStack Day Israel 2016
Running Neutron at Scale - Gal Sagie & Eran Gampel - OpenStack Day Israel 2016Cloud Native Day Tel Aviv
 
Exploiting NoSQL Like Never Before
Exploiting NoSQL Like Never BeforeExploiting NoSQL Like Never Before
Exploiting NoSQL Like Never BeforeFrancis Alexander
 
Key-value databases in practice Redis @ DotNetToscana
Key-value databases in practice Redis @ DotNetToscanaKey-value databases in practice Redis @ DotNetToscana
Key-value databases in practice Redis @ DotNetToscanaMatteo Baglini
 
2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung Mosbach2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung MosbachJohannes Hoppe
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBApaichon Punopas
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDBMongoDB
 
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeModeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeDavid Boike
 
Nimbuzz march2012
Nimbuzz march2012Nimbuzz march2012
Nimbuzz march2012nlwebperf
 
2013 london advanced-replication
2013 london advanced-replication2013 london advanced-replication
2013 london advanced-replicationMarc Schwering
 

Similaire à OrientDB the graph database (20)

OrientDB distributed architecture 1.1
OrientDB distributed architecture 1.1OrientDB distributed architecture 1.1
OrientDB distributed architecture 1.1
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Webinar Back to Basics 3 - Introduzione ai Replica Set
Webinar Back to Basics 3 - Introduzione ai Replica SetWebinar Back to Basics 3 - Introduzione ai Replica Set
Webinar Back to Basics 3 - Introduzione ai Replica Set
 
Exchange 2010 ha ctd
Exchange 2010 ha ctdExchange 2010 ha ctd
Exchange 2010 ha ctd
 
Running Neutron at Scale - Gal Sagie & Eran Gampel - OpenStack Day Israel 2016
Running Neutron at Scale - Gal Sagie & Eran Gampel - OpenStack Day Israel 2016Running Neutron at Scale - Gal Sagie & Eran Gampel - OpenStack Day Israel 2016
Running Neutron at Scale - Gal Sagie & Eran Gampel - OpenStack Day Israel 2016
 
Exploiting NoSQL Like Never Before
Exploiting NoSQL Like Never BeforeExploiting NoSQL Like Never Before
Exploiting NoSQL Like Never Before
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
MongoDB
MongoDBMongoDB
MongoDB
 
Key-value databases in practice Redis @ DotNetToscana
Key-value databases in practice Redis @ DotNetToscanaKey-value databases in practice Redis @ DotNetToscana
Key-value databases in practice Redis @ DotNetToscana
 
2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung Mosbach2015 02-09 - NoSQL Vorlesung Mosbach
2015 02-09 - NoSQL Vorlesung Mosbach
 
Mongo db roma replication and sharding
Mongo db roma replication and shardingMongo db roma replication and sharding
Mongo db roma replication and sharding
 
Technical presentation
Technical presentationTechnical presentation
Technical presentation
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDB
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDB
 
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeModeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught Me
 
Prashanthi
PrashanthiPrashanthi
Prashanthi
 
Sql server
Sql serverSql server
Sql server
 
Nimbuzz march2012
Nimbuzz march2012Nimbuzz march2012
Nimbuzz march2012
 
Open source Technology
Open source TechnologyOpen source Technology
Open source Technology
 
2013 london advanced-replication
2013 london advanced-replication2013 london advanced-replication
2013 london advanced-replication
 

Dernier

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Dernier (20)

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

OrientDB the graph database

  • 1. 1.0 May 2012 www.orientechnologies.com
  • 2. Artem Orobets Senior Java Developer in ExigenServices 1.5 year in Java OrientDB committer Andrey Lomakin Software Architect in ExigenServices 6+ years JEE experience OrientDB committer
  • 3. OrientDB = best features of newest NoSQL solutions + best features of Relational DBMS + True Graph engine www.orientechnologies.com
  • 4. Relationships are direct links no Relational JOINS to connect multiple tables Load trees and graphs in few ms! www.orientechnologies.com
  • 5. Complex types native support for collections, maps (key/value) and embedded documents no more additional tables to handle them www.orientechnologies.com
  • 6. Schema-mixed schema with mandatory and optional fields + constraints the best of schema-less and schema-full modes www.orientechnologies.com
  • 7. ACID Transactions db.begin(); try{ // your code ... db.commit(); } catch( Exception e ) { db.rollback(); } www.orientechnologies.com
  • 8. SQL select * from employee where name like '%Jay%' and status=0 www.orientechnologies.com
  • 9. SELECT SUM(price) as prices, SUM(cost) as costs, prices-costs, margin/price FROM Balance VS function (key, values) { var price = 0.0, cost = 0.0, margin = 0.0, marginPercent = 0.0; for (var i = 0; i < values.length; i++) { price += values[i].price; cost += values[i].cost; } margin = price - cost; marginPercent = margin / price; return { price: price, cost: cost, margin: margin, marginPercent: marginPercent }; } www.orientechnologies.com
  • 10. SQL & relationships select from Account where address.city.country.name = 'Italy' select from Account where addresses contains (city.country.name = 'Italy') www.orientechnologies.com
  • 11. SQL & schema- less select from Profile where any() like '%Jay%' select from Stock where all() is not null www.orientechnologies.com
  • 12. HTTP RESTful firewall friendly use it from the webbrowser use it from the ESB (SOA) www.orientechnologies.com
  • 13. Native { JSON '@rid' = '26:10', '@class' = 'Developer', 'name' : 'Luca', 'surname' : 'Garulli', 'out' : [ #10:33, #10:232 ] } www.orientechnologies.com
  • 14. Binary protocol available for Java and soon C, C++ and Ruby www.orientechnologies.com
  • 15. MVRB-Tree index the best of B+Tree and RB-Tree fast on browsing, low insertion cost www.orientechnologies.com
  • 16. Hooks similar to triggers catch events against records, database and transactions implement custom cascade deletion algorithm enforce constraints www.orientechnologies.com
  • 17. Security users and roles, encrypted passwords fine grain privileges www.orientechnologies.com
  • 18. Multi-Master architecture any node can read/write to the database this scale up horizontly adding nodes is straightforward
  • 19. The actors Leader Node Only 1 per Leader per cluster, checks other nodes and notify changes to other Peer Nodes. Any server node in the cluster. Has a permanent Peer Node connection to the Leader Node Clients are connected to Server Nodes no matter if Leader Client or Peer Database Database, where data are stored Synchronous mode replication. Asynchronous mode replication.
  • 20. Cluster auto-discovering At start up each Server Node sends a IP Multicast message in broadcast to discover if any Leader Node is available to join the cluster. Server #1 (Leader) DB DB DB DB DB DB Server #2 (Peer) DB DB DB DB DB DB
  • 21. One Leader Multiple Peers The first node to start is always the Leader but in case of failure can be elected any other. Server #1 (Leader) DB DB DBDB DB DB Server #2 Server #3 (Peer) (Peer) DB DB DBDB DB DB DB DB DBDB DB
  • 22. Security To join a cluster the Server Node has to configure the cluster name and password Broadcast messages are encrypted using the password Server #1 (Leader) Server #2 Join the cluster (Peer) ONLY If knows the name DB DB DB DB DB DB and password
  • 23. Multiple clusters Multiple separate clusters can coexist in the same network Clusters can't see each others. Are separated boxes What identify a cluster is name + password Cluster 'A', password 'aaa' Server #1 Cluster 'B', password (Leader) 'bbb' Server #2 Server #1 (Peer) (Leader) Server #3 (Peer) Server #2 (Peer) Server #3 (Peer)
  • 24. Synchronous Replication Guarantees two databases are always consistent More expensive than asynchronous Server #1 Server #2 DB-1 DB-2
  • 25. Synchronous Replication steps Client #1 6) Sends back OK to Client 1) Update record #1 request 3) Propagates the update Server #1 Server #2 2) Update record to DB-1 5) Sends back OK to Server #1 4) update record to DB-2 DB-1 DB-2
  • 26. Asynchronous Replication Changes are propagated without waiting for the answer Two databases could be not consistent in the range of few ms Server #1 Server #2 DB-1 DB-2
  • 27. Asynchronous Replication steps (4a and 4b are executed in parallel) Client #1 4a) Sends back OK to Client #1 1) Update record request 3) Propagates the update Server #1 Server #2 2) Update record to DB-1 4b) update record to DB-2 DB-1 DB-2
  • 28. Conflict Management The conflicts resolution strategy can be plugged by providing implementations of the OReplicationConflictResolver interface Server #2 Conflict Strategy DB-2
  • 29. Conflict Management Default strategy Server #2 Default implementation: Conflict mark is created Default and conflict should be Conflict DB-2 resolved manually Strategy Conflict Log
  • 30. Graph Database model wrapper on top of Document Database Few simple concepts: Vertex, Edge, Property and Index www.orientechnologies.com
  • 31. 2 different API OGraphDatabase All APIs Native, damn fast, not the most beautiful API are compatible among them! So use the right one for the right case OrientGraph TinkerPop Blueprints, slowest but: common to other impls, Gremlin, SPARQL www.orientechnologies.com
  • 32. TinkerPop technologies sort of “standard” for GraphDB a lot of free open-source projects http://tinkerpop.com www.orientechnologies.com
  • 33. TinkerPop Blueprints basic API to interact with GraphDB implements transactional and indexable property graph model bidirectional edges www.orientechnologies.com
  • 34. TinkerPop Gremli scripting language easy to learn and understand Used for operations against graphs www.orientechnologies.com
  • 35. g.v(89).outE('followed_by') .inV.outE('sung_by') .inV.has('name','Garcia').back(3).name
  • 36. Inheritance OgraphVertex (V) OgraphEdge (E) Person Works Reside Knows Vehicle Address : Address brand : BRANDS s since : since : Date Level : Date till : Date LEVELS Custome Provider r totBuyed : totSold : float float www.orientechnologies.com
  • 37. Polymorphic SQL Query List<ODocument> result = database.query( new OSQLSynchQuery( "select from Person where city.name = 'Rome'" )); Queries are polymorphics and subclasses of Person can be part of result set www.orientechnologies.com
  • 38. Fetch plans Choose what to fetch on query and vertexes/edges loading Vertexes/Edges not fetched will be lazy-loaded on request Optimizes network latency www.orientechnologies.com
  • 39. Fetch plans Load only the root vertex Vertex = *:1 Luca | | lives city +---------> Vertex ------------> Vertex | 10th street Italy | knows +--------->* [Vertex Vertex Vertex ] [ Marko John Nicholas] www.orientechnologies.com
  • 40. Fetch plans Load root + address Vertex = *:1 lives:2 Luca | | lives city +---------> Vertex ------------> Vertex | 10th street Italy | knows +--------->* [Vertex Vertex Vertex ] [ Marko John Nicholas] www.orientechnologies.com
  • 41. Fetch plans Load root + all known Vertex = *:1 knows:1 Luca | | lives city +---------> Vertex ------------> Vertex | 10th street Italy | knows +--------->* [Vertex Vertex Vertex ] [ Marko John Nicholas] www.orientechnologies.com
  • 42. Fetch plans Load up 3rd level of depth Vertex = *:3 Luca | | lives city +---------> Vertex ------------> Vertex | 10th street Italy | knows +--------->* [Vertex Vertex Vertex ] [ Marko John Nicholas] www.orientechnologies.com
  • 43. Console ORIENT database v.1.0.0 www.orientechnologies.com Type 'help' to display all the commands supported. > connect remote:localhost/demo admin admin Connecting to database [remote:localhost/demo] with user 'admin'...OK > select from profile where nick.startsWith('L') ---+--------+--------------------+--------------------+--------------------+ #| REC ID |NICK |SEX |AGE | ---+--------+--------------------+--------------------+--------------------+ 0| 10:0|Lvca |male |34 1| 10:3|Leo |male |22 2| 10:7|Luisa |female |27 3 item(s) found. Query executed in 0.013 sec(s). > close Disconnecting from the database [demo]...OK > quit www.orientechnologies.com
  • 44. OrientDB Studio/SQL query Resultset is editable and changes are immediately persistent! www.orientechnologies.com
  • 45. OrientDB Studio/View graph www.orientechnologies.com
  • 46. Upcoming features New hash Indexes, query performance boost, data consistency check, new transaction lock mechanics, object DB improvements
  • 47. Production usage Finance Solutions Of America
  • 48. NuvolaBase.com (beta) The first Graph Database on the Cloud always available few seconds to setup it use it from app & mobile www.orientechnologies.com
  • 49. User’s reasons to chose Only one graph DB with cloud computing support, high flexibility of data format, powerful data analyzes (SQL + Gremlin), JDBC driver, huge reduction of integration time, good technical support.
  • 50. Blueprints microbenchmarks Module OrientDB Neo4j DEX Release 1.0-SNAPSHOT 1.7M03 4.5.1 VertexTestSuite 11,628.98 30,535.02 4,686.65 EdgeTestSuite 7,712.06 41,206.89 58,671.90 GraphTestSuite 9,073.09 55,102.35 7,428.25 IndexableGraphTestSuite 4,620.61 11,299.02 1070.75 IndexTestSuite 2,072.23 5,239.92 not supported AutomaticIndexTestSuite 3,252.48 9,402.59 not supported TransactionGraphTestSuite 7,659.67 22,787.29 not supported GraphMLReaderTestSuite 4,064.23 5,440.67 not supported git clone git://github.com/tinkerpop/blueprints.git mvn clean install
  • 51. Always Free Open Source Apache 2 license free for any purposes, even commercials www.orientechnologies.com
  • 52. No dependencies with 3rd parties software no conflicts with other software just 1 Mb of run-time libraries www.orientechnologies.com
  • 53. Ø config download, unzip, run! cut & paste the db www.orientechnologies.com
  • 54. Luca Garulli Founder of OrientDB Andrey Lomakin Committer of OrientDB Artem Orobets @lgarulli, Commiter of OrientDB @Andrey_Lomakin, @Dr_EniSh www.orientechnologies.com