Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Grafos com TinkerPop3 e TitanDB - TDC2016

Grafos com TinkerPop3 e TitanDB - TDC2016

Da1bf5eb395c67b4abe83837e52a6c1f?s=128

Mike Dias

July 08, 2016
Tweet

Transcript

  1. Titan:db TinkerPop3 Grafos com e @mike_dias

  2. @mike_dias

  3. None
  4. Agenda • Grafos • TinkerPop3 • TitanDB

  5. Grafos

  6. mother name: hercules age: 30 type: demigod name: alcmene age:

    24 type: human name: jupter age: 5000 type: god father
  7. mother name: hercules age: 30 type: demigod name: alcmene age:

    24 type: human name: jupter age: 5000 type: god father Vertex
  8. mother name: hercules age: 30 type: demigod name: alcmene age:

    24 type: human name: jupter age: 5000 type: god father Edge
  9. mother name: hercules age: 30 type: demigod name: alcmene age:

    24 type: human name: jupter age: 5000 type: god father Property
  10. Property Graph

  11. Por que usar grafos

  12. Modelagem intuitiva

  13. Queries expressivas

  14. Casos de uso Recomendações personalizadas Influência social

  15. Casos de uso Melhor rota Detecção de fraude

  16. Quero usar grafos! #comofas?

  17. Apache TinkerPop • Vendor-agnostic graph compute framework • Gremlin -

    graph traversal language • Capacidades OLTP e OLAP
  18. Core API Graph graph = TinkerGraph.open();
 
 Vertex nosql =

    graph.addVertex("trilha");
 nosql.property("nome", "NoSQL");
 
 Vertex tdc2016 = graph.addVertex("evento");
 tdc2016.property("nome", "TDC 2016");
 
 Edge e = nosql.addEdge("compoe", tdc2016);
 e.property("data", "08/07/2016");
  19. Core API Graph graph = Neo4jGraph.open("...");
 
 Vertex nosql =

    graph.addVertex("trilha");
 nosql.property("nome", "NoSQL");
 
 Vertex tdc2016 = graph.addVertex("evento");
 tdc2016.property("nome", "TDC 2016");
 
 Edge e = nosql.addEdge("compoe", tdc2016);
 e.property("data", "08/07/2016");
  20. TinkerPop-enabled Vendors TitanGraph.open(…) Neo4jGraph.open(…) OrientGraph.open(…) StardogGraph.open(…) DSEGraph.open(…) BlazeGraph.open(…)

  21. Gremlin lang What are the names of Gremlin's friends' friends?

    g.V().has("name","gremlin").
 out("knows").
 out("knows").
 values("name")
  22. Gremlin console

  23. OLTP vs OLAP

  24. Spark computer graph = GraphFactory.open(…); 
 g = graph.traversal(). withComputer(SparkGraphComputer.class);

    g.V().hasLabel("person").groupCount().by("age")
  25. Giraph computer graph = GraphFactory.open(…); 
 g = graph.traversal(). withComputer(GiraphGraphComputer.class);

    g.V().hasLabel("person").groupCount().by("age")
  26. Gremlin server REST WebSockets

  27. Learn more http://sql2gremlin.com https://academy.datastax.com/courses/ds232-the-gremlin-graph-query-language https://academy.datastax.com/resources/getting-started-graph-databases http://tinkerpop.apache.org

  28. Meu grafo é muito grande. #comofas?

  29. Titan:db • Suporte nativo ao TinkerPop3 • Storages configuráveis •

    Licença Apache 2
  30. Backend flexível

  31. Titan:db + • Disponibilidade contínua sem ponto único de falha

    • Sem gargalos na leitura ou escrita no grafo • Escalabilidade elástica • Cache de dados frequentemente acessados
  32. • Leituras e escritas estritamente consistentes • Escalabilidade linear •

    Integração com o ecossistema Hadoop Titan:db +
  33. g.V().has('name',CONTAINS,'Bob') g.V().has('place',WITHIN,Geoshape.circle(37.97,23.72,50)) Full text & Geo Search

  34. Vertex centric index

  35. Graph partitioning

  36. Disclaimer

  37. Quem está usando?

  38. http://arli.us/edu-planet-scale

  39. http://arli.us/magazinaluiza

  40. http://arli.us/cisco-sec1

  41. http://pt.slideshare.net/Hadoop_Summit/t-235p230-ctang

  42. https://videos.dabcc.com/aws-reinvent-2015-dat203-building- graph-databases-on-aws/

  43. Concluindo… • Vários casos de uso resolvidos com Grafos •

    Quando for usar grafos, use TinkerPop3 • Titan transforma Big Data em Big "Graph" Data
  44. Obrigado! @mike_dias mike.rodrigues.dias@gmail.com Dúvidas?