SlideShare a Scribd company logo
“A NoSQL Database for the Internet age”

                     www.OrienTechnologies.com


                                      Author of OrientDB and Roma
Luca Garulli
 Luca Garulli                         Framework Open Source projects,
CTO@AssetData.it
 CTO@AssetData.it                     CTO at Asset Data company,
http://zion-city.blogspot.com
 http://zion-city.blogspot.com        Technical Manager at Romulus
http://twitter.com/lgarulli
 http://twitter.com/lgarulli          consortium
NoSQL movement
“In recent years, a number of new systems, sometimes called
“NoSQL” systems, have been introduced to provide indexed data
storage that is much higher performance than existing relational
database products like MySQL, Oracle, DB2, and SQL Server.
These data storage systems have a number of features in common:

● A simple call level interface or protocol (in contrast to a SQL
binding)
● Ability to horizontally scale throughput over many servers,

● Efficient use of distributed indexes and RAM for data storage, and

● The ability to dynamically define new attributes or data schema“



                    from “High Performance Scalable Data Stores” by Rick Cattell
                For more information visit: http://www.orientechnologies.com
Products
 There are two main products released with commercial friendly
                Open Source Apache 2 license


  Deeply scalable Document based DBMS that uses the               The Key/Value Server based on the
 features of the Graph Databases to handle links. It's the        Document Database technology and
   basic engine of all the Orient products. It can work in         accessible as embedded repository
     schema-less mode, schema-full or a mix of both.               via Java APIs or via HTTP using a
                                                                  RESTful API. Orient K/V uses a new
Supports advanced features, such as indexing, fluent and           algorithm called RB+Tree, derived
  SQL-like queries. It handles natively JSON and XML             from the Red-Black Tree and from the
 documents. Developers can use Java native and HTTP                              B+Tree.
                      RESTful APIs
                                                                  Orient Key/Value server can run in
 Graphs of hundreads of linked objects can be retrieved all         high availability mode using a
in memory in less than 1ms without executing costly JOINs        cluster of multiple nodes partitioned.
            such as the Relational DBMSs do.
                       For more information visit: http://www.orientechnologies.com
Database structure
Cluster concept
             Class “Profile“ has
            records distributed on
              multiple clusters.         Class “Profile“
                                          Class “Profile“
                                                                           Cluster “FamousProfile“
                                                                            Cluster “FamousProfile“
 All the other                                                                  Type = physical
                                                                                 Type = physical
profiles will be
stored into the
                                                                           Jay Miner Bill Gates
“OtherProfile“
cluster of type
   “logical“                                The “FamousProfile“ cluster
                                        contains all the profile of the most
                                         famous people and it's supposed
                                        to being accessed frequently. This            Cluster “Twit“
Cluster “OtherProfile“                     is the reason why we selected                Cluster “Twit“
 Cluster “OtherProfile“                                                               Type = physical
    Type = logical                                “physical“ as type.                  Type = physical
      Type = logical




                       For more information visit: http://www.orientechnologies.com
APIs
 OrientDB is written 100% in Java® and can run on any
platform that supports the Java® Technology version 5 or
                          more.

  OrientDB supports native Java client API to work with
  embedded or remote databases using the fast binary
                       protocol

OrientDB Server comes with a HTTP RESTful interface to
 being used from any language, even from the Internet
       Browser. Uses JSON to represents records
             For more information visit: http://www.orientechnologies.com
Java example with records
// OPEN THE DATABASE
ODatabaseDocumentTx db = new ODatabaseDocumentTx("remote:localhost/demo").open("admin", "admin");

// CREATE A NEW DOCUMENT AND FILL IT
ODocument doc = new ODocument(db, "Person");
                                                                                                  This is a
doc.field( "name", "Luke" );                                                                    relationship
doc.field( "surname", "Skywalker" );                                                            Many-to-One
doc.field( "city", new ODocument("City" ).field("name","Rome").field("country", "Italy") );

// SAVE THE DOCUMENT
doc.save();

// QUERY THE DOCUMENT                                                                         Query using the
List<ODocument> result = database.query(                                                      SQL syntax with
  new OSQLSynchQuery("select * from person where city.name = 'Rome'")).execute();              extensions to
                                                                                               traverse links
// PRINT THE RESULT SET
for( ODocument d : result ){                                                                   without costly
  System.out.println("Person: " + d.field( "name" ) + d.field( "surname" ));                       JOINs
}

db.close();

                             For more information visit: http://www.orientechnologies.com
Object Database interface
Even if OrientDB is not an ODBMS (but is a Document DBMS), it
 offers the ODatabaseObject interface to works with POJOs in
  transparent way removing the Impedence Mismatch problem

Fields not present in the real Java class will be not mapped but
                 saved with the original record

       Queries convert automatically records to POJOs

   References between POJO can be stored as links (aka
    relationships) or by including the referenced object as
                          embedded.
              For more information visit: http://www.orientechnologies.com
Java example with POJOs
// OPEN THE DATABASE
ODatabaseObjectTx db = new ODatabaseObjectTx("remote:localhost/demo").open("admin", "admin");

// CREATE A NEW OBJECT AND FILL IT
Person person = new Person();                                  Automatic
person.setName( "Luke" );                                     binding from
person.setSurname( "Skywalker" );
person.setCity( new City( "Rome", "Italy") );                POJO to record

// SAVE THE OBJECT
db.save( person );                                                         Query returns directly List
                                                                           of POJO. Queries use the
// QUERY THE OBJECT                                                        cache before to load the
List<Person> result = database.query(                                      records from the storage
  new OSQLSynchQuery("select from person where city.name = 'Rome'"));

// PRINT THE RESULT SET
for( Person p : result ){
  System.out.println("Person: " + p.getName() + “ “ + p.getSurname() );                The POJOs
}                                                                                     are usable as
                                                                                         usually
db.close();

                            For more information visit: http://www.orientechnologies.com
HTTP RESTful API
       select from Profile where project = 'Amiga'


   HTTP RESTful protocol
         (JSON)                                                  OrientDB
                                                                 OrientDB
{ result :
  { _rec: 3:4,
                                                                  Server
                                                                  Server
     _ver: 2,
     name: “Jay”,
     surname: “Miner”
  },                                                                 Fast
  { _rec: 4:343,
     _ver: 0,                                                   binary protocol
     name: “Tim”,
     surname: “King”
  }
}
                                                                  Java
                                                                   Java
                                                               application
                                                                application
        For more information visit: http://www.orientechnologies.com
Security
   Encrypted
 password using                                                         “Reader“ Role
SHA-256 algorithm                                                       Mode = Deny all but

                                                                        Rules:
2 modes: “allow                                                         database = Read
all but” and “deny                                                      database.cluster.* = Read
                                                                        database.cluster.metadata = None
      all but”                                                          database.class.* = Read

Each user has one
  or more roles
                                                                        “Publisher“ Role
Default roles are:
reader, writer and                                                      Mode = Deny all but
     admin                  “Admin“ Role                                Rules:
                                                                        Database.Cluster.cars = All
                            Mode = Allow all but

                     For more information visit: http://www.orientechnologies.com
OrientDB Studio




For more information visit: http://www.orientechnologies.com
Orient Key/Value – Partitions in the Ring

                                                                                   Backup=1 in
                                                                                configuration means
                                                                              that each node backup
                        Keys range: S .. Z                                    data synchronously on
                                                                                   the next one.


                                                      Back
                                Node #1                    up                 Keys range: 0 .. F
 Each node is owner
of part of keys (Node


                                                 up
                                               ck
#1 the range S-Z) and
                                                              Ba


                                             Ba
                                                                 ck
  is responsable to                                       p         u
                                                                        Node #2
 synchronize them to
       the disk
                                                                                    The last node in
                                                                                  the Ring is the last
                                               Node #3                                one started
                                                         Keys range: G .. R



                   For more information visit: http://www.orientechnologies.com
Orient Key/Value – Update an entry

                                                                           The client (application or
                                                                           web-browser) connects to
          upd                                                               the owner node of the
             a   te b     Keys range: S .. Z                                   entry to update
                     and
                         :Co
                             ld p
                                 lay
                                                         Back
                                      Node #1                 up                     Keys range: 0 .. F
                          to   disk
                      e
                  sav



                                                     p
                                                   ku
                                                                 Ba



                                                  c
                                                Ba
                                                                    ck
                                                             p         u
                                                                              Node #2


  Node #1 is the owner of the
  updated entry: propagates
changes to the local disk and to                  Node #3
 backup node synchronously                                  Keys range: G .. R



                    For more information visit: http://www.orientechnologies.com
Orient Key/Value – Fail Over Management

                                                                               The Backup of Node #1
                                                                                 is the Node #2. The
                                                                                Node #2 becames the
                    Keys range: S .. Z                                          owner and assures to
                                                                                write all the entries to
                                                                                        the Disk

                                                  Back
                            Node #1                    up                 Keys range: S .. F


                                             up
                                           ck
                                                          Ba

                                         Ba
                                                             ck
                                                                              save to d
                                                                                       isk
                                                      p         u
Other Nodes envolved                                                Node #2
  change the backup
policies themselves. In
  this case Node #3
 backups on Node #2
     and viceversa                         Node #3
                                                     Keys range: G .. R


                    For more information visit: http://www.orientechnologies.com

More Related Content

PDF
OrientDB
ODP
OrientDB for real & Web App development
PPT
Switching from relational to the graph model
PPTX
Stephan Ewen - Experiences running Flink at Very Large Scale
PDF
Open Source ETL using Talend Open Studio
PPTX
Azure Data Factory ETL Patterns in the Cloud
PDF
Which Hadoop Distribution to use: Apache, Cloudera, MapR or HortonWorks?
PDF
Airflow Best Practises & Roadmap to Airflow 2.0
OrientDB
OrientDB for real & Web App development
Switching from relational to the graph model
Stephan Ewen - Experiences running Flink at Very Large Scale
Open Source ETL using Talend Open Studio
Azure Data Factory ETL Patterns in the Cloud
Which Hadoop Distribution to use: Apache, Cloudera, MapR or HortonWorks?
Airflow Best Practises & Roadmap to Airflow 2.0

What's hot (20)

PPSX
Intro to Talend Open Studio for Data Integration
PPTX
MongoDB presentation
PDF
How Orange Financial combat financial frauds over 50M transactions a day usin...
PDF
Luft : 10억 데이터를 10초만에 쿼리하는 DB 개발기
PDF
Talend Open Studio Data Integration
PPTX
Tuning Apache Kafka Connectors for Flink.pptx
PDF
CouchDB
PDF
Terraform Introduction
PDF
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
PDF
Introduction to spark
PDF
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
PPTX
Docker Networking Overview
PPTX
Apache Spark overview
PPTX
Apache Tez: Accelerating Hadoop Query Processing
PDF
Docker Introduction
PDF
Twitter의 snowflake 소개 및 활용
PDF
Building a fully managed stream processing platform on Flink at scale for Lin...
PDF
InfluxDB IOx Tech Talks: The Impossible Dream: Easy-to-Use, Super Fast Softw...
PDF
What Is RDD In Spark? | Edureka
PDF
Log analysis with the elk stack
Intro to Talend Open Studio for Data Integration
MongoDB presentation
How Orange Financial combat financial frauds over 50M transactions a day usin...
Luft : 10억 데이터를 10초만에 쿼리하는 DB 개발기
Talend Open Studio Data Integration
Tuning Apache Kafka Connectors for Flink.pptx
CouchDB
Terraform Introduction
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Introduction to spark
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
Docker Networking Overview
Apache Spark overview
Apache Tez: Accelerating Hadoop Query Processing
Docker Introduction
Twitter의 snowflake 소개 및 활용
Building a fully managed stream processing platform on Flink at scale for Lin...
InfluxDB IOx Tech Talks: The Impossible Dream: Easy-to-Use, Super Fast Softw...
What Is RDD In Spark? | Edureka
Log analysis with the elk stack
Ad

Viewers also liked (20)

PDF
OrientDB Distributed Architecture v2.0
PPTX
OrientDB vs Neo4j - Comparison of query/speed/functionality
PPTX
OrientDB vs Neo4j - and an introduction to NoSQL databases
PPTX
OrientDB - the 2nd generation of (Multi-Model) NoSQL
PPTX
Presentation of OrientDB v2.2 - Webinar
PPT
Design your application using Persistent Graphs and OrientDB
PDF
OrientDB distributed architecture 1.1
PPT
Why relationships are cool but "join" sucks
PPTX
OrientDB the graph database
PDF
OrientDB document or graph? Select the right model (old presentation)
PPTX
Graph Databases & OrientDB
PDF
OrientDB - the 2nd generation of (Multi-Model) NoSQL - J On The Beach 2016
PDF
Austin Data Geeks - Why relationships are cool but join sucks
PDF
OrientDB & Hazelcast: In-Memory Distributed Graph Database
PDF
Geospatial Graphs made easy with OrientDB - Codemotion Spain
PPTX
Orient power point
PPTX
Optimizing Cypher Queries in Neo4j
PPT
An overview of InfiniteGraph, the distributed graph database
PPT
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
PDF
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
OrientDB Distributed Architecture v2.0
OrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - and an introduction to NoSQL databases
OrientDB - the 2nd generation of (Multi-Model) NoSQL
Presentation of OrientDB v2.2 - Webinar
Design your application using Persistent Graphs and OrientDB
OrientDB distributed architecture 1.1
Why relationships are cool but "join" sucks
OrientDB the graph database
OrientDB document or graph? Select the right model (old presentation)
Graph Databases & OrientDB
OrientDB - the 2nd generation of (Multi-Model) NoSQL - J On The Beach 2016
Austin Data Geeks - Why relationships are cool but join sucks
OrientDB & Hazelcast: In-Memory Distributed Graph Database
Geospatial Graphs made easy with OrientDB - Codemotion Spain
Orient power point
Optimizing Cypher Queries in Neo4j
An overview of InfiniteGraph, the distributed graph database
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
Ad

Similar to OrientDB introduction - NoSQL (20)

PDF
Works with persistent graphs using OrientDB
PDF
OrientDB the database for the web 1.1
PDF
Development without Constraint
PPT
Wmware NoSQL
KEY
mongoDB at Visibiz
PDF
Non Relational Databases
ODP
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
PPTX
Drill dchug-29 nov2012
PDF
Introduction to mongo db by zain
PDF
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
PPTX
Apache Drill
PDF
Mongo db transcript
PDF
OrientDB & Node.js Overview - JS.Everywhere() KW
PDF
Building Highly Flexible, High Performance Query Engines
PDF
Functional Dependencies and Normalization for Relational Databases
PPTX
Drill Bay Area HUG 2012-09-19
PDF
Sep 2012 HUG: Apache Drill for Interactive Analysis
PPTX
UNIT-2.pptx
PPTX
Java and Mongo
PPTX
Drill at the Chug 9-19-12
Works with persistent graphs using OrientDB
OrientDB the database for the web 1.1
Development without Constraint
Wmware NoSQL
mongoDB at Visibiz
Non Relational Databases
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Drill dchug-29 nov2012
Introduction to mongo db by zain
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Apache Drill
Mongo db transcript
OrientDB & Node.js Overview - JS.Everywhere() KW
Building Highly Flexible, High Performance Query Engines
Functional Dependencies and Normalization for Relational Databases
Drill Bay Area HUG 2012-09-19
Sep 2012 HUG: Apache Drill for Interactive Analysis
UNIT-2.pptx
Java and Mongo
Drill at the Chug 9-19-12

More from Luca Garulli (14)

PDF
Scale Out Your Graph Across Servers and Clouds with OrientDB
PDF
Polyglot Persistence vs Multi-Model Databases
PDF
How Graph Databases started the Multi Model revolution
PDF
OrientDB and Hazelcast
PPT
Why relationships are cool but join sucks - Big Data & Graphs in Rome
PPT
Soffri di patologie da "domini complessi con tante relazioni"? C'è una nuova ...
PPT
Switching from Relational 2 Graph - CloudConf.it
PPT
Switching from Relational to the Graph model v1.3
PPT
Internet Apps powered by NoSQL and JavaScript
PPT
Switching from the Relational to the Graph model
PPT
No sql matters_2012_keynote
PDF
Roma introduction and concepts
PPT
RomaFramework Tutorial Basics
ODP
Roma Meta Framework Concepts @JavaDay Rome 2007
Scale Out Your Graph Across Servers and Clouds with OrientDB
Polyglot Persistence vs Multi-Model Databases
How Graph Databases started the Multi Model revolution
OrientDB and Hazelcast
Why relationships are cool but join sucks - Big Data & Graphs in Rome
Soffri di patologie da "domini complessi con tante relazioni"? C'è una nuova ...
Switching from Relational 2 Graph - CloudConf.it
Switching from Relational to the Graph model v1.3
Internet Apps powered by NoSQL and JavaScript
Switching from the Relational to the Graph model
No sql matters_2012_keynote
Roma introduction and concepts
RomaFramework Tutorial Basics
Roma Meta Framework Concepts @JavaDay Rome 2007

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Advanced Soft Computing BINUS July 2025.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
Sensors and Actuators in IoT Systems using pdf
Chapter 2 Digital Image Fundamentals.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
GamePlan Trading System Review: Professional Trader's Honest Take
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Advanced Soft Computing BINUS July 2025.pdf

OrientDB introduction - NoSQL

  • 1. “A NoSQL Database for the Internet age” www.OrienTechnologies.com Author of OrientDB and Roma Luca Garulli Luca Garulli Framework Open Source projects, [email protected] [email protected] CTO at Asset Data company, http://zion-city.blogspot.com http://zion-city.blogspot.com Technical Manager at Romulus http://twitter.com/lgarulli http://twitter.com/lgarulli consortium
  • 2. NoSQL movement “In recent years, a number of new systems, sometimes called “NoSQL” systems, have been introduced to provide indexed data storage that is much higher performance than existing relational database products like MySQL, Oracle, DB2, and SQL Server. These data storage systems have a number of features in common: ● A simple call level interface or protocol (in contrast to a SQL binding) ● Ability to horizontally scale throughput over many servers, ● Efficient use of distributed indexes and RAM for data storage, and ● The ability to dynamically define new attributes or data schema“ from “High Performance Scalable Data Stores” by Rick Cattell For more information visit: http://www.orientechnologies.com
  • 3. Products There are two main products released with commercial friendly Open Source Apache 2 license Deeply scalable Document based DBMS that uses the The Key/Value Server based on the features of the Graph Databases to handle links. It's the Document Database technology and basic engine of all the Orient products. It can work in accessible as embedded repository schema-less mode, schema-full or a mix of both. via Java APIs or via HTTP using a RESTful API. Orient K/V uses a new Supports advanced features, such as indexing, fluent and algorithm called RB+Tree, derived SQL-like queries. It handles natively JSON and XML from the Red-Black Tree and from the documents. Developers can use Java native and HTTP B+Tree. RESTful APIs Orient Key/Value server can run in Graphs of hundreads of linked objects can be retrieved all high availability mode using a in memory in less than 1ms without executing costly JOINs cluster of multiple nodes partitioned. such as the Relational DBMSs do. For more information visit: http://www.orientechnologies.com
  • 5. Cluster concept Class “Profile“ has records distributed on multiple clusters. Class “Profile“ Class “Profile“ Cluster “FamousProfile“ Cluster “FamousProfile“ All the other Type = physical Type = physical profiles will be stored into the Jay Miner Bill Gates “OtherProfile“ cluster of type “logical“ The “FamousProfile“ cluster contains all the profile of the most famous people and it's supposed to being accessed frequently. This Cluster “Twit“ Cluster “OtherProfile“ is the reason why we selected Cluster “Twit“ Cluster “OtherProfile“ Type = physical Type = logical “physical“ as type. Type = physical Type = logical For more information visit: http://www.orientechnologies.com
  • 6. APIs OrientDB is written 100% in Java® and can run on any platform that supports the Java® Technology version 5 or more. OrientDB supports native Java client API to work with embedded or remote databases using the fast binary protocol OrientDB Server comes with a HTTP RESTful interface to being used from any language, even from the Internet Browser. Uses JSON to represents records For more information visit: http://www.orientechnologies.com
  • 7. Java example with records // OPEN THE DATABASE ODatabaseDocumentTx db = new ODatabaseDocumentTx("remote:localhost/demo").open("admin", "admin"); // CREATE A NEW DOCUMENT AND FILL IT ODocument doc = new ODocument(db, "Person"); This is a doc.field( "name", "Luke" ); relationship doc.field( "surname", "Skywalker" ); Many-to-One doc.field( "city", new ODocument("City" ).field("name","Rome").field("country", "Italy") ); // SAVE THE DOCUMENT doc.save(); // QUERY THE DOCUMENT Query using the List<ODocument> result = database.query( SQL syntax with new OSQLSynchQuery("select * from person where city.name = 'Rome'")).execute(); extensions to traverse links // PRINT THE RESULT SET for( ODocument d : result ){ without costly System.out.println("Person: " + d.field( "name" ) + d.field( "surname" )); JOINs } db.close(); For more information visit: http://www.orientechnologies.com
  • 8. Object Database interface Even if OrientDB is not an ODBMS (but is a Document DBMS), it offers the ODatabaseObject interface to works with POJOs in transparent way removing the Impedence Mismatch problem Fields not present in the real Java class will be not mapped but saved with the original record Queries convert automatically records to POJOs References between POJO can be stored as links (aka relationships) or by including the referenced object as embedded. For more information visit: http://www.orientechnologies.com
  • 9. Java example with POJOs // OPEN THE DATABASE ODatabaseObjectTx db = new ODatabaseObjectTx("remote:localhost/demo").open("admin", "admin"); // CREATE A NEW OBJECT AND FILL IT Person person = new Person(); Automatic person.setName( "Luke" ); binding from person.setSurname( "Skywalker" ); person.setCity( new City( "Rome", "Italy") ); POJO to record // SAVE THE OBJECT db.save( person ); Query returns directly List of POJO. Queries use the // QUERY THE OBJECT cache before to load the List<Person> result = database.query( records from the storage new OSQLSynchQuery("select from person where city.name = 'Rome'")); // PRINT THE RESULT SET for( Person p : result ){ System.out.println("Person: " + p.getName() + “ “ + p.getSurname() ); The POJOs } are usable as usually db.close(); For more information visit: http://www.orientechnologies.com
  • 10. HTTP RESTful API select from Profile where project = 'Amiga' HTTP RESTful protocol (JSON) OrientDB OrientDB { result : { _rec: 3:4, Server Server _ver: 2, name: “Jay”, surname: “Miner” }, Fast { _rec: 4:343, _ver: 0, binary protocol name: “Tim”, surname: “King” } } Java Java application application For more information visit: http://www.orientechnologies.com
  • 11. Security Encrypted password using “Reader“ Role SHA-256 algorithm Mode = Deny all but Rules: 2 modes: “allow database = Read all but” and “deny database.cluster.* = Read database.cluster.metadata = None all but” database.class.* = Read Each user has one or more roles “Publisher“ Role Default roles are: reader, writer and Mode = Deny all but admin “Admin“ Role Rules: Database.Cluster.cars = All Mode = Allow all but For more information visit: http://www.orientechnologies.com
  • 12. OrientDB Studio For more information visit: http://www.orientechnologies.com
  • 13. Orient Key/Value – Partitions in the Ring Backup=1 in configuration means that each node backup Keys range: S .. Z data synchronously on the next one. Back Node #1 up Keys range: 0 .. F Each node is owner of part of keys (Node up ck #1 the range S-Z) and Ba Ba ck is responsable to p u Node #2 synchronize them to the disk The last node in the Ring is the last Node #3 one started Keys range: G .. R For more information visit: http://www.orientechnologies.com
  • 14. Orient Key/Value – Update an entry The client (application or web-browser) connects to upd the owner node of the a te b Keys range: S .. Z entry to update and :Co ld p lay Back Node #1 up Keys range: 0 .. F to disk e sav p ku Ba c Ba ck p u Node #2 Node #1 is the owner of the updated entry: propagates changes to the local disk and to Node #3 backup node synchronously Keys range: G .. R For more information visit: http://www.orientechnologies.com
  • 15. Orient Key/Value – Fail Over Management The Backup of Node #1 is the Node #2. The Node #2 becames the Keys range: S .. Z owner and assures to write all the entries to the Disk Back Node #1 up Keys range: S .. F up ck Ba Ba ck save to d isk p u Other Nodes envolved Node #2 change the backup policies themselves. In this case Node #3 backups on Node #2 and viceversa Node #3 Keys range: G .. R For more information visit: http://www.orientechnologies.com