The Graph revolution How to change the way you think about NSFs and achieve Nirvana Nathan T Freeman...

download The Graph revolution How to change the way you think about NSFs and achieve Nirvana Nathan T Freeman - #ChiefArchitect @RedPillDevelopment.

If you can't read please download the document

Transcript of The Graph revolution How to change the way you think about NSFs and achieve Nirvana Nathan T Freeman...

  • Slide 1
  • The Graph revolution How to change the way you think about NSFs and achieve Nirvana Nathan T Freeman - #ChiefArchitect @RedPillDevelopment
  • Slide 2
  • Mission
  • Slide 3
  • The Numbers Problem Thousands of data silos (NSFs) Hundreds of indexes in each Thousands of documents in each
  • Slide 4
  • The Logic Problem Data schemas in the UI Limited serialization Relationships are a lot of work
  • Slide 5
  • What is a graph database? Elements (vertexes and edges) Key/Value pairs Index-free adjacency
  • Slide 6
  • Who are some graph databases? NEO4J OrientDB Apache Giraph
  • Slide 7
  • Why use graphs? SpeedScalabilityIntuitive
  • Slide 8
  • People graph Nathan knows Mac
  • Slide 9
  • Movie graph portrays appearsIn stars The Matrix Keanu Reeves Neo
  • Slide 10
  • What is an NSF ? Documents Item-value pairs Appalling bad indices
  • Slide 11
  • Graph & NSF
  • Slide 12
  • OpenNTF Domino API Documents with keys (Serializable -> MD5 -> UNID) Auto-type coercion Document implements Map includes Document.get(fname + \ \ lname)
  • Slide 13
  • A Single NSF with Hundreds of thousands of vertices Millions of edges
  • Slide 14
  • A question If each Vertex is a Document, why cant every Document be a Vertex?
  • Slide 15
  • The dream Tens of millions of enterprise documents. Decades of accumulated knowledge. One big warehouse. No migration required.
  • Slide 16
  • Implementation 2.0 Vertexes need models ; models are hard. Graph must consume many NSFs UniversalID not enough; need MetaversalID Cant modify some Vertexes
  • Slide 17
  • Tinkerpop.frames @TypeField("form") @TypeValue("Person") public interface User extends VertexFrame { @TypedProperty("FirstName") public String getFirstName(); @TypedProperty("FirstName") public void setFirstName(String firstName); @IncidenceUnique(label = likes) public Iterable getLikes(); @IncidenceUnique(label = likes) public Edge addLikes(Vertex vertex); }
  • Slide 18
  • Graph sharding One graph can have many element stores (NSFs) Element stores based on Frame interfaces Stores respect ACLs and can cross servers Can store vertexes and/or edges Proxy shards separate graph data from core properties
  • Slide 19
  • The Numbers Problem Thousands of data silos (NSFs) Hundreds of indexes in each Thousands of documents in each Millions of vertexes across the enterprise No indexes needed
  • Slide 20
  • The Logic Problem Schemas are defined with Java interfaces Anything can be written to any key/value pair Relationships are trivial
  • Slide 21
  • Mission
  • Slide 22
  • Okay, great. So HOW? OpenNTF Domino API makes NSF into a multi-model database NSF as Document database NSF as Map container NSF as Graph database NSF as Java object database
  • Slide 23
  • WARNING!!!! Everything you are about to see is still in testing Use at your own risk We love feedback, but not panic
  • Slide 24
  • Document model Document doc = database.getDocumentWithKey(Nathan Freeman); doc.replaceItemValue(form, Contact); doc.replaceItemValue(firstName, Nathan); doc.replaceItemValue(lastName, Freeman); doc.save(true, true); String fullName = doc.getItemValueString(firstName) + + doc.getItemValueString(lastName);
  • Slide 25
  • Map model Map doc = database.getDocumentWithKey(Nathan Freeman); doc.put(form, Contact); doc.put(firstName, Nathan); doc.put(lastName, Freeman); doc.save(true, true); String fullName = doc.get(firstName + \ \ + lastName);
  • Slide 26
  • Graph model Vertex doc = graph.addVertex(Nathan Freeman); doc.setProperty(form, Contact); doc.setProperty(firstName, Nathan); doc.setProperty(lastName, Freeman); graph.commit(); String fullName = doc.getProperty(firstName + \ \ + lastName);
  • Slide 27
  • Object model Contact doc = framedGraph.addVertex(Nathan Freeman, Contact.class); doc.setFirstName(Nathan); doc.setLastName(Freeman); framedGraph.commit(); String fullName = doc.getFullName();
  • Slide 28
  • Framing @TypeField("form") @TypeValue("Contact") public interface Contact extends VertexFrame { @TypedProperty("firstName") public String getFirstName(); public void setFirstName(String firstName); @TypedProperty("lastName") public String getLastName(); public void setLastName(String lastName); @TypedProperty(derived=true, value="firstName + \" \" + lastName") public String getFullName(); }
  • Slide 29
  • Setting up the graph Graph graph = org.openntf.domino.graph2.builtin.BasicGraphFactory.ge tGraph(graph.nsf); TOO EASY?
  • Slide 30
  • Setting up a framed graph DElementStore contactStore = new DElementStore(); contactStore.setStoreKey(contacts.nsf); contactStore.addType(Contact.class); DConfiguration config = new DConfiguration(); config.addElementStore(contactStore); DFramedGraphFactory factory = new DFramedGraphFactory(config); DGraph graph = new DGraph(config); factory.create(graph); A little harder
  • Slide 31
  • Examples org.openntf.domino.graph2.builtin.social http://bit.ly/1Ea0ud2 org.openntf.domino.tests.ntf.Graph2Demo http://bit.ly/19Y2p8b org.openntf.conference.graph.examples http://bit.ly/19pdaiz com.redpill.model.forensics sorry, no
  • Slide 32
  • Thank you! Please provide feedback at https://github.com/OpenNTF/org.openntf.domino/issues