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 - the 2nd generation of (MultiModel) NoSQL - Luigi Dell Aquila - Codemotion Amsterdam 2016

269 views

Published on

In last years NoSQL experienced a huge upward trend, offering new data models to solve problems where old RDBMS failed. Now people who have chosen NoSQL as an architecture component, realize that a single data model (even when richer that relational), is not enough for average needs. We will discuss why graph databases are at the heart of the multi-model revolution and why we're approaching the end of NoSQL's fragmented ecosystem where customers are forced to use multiple tools in their architectures. Benefits and compromises of this approach along with real world use cases will also be shared.

Published in: Technology
  • Be the first to comment

OrientDB - the 2nd generation of (MultiModel) NoSQL - Luigi Dell Aquila - Codemotion Amsterdam 2016

  1. 1. - the 2nd generation of (Multi-Model) NoSQL - the 2nd generation of (Multi-Model) NoSQL And why GraphDB are the And why GraphDB are the  starting point of this revolutionstarting point of this revolution
  2. 2. #OrientDB Andrea Iacono Software Engineer OrientDB http://www.orientdb.com
  3. 3. #OrientDB How many of you have already used NoSQL technology? How many of you are familiar with Graph Databases? How many of you are already familiar with OrientDB? Before We Start…
  4. 4. #OrientDB “90% of the data  in the world today  has been created  in the last two years alone.”  ­ IBM
  5. 5. #OrientDB Order #134 (Order) Order #134 (Order) John (Provider) John (Provider) CBM Amiga 500 (Product) CBM Amiga 500 (Product) Frank (Customer) Frank (Customer) Monitor 40” (Product) Monitor 40” (Product) Mouse (Product) Mouse (Product) Bruno (Provider) Bruno (Provider)
  6. 6. #OrientDB Order #134 (Order) Order #134 (Order) John (Provider) John (Provider) CBM Amiga 500 (Product) CBM Amiga 500 (Product) Frank (Customer) Frank (Customer) Monitor 40” (Product) Monitor 40” (Product) Mouse (Product) Mouse (Product) Bruno (Provider) Bruno (Provider) Data by itself has little value, it’s the relationship between data that gives it incredible value
  7. 7. #OrientDB CBM Amiga 500 (Product) CBM Amiga 500 (Product) (Sells) Frank (Customer) Frank (Customer) (Has) (Makes) Monitor 40” (Product) Monitor 40” (Product) (Sells)(Has) Mouse (Product) Mouse (Product) (Sells) (Has) Order #134 (Order) Order #134 (Order) John (Provider) John (Provider) Bruno (Provider) Bruno (Provider)
  8. 8. #OrientDB Key/Value Databases Document Databases Graph Databases Column Databases
  9. 9. #OrientDB Key/Value Databases Document Databases Graph Databases Column Databases
  10. 10. #OrientDB Why do most NoSQL products avoid managing relationships?
  11. 11. #OrientDB ID Name 10 John 11 John 24 Mike 28 Mike CustomerID CityID 10 24 10 33 32 44 ID City 24 Milan 33 London 18 Paris 18 Madrid 44 Moscow Customers CustomersCities Cities
  12. 12. #OrientDB What’s wrong with JOIN?
  13. 13. #OrientDB ID Name 10 John 11 John 24 Mike 28 Mike CustomerID CityID 10 24 10 33 32 44 ID City 24 Milan 33 London 18 Paris 18 Madrid 44 Moscow Customers CustomersCities CitiesJoins are executed every time you cross relationships Querying million of records  joining 3­4 tables could  generate billions of  combinations
  14. 14. #OrientDB This is why the database query performance suffers as the database increases in size O(Log N)
  15. 15. #OrientDB RDBMS performance on traversal
  16. 16. #OrientDB Solution: Graph Database!
  17. 17. #OrientDB Graph Theory crash course
  18. 18. #OrientDB Basic Graph Andrea Rome
  19. 19. #OrientDB Vertices are directed * https://github.com/tinkerpop/blueprints/wiki/Property-Graph-Model Property Graph Model* Rome country: Italy Andrea company: OrientDB Vertices and Edges can have properties Visited year: 2016
  20. 20. #OrientDB Andrea Rome Visited year: 2012 An Edge connects only 2 vertices Use multiple edges to represent 1-N and N-M relationships Worked year: 2016 1­N and N­M Relationships
  21. 21. #OrientDB Congrats! This is your diploma in «Graph Theory»
  22. 22. #OrientDB How does a true* Graph Database manage relationships? *a “Graph” layer on top of a DBMS doesn’t qualify as a true GraphDB
  23. 23. #OrientDB Andrea RomeRome Visited year: 2012 #13:55 #15:99 Each element in the Graph has own immutable Record ID Each element in the Graph has own immutable Record ID #22:11 (Edge) (Vertex) (Vertex) Each element in the Graph has own immutable Record ID Each element in the Graph has own immutable Record ID Each element in the Graph has own immutable Record ID Each element in the Graph has own immutable Record ID
  24. 24. #OrientDB Connections use persistent pointers Connections use persistent pointers Andrea RomeRome Visited on: 2012#13:55 #15:99 out = #22:11 in = #22:11 #22:11 (Edge) (Vertex) (Vertex) src = #13:55 dst = #15:99
  25. 25. #OrientDB Andrea RomeRome Visited on: 2012#13:55 #15:99 out = #22:11 in = #22:11 #22:11 (Edge) (Vertex) (Vertex) src = #13:55 dst = #15:99
  26. 26. #OrientDB Andrea RomeRome Visited on: 2012#13:55 #15:99 out = #22:11 in = #22:11 #22:11 (Edge) (Vertex) (Vertex) src = #13:55 dst = #15:99
  27. 27. #OrientDB A Graph Database creates the relationship just once (when the edge is created) VS RDBMS computes the relationship every time you query a database
  28. 28. #OrientDB When you move from a RDBMS to a Graph Database you jump from a O(log N) speed to a near O(1) With a Graph Database, the traversing time is not affected by database size! This is huge in the BigData age
  29. 29. #OrientDB No costs to traverse relationships: • Recommendation engines • Social Applications • Spatial Apps • Master Data Management • Information Clustering John Thriller Comedy Pulp Fiction Mr Bean Theater B Theater A Theater C NYC San Josè Lives in Likes Likes Has Has Is Is Plays Has Plays
  30. 30. #OrientDB So the Graph Model Is the only solution to efficiently manage relationships But what about data complexity? And data consistency? And scaling?
  31. 31. #OrientDB Relationships Complexity > Data Complexity > Relational Key Value Column Graph Document First Generation NoSQLFirst Generation NoSQL
  32. 32. #OrientDB First Generation NoSQL: Polyglot PersistenceFirst Generation NoSQL: Polyglot Persistence RDBMSRDBMS Key/Value StoreKey/Value Store Document Database Document Database Graph Database Graph Database ApplicationApplication ETL             
  33. 33. #OrientDB Key/Value StoreKey/Value Store Document Database Document Database Graph Database Graph Database ApplicationApplication ETL              First Generation NoSQL: Polyglot PersistenceFirst Generation NoSQL: Polyglot Persistence - No standard between NoSQL Products - Multiple vendors = multiple skills - ETL + synchronization code is expensive to write and maintain - Performance and Reliability is hard to predict RDBMSRDBMS
  34. 34. #OrientDB 2nd Generation NoSQL is Multi-Model 2nd Generation NoSQL is Multi-model
  35. 35. #OrientDB What’s a Multi­Model DBMS?What’s a Multi­Model DBMS? GraphDocument Object Key/Valu e Multi-Model represents the intersection of multiple models in just one product Full-Text Spatial
  36. 36. #OrientDB What’s a Multi­Model DBMS?What’s a Multi­Model DBMS? GraphDocument Object Key/Valu e Full-Text Spatial - Just one product to learn and maintain - Just one vendor relationship to manage - No ETL, no synchronization required - Performance and Reliability is easy to test from the beginning - Just one product to learn and maintain - Just one vendor relationship to manage - No ETL, no synchronization required - Performance and Reliability is easy to test from the beginning Multi-Model represents the intersection of multiple models in just one product
  37. 37. Confidential Polyglot vs Multi­model Polyglot (NoSQL 1.0) Multimodel (NoSQL 2.0) Polyglot Persistence is a fancy term to mean that when storing data, it is best to use multiple data storage technologies, chosen based upon the way data is being used by individual applications or components Multi-model databases are intended to offer the data modeling advantages of polyglot persistence without its disadvantages. complexity, in particular, is reduced. The first multi-model database was OrientDB. https://en.wikipedia.org/wiki/Multi­model_databasehttp://www.jamesserra.com/archive/2015/07/what­is­polyglot­persistence/ ECOMMERCE PRODUCT CATALOG SHOPPING CART RECOMMENDATI ON ECOMMERCE PRODUCT CATALOG SHOPPING CART RECOMMENDATI ON TRANSACTIONA L TRANSACTIONA L SEARCH SEARCH SPATIAL SPATIAL
  38. 38. #OrientDB ` { ”@rid": “12:382”, ”@class": ”Customer", “name”: “Frank”, “surname” : “Raggio”, “phone” : “+39 33123212”, “details”: { “city”:”London", “tags”:”millennial” } } Frank Order M akes General purpose solution: • JSON • Schema-less • Schema-full • Schema-hybrid • Nested documents • Rich indexing and querying • Developer friendly
  39. 39. #OrientDB - @ldellaquila Second Generation NoSQL RelationshipComplexity> Data Complexity > Relational Key Value Column Graph Document Multi-Model
  40. 40. #OrientDB With a true Graph, Document and Object Oriented engine
  41. 41. #OrientDB •Support for TinkerPop standard for  Graph DB: Gremlin language and  Blueprints API •SQL + extensions for graphs •JDBC driver to connect any BI tool •HTTP/JSON support •Drivers in Java, Node.js, Python,  PHP, .NET, Perl, C/C++ and more API & Standards
  42. 42. #OrientDB - @ldellaquila • OrientDB footprint is minimal and the embedded version can run with few MB of RAM • OrientDB needs a Java Run Time • When run distributed, OrientDB uses Hazelcast (Apache2 licensed) library embedded Requirements and Dependencies
  43. 43. #OrientDB - @ldellaquila • Basic HTTP authentication (+HTTPS/SSL) • User/Role authentication system. One User can have multiple Roles • Privileges are managed in Roles • Roles can inherit from other Roles • Record-level security: every record can contain the user/role can create/read/update/delete the record • Auditing available in Enterprise Edition Security
  44. 44. #OrientDB - @ldellaquila • HTTPS/SSL • Starting from OrientDB v2.2: - Support for Kerberos - Encryption at REST using AES and DES of the entire database or portions - PBKDF2 HASH algorithm with a 24-bit length Salt per user for a configurable number of iterations Encryption
  45. 45. #OrientDB - @ldellaquila • Full Backup and Restore • Delta Backup (v2.2) Enterprise Edition and Restore is available • Studio web tool • Command line Console Administration
  46. 46. #OrientDB - @ldellaquila • Import/Export in JSON • Import from SQL script • OrientDB ETL tool (http://orientdb.com/docs/last/ETL-Introduction.html) • Teleporter (v2.2) Data Extraction and Loading
  47. 47. #OrientDB - @ldellaquila • Multi-Master architecture • Tunable consistency through the usage of a quorum, per database or single class (table) • Synchronous and Asynchronous replication • Zero config: if multicast is enabled the server is attached to the cluster Scale out and HA
  48. 48. #OrientDB Master Node Master Node Master Node Master Node CC CC CC CC CCCC CC Multi-master Replication Atomic, Consistent, Isolated and Durable (ACID) multi­statement transactions
  49. 49. #OrientDB Master Node Master Node Master Node Master Node CC CC CC CC CCCC CC Auto- Discovered Node Auto- Discovered Node
  50. 50. #OrientDB ArchitecturesArchitectures
  51. 51. #OrientDB Udemy Getting Started Training is  ★★★★★ and Free http://www.orientechnologies.com/getting­started OrientDB Enterprise is Free for  Development OrientDB Community is FREE for any  purpose (APACHE 2 license)
  52. 52. #OrientDB DEMO
  53. 53. #OrientDB Thank you! Q/A

×