Share
Embed
WWC Connect BLR
_themessier
March 03, 2017
Transcript
19 slides
-
Nodes: M-Member c - City C - Country XYZ- Organization
Edges: D - Director F - Founder B - BoD W- Works at 50K+ -Members 60 -Cities 20 -Countries -
Agenda 1. What is a graph database? 2. What about
our dear RDBMS 3. What the hell is gremlin? 4. Features and use cases of gremlin 5. Demo Women Who Code -
What is Graph DB? ❖A graph is a collection of
vertices and edge. G=(V,E) ❖A graph DB is a system that helps us store, retrieve and consume data in a graph structured format ❖USP- Relationship Women Who Code Vertex 2 [properties] Vertex 1 [properties] Edge [properties] -
WWC Graph - A Dummy ❖ Entities ➢ People ➢
Cities, Countries ➢ Organizations ❖ Relations ➢ Person -- founder---WWC ➢ Person -- BOD---WWC ➢ Person---Director---City ➢ Person--Member---City ➢ Person--Knows--Person Women Who Code -
Why not our dear RDBMS :/ Women Who Code Name
Founder A Yes B Yes C D E F G 1. In order to find the founders, must have a column with most rows empty 2. In order to map names to cities, perform costly join operations 3. RDBMS is useful for transactional data 4. How to map real time relations between person A and person B? -
So… What the hell is Gremlin?? Framework: TinkerPop DSL: Gremlin
Wrapper: Gremlin-python Driver: SQL-Gremlin -
Features of Gremlin • Provides backend transparency BECAUSE • Does
NOT provide schema management queries • Based on functional programming • Returns the result as an iterator • Default- Edges are directional • Support all primitive Java data types out of the box • +Many more! -
Use Cases for TinkerPop-Gremlin 1. Experiment with different graph stores
without affecting your query logic 2. Switch context between OLAP and OLTP 3. Support from open source + enterprise -
Pros and Cons with Gremlin Pros ❖ Open source! ❖
Vendor agnostic ❖ Wrapper and driver support for many languages ❖ Intuitive Cons ❖ Just a DSL not a programming language ❖ No out of box support for schema and indexing ❖ Wrappers are slow -
Example Query 1 Who are the founders and Board of
directors of WWC? Step 1: Go to the WWC org node Step 2 : Find out those people who are connected with the WWC org Step 3: Filter out those people who have an edge with label founder or BOD g.V().hasLabel(‘Org).has(‘name’,’WWC’).inE(‘founder_of’,bod_at’).outV().values(‘name’) -
Nodes: M-Member c - City C - Country XYZ- Organization
Edges: D - Director F - Founder B - BoD W- Works at -
Example Query 2 WWC Directors who are less than 30
years old Step 1: Find all the people who are WWC directors Step2: Filter them by property age<30 g.V().hasLabel(‘Person’).outE(‘director_of’).inV().has(‘age’,lt(30)).values(‘name’) -
Nodes: M-Member c - City C - Country XYZ- Organization
Edges: D - Director F - Founder B - BoD W- Works at -
How can Gremlin help WWC? 1. Suggest friends on social
media to members of same chapter 2. page Rank the most influential people in WWC network 3. Track growth of chapters 4. Personalize job recommendation 5. Mentor-Mentee opportunity Awesome WWC -
References 1. TinkerPop 2. Tinkerpop -Gremlin Getting started 3. Gremlin-Titan-Dynamo
Setup 4. Gremlin -Python 5. Demo Source Code