Graph Databases and SQL Server 2017
By John Staveley
25/01/2018
https://uk.linkedin.com/in/johnstaveley/
@johnstaveley
Overview
What are graph databases?
Why not relational?
Applications of graph databases
Setting up SQL Server 2017
Demo
Summary
What is a graph database?
Node
Edge
Where relations between data matter more than the data
itself
Examples:
Nodes:

People

Cities
Edge

Likes

Lives In

Travel Distance
What is a graph database?
Why not relational?
Modelling friends and friends of friends relationally
Who are bob's friends? OK
Who is friends with bob? (OK but requires table scan of
PersonFriend)
Who are the friends of my friends? (Not Ok – requires
recursive joins)
Applications
Where relations between data matter more than the data itself
Product recommendations
Fraud Detection
Supply chain/ airline visibility and planning
Social web
Understanding customers
Network planning
Demo
Start up docker
Pull SQL Server 2017 image
docker pull microsoft/mssql-server-linux:2017-latest
Start up SQL Server on docker
docker run -e 'ACCEPT_EULA=Y' -e
'MSSQL_SA_PASSWORD=<securepassword>' -e 'MSSQL_PID=Developer' -p
1401:1433 --name sqlserver1 -d microsoft/mssql-server-linux:2017-latest
Connect to SQL Server using SSMS
Create nodes
Create edges
Query MATCH syntax
Notes
No support in Entity framework
CosmosDb (Gremlin syntax, supported in .Net)
Neo4J (integrates with .Net)
Visualisation: Linkurious, Keylines, sigmajs, D3, yWorks,
CytoScope
Summary
 SQL Server Graph capabilities are easy to set up and run
 Graph functionality provides useful new capabilities
 https://docs.microsoft.com/en-us/sql/linux/quickstart-install-
connect-docker
 https://docs.microsoft.com/en-us/sql/relational-
databases/graphs/sql-graph-sample
 Free eBook (http://graphdatabases.com/)
Summary
 SQL Server Graph capabilities are easy to set up and run
 Graph functionality provides useful new capabilities
 https://docs.microsoft.com/en-us/sql/linux/quickstart-install-
connect-docker
 https://docs.microsoft.com/en-us/sql/relational-
databases/graphs/sql-graph-sample
 Free eBook (http://graphdatabases.com/)

Graph databases and SQL Server 2017

  • 1.
    Graph Databases andSQL Server 2017 By John Staveley 25/01/2018 https://uk.linkedin.com/in/johnstaveley/ @johnstaveley
  • 2.
    Overview What are graphdatabases? Why not relational? Applications of graph databases Setting up SQL Server 2017 Demo Summary
  • 3.
    What is agraph database? Node Edge Where relations between data matter more than the data itself Examples: Nodes:  People  Cities Edge  Likes  Lives In  Travel Distance
  • 4.
    What is agraph database?
  • 5.
    Why not relational? Modellingfriends and friends of friends relationally Who are bob's friends? OK Who is friends with bob? (OK but requires table scan of PersonFriend) Who are the friends of my friends? (Not Ok – requires recursive joins)
  • 6.
    Applications Where relations betweendata matter more than the data itself Product recommendations Fraud Detection Supply chain/ airline visibility and planning Social web Understanding customers Network planning
  • 7.
    Demo Start up docker PullSQL Server 2017 image docker pull microsoft/mssql-server-linux:2017-latest Start up SQL Server on docker docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=<securepassword>' -e 'MSSQL_PID=Developer' -p 1401:1433 --name sqlserver1 -d microsoft/mssql-server-linux:2017-latest Connect to SQL Server using SSMS Create nodes Create edges Query MATCH syntax
  • 8.
    Notes No support inEntity framework CosmosDb (Gremlin syntax, supported in .Net) Neo4J (integrates with .Net) Visualisation: Linkurious, Keylines, sigmajs, D3, yWorks, CytoScope
  • 9.
    Summary  SQL ServerGraph capabilities are easy to set up and run  Graph functionality provides useful new capabilities  https://docs.microsoft.com/en-us/sql/linux/quickstart-install- connect-docker  https://docs.microsoft.com/en-us/sql/relational- databases/graphs/sql-graph-sample  Free eBook (http://graphdatabases.com/)
  • 10.
    Summary  SQL ServerGraph capabilities are easy to set up and run  Graph functionality provides useful new capabilities  https://docs.microsoft.com/en-us/sql/linux/quickstart-install- connect-docker  https://docs.microsoft.com/en-us/sql/relational- databases/graphs/sql-graph-sample  Free eBook (http://graphdatabases.com/)