1 / 24

Common graph data problems

Common graph data problems. And how to solve them using Azure Cosmos DB Gremlin API. THR2053. Luis Bosquez Program Manager 2 lbosq@microsoft.com @_ lbosq. What’s the most important aspect of a new app?. Technology platforms are fairly equivalent.

doloresp
Télécharger la présentation

Common graph data problems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Common graph data problems And how to solve them using Azure Cosmos DB Gremlin API THR2053 Luis Bosquez Program Manager 2 lbosq@microsoft.com @_lbosq

  2. What’s the most important aspect of a new app? Technology platforms are fairly equivalent. Tooling and frameworks can be worked around. Application architecture challenges can evolve. But what about data?

  3. Data Design • Adapt our interpretation of reality in iterations. • Incremental approaches to an optimal data design for the business requirements. • But requirements aren’t static. • Ongoing balance of functionality, scalability, complexity and efficiency. • Database options provide various functionality to adapt to these requirements.

  4. Example 1 Fundamentals of Apache Tinkerpop

  5. Graph databases for data modellingFind out more at BRK3183 Luis vertex id: Luis label: person properties: • age: 26 edge id: edgeId label: worksAt properties: • distance: 2554miles objects language

  6. New England Patriots vertex label: team properties: - cheaters: true edge label: isPartOf National Football League vertex label: league properties: - country: USA - playersUseFeet: false edge label: cheatedOnYear Formation gate 2014 Deflategate 2015 PEDS 2016 IR-gate 2013 vertex label: event properties: - Severity: 2 vertex label: event properties: - Severity: 1 vertex label: event properties: - Severity: 3 vertex label: event properties: - Severity: 3

  7. New England Patriots vertex label: team properties: - cheaters: true edge label: isPartOf National Football League vertex label: league properties: - country: USA - playersUseFeet: false edge label: cheatedOnYear Formation gate 2014 Deflategate 2015 PEDS 2016 IR-gate 2013 vertex label: event properties: - Severity: 2 vertex label: event properties: - Severity: 1 vertex label: event properties: - Severity: 3 vertex label: event properties: - Severity: 3 edge label: ledTo Super Bowl 2014 vertex label: event properties: - tainted: true

  8. Example 2 Use case: Infrastructure Monitoring

  9. App Server (read) OLTP Database Monitoringservice Traffic Manager Data aggr. service App Server (write) ReportingDatabase Reports

  10. Example 3 Random Use Case: Six Degrees of Kevin Bacon

  11. No Way Out in Gene Hackman knows Sean Young knows https://github.com/cjoakim/travel

  12. Answers to business (?) questions What all actors have been in X given movie? g.V(['n41','nm0001742']).repeat(out().simplePath()) .until(hasId('nm0205626')).path().limit(3) g.V('tt9000001').in('in').values('name') How do you get from person X to person Y? Who is the most connected person? g.V().hasLabel('person').outE('knows').groupCount() .by(outV().values('name')).order(local).by(values, decr)

  13. Example 4 Random Use Case: Navigating LAX

  14. Counter clock-wise. • 1, 2, 3, B, 4, 5, 6, 7, 8. • Shuttles are always late. Running is usually really tempting. • From Arrival, change to upper level. • Go through security to get into Terminal for connecting flight. https://www.flylax.com/LAX-Terminal-Maps

  15. You have landed at LAX for your layover • You need to get from any given gate A to any given gate B, potentially switching terminals. • … but you’re hungry. So you need to stop at a restaurant first to get food to go. • … but you’re picky, so your restaurant selection has to comply with a minimum Yelp review. • But you still have to get to your destination gate within 30 minutes to board your next flight on time (hopefully to a better airport).

  16. T1 T2 T3 TB T8 T7 T6 T5 T4

  17. Cost (t) Terminal adjacency T2 T1 Terminals Contains Contains Cost (t) to from G4 G5 G6 G1 G2 G3 Gates Gate Adjacency Adjacency Restaurant proximity Restaurant proximity R4 R5 R6 R1 R2 R3 Restaurants Cost ($) Inefficient Airport V1

  18. Case 1: Stop at a restaurant in the terminal, then switch terminals, then get to your gate. g.V('g1') // Start from the gate you’ve arrived at. .out('toRestaurant’) // Pick a restaurant... .has('rating', gt(0.3)) // With at least 3 stars. .out('toTerminal').out('toNextTerminal') // Then, go to terminal 2. .out('toGate').has('id', 'g4') // Go to your destination Gate. .path().by('name') // Return the path and select all the names.

  19. Case 2: Switch terminals first, then stop at a restaurant and get to your gate. g.V('g1') // Start from the gate you’ve arrived at. .out('toTerminal').out('toNextTerminal') // Leave the terminal and go to the next one. .out('toRestaurant') // Pick a restaurant... .has('rating', gt(0.8)) // With at least 8/10 rating. .out('toTerminal') // Change terminals .has('id', 'g4') // Go to Gate 4. .path().by('name') // Return the entire path.

  20. Please evaluate this sessionYour feedback is important to us! Please evaluate this session through MyEvaluations on the mobile appor website. Download the app:https://aka.ms/ignite.mobileApp Go to the website: https://myignite.techcommunity.microsoft.com/evaluations

More Related