Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

OrientDB introduction - NoSQL


Published on

Introduction to OrientDB NoSQL document dbms

Published in: Technology, Education
  • OrientDB is a graph database, so has the same features of OrientDB. Both Neo4J and OrientDB implements the TinkerPop Blueprints api:
    - Neo4J:
    - OrientDB:

    By the way OrientDB supports a higher level of adherence to the Blueprints model.

    About performance the number of records are not the only thing to analyze. OrientDB supports up to 9.223.372.036 Billions of records, but performance depends by indexes used, number of edges, etc.

    Are you sure you want to  Yes  No
    Your message goes here
  • Thank you for your response Luca, I’m looking into orientDB...

    Three more questions:
    a) I did some investigation on neo4j before, and I knew neo4j could entitle vertex and edges with custom attributes or behaviors, e.g. 'person' nodes, 'blog' nodes; person A 'knows' person B, person A 'created' Blog C.

    Is there similar features on OrientDB?

    b) Performance is always a big topic/issue for graph traverse. Neo4j mentioned that their graph performs well within 10 billion primitives, what about the performance of OrientDB?

    c) This question could be a little confidential - I knew there will be a bottleneck if we store large amount of edges in some table of RMDBS. What is the strategy and core idea for OrientDB to store those edges from a technique view?

    If you could not answer me here, you may
    Thanks in advance!
    Are you sure you want to  Yes  No
    Your message goes here
  • Comparing to Neo4J OrientDB is free for any use, has SQL and a lot of stuff more:

    Please refer to this presentation much more detailed:

    Neo4J as well has some features OrientDB hasn't (look to its site)
    Are you sure you want to  Yes  No
    Your message goes here
  • What is its advantage comparing to the project Neo4J?
    Are you sure you want to  Yes  No
    Your message goes here
  • very nice project
    Are you sure you want to  Yes  No
    Your message goes here

OrientDB introduction - NoSQL

  1. 1. “A NoSQL Database for the Internet age” Author of OrientDB and Roma Luca Garulli Luca Garulli Framework Open Source projects, CTO at Asset Data company, Technical Manager at Romulus consortium
  2. 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:
  3. 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:
  4. 4. Database structure
  5. 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:
  6. 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:
  7. 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; // QUERY THE DOCUMENT Query using the List<ODocument> result = database.query( SQL syntax with new OSQLSynchQuery("select * from person where = '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:
  8. 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:
  9. 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 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 = '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:
  10. 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:
  11. 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: = All Mode = Allow all but For more information visit:
  12. 12. OrientDB Studio For more information visit:
  13. 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:
  14. 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:
  15. 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: