[MUSIC]
Hello everyone, my name is Shreya Verma, I'm
program manager with SQL Server and I'm currently focusing on Graphs.
And today, we are going to talk about the Graph extensions that we
have made to SQL Server next.
So let's talk about why Graph Databases are important.
People have been using Graph Databases in social networks and
the networking systems and logistics for a while now.
But recently, they have been garnering a lot of popularity among
systems like supply chain management, or sales data,
where they can use for recommendation engines,
like people who bought this also bought this kind of systems.
So what is so unique about Graph Databases that make them so
popular among different systems?
So Graph Database allows you to store relationships.
And relational database also allows you to store entities and
relationships, but
the relationships in relation databases are one too many.
And Graph Databases would allow you to store many-to-many relationships.
For example, a person known in a social network graph can like
an organisation, can like another person, or like on LinkedIn,
you can like another article node.
So it allows you to do many to many relationships.
They also allow you to analyze interconnected data and
identify non-obvious connections in your schema
which helps you to materialize new information from existing facts.
For example, let say the tree, coniferous tree in my backyard
is a pine tree and we know that pine trees were green tree.
Then from this information I can draw
conclusions that the coniferous tree in my backyard is evergreen variety.
So now let's talk about graph extensions that we have added to
SQL Server vNext.
With vNext, we will allow users to create graph objects.
That means now you can create your graph schema
that is create nodes and edges.
There can be properties associated to these nodes and edges.
On the slide you can see very simple graph schema for
find me a preschool app.
You can see the new syntax for create table as a node,
we are creating a parent node and a city node.
And we are creating two edges, livesIn and friends.
So every time you create a node in node table in SQL,
there will be one implicit column, node ID, created for
you which will uniquely identify every node in the system.
And every time you create an EDGE there will be three implicit
columns.
EDGE ID, form ID, and two ID,
which will tell you which nodes this EDGE particularly connects.
And edge may or may not have any attributes associated to it like in
the example you can see that livesIn EDGE does not have any attributes
associated to it.
There are some query language extensions that we have added to
SQL Server vNext which will allow you to do pattern matching and
multi hub navigation through your graph.
In the example here, listed on the slide we can see that I'm trying to
figure out, find all my friends who live in the city of Seattle.
So in a query you can see the new match predicate that we have added
which has a pattern which I am searching for through the graph.
It just says find me or my friends that live in the city of Seattle.
The match pattern goes from a node to another node via an edge,
anything that is inside the parenthesis in that match pattern
is an edge.
The entities listed on the ends of the arrows are nodes in my graph.
This is fully integrated in SQL Server engine queries, if
you have your relational schema and graphs schema in the same database.
Queries can look up against existing SQL database tables and
graph nodes and edges.
And you can also have queries that go across your graph, nodes, and
edges and tables.
Along with the storage, along with this, you also get the benefits
of advanced technologies that SQL Server currently supports
like Column Store, Advanced Analytics, Machine Learning and so
and so forth, high availability among one of those.
And so you just need to have one system where you run your relational
and graph applications together and take benefit of the already existing
technologies that we have in the engine.
Since this is integrated fully in SQL Server engine, this supports
all security and compliance features the SQL Servers supports today.
So it will be fully enterprise grade software.
You get the entire tooling and
ecosystem of our SQL graph that you get with SQL Server engine.
For example tools like backup and restore, import and
export would just work out of the box.
With that, just let's move on to a small demo that we have prepared.
It's a small demo for a social network app called Find me Preschool
and this will just help the parents find a preschool based on what
preschool their friends have liked or they are sending their kids to.
And all the records in this schema that you see here are nodes.
Like there is a parent node, there's a child node, pre-school node,
city node, home day care node.
And all the arrows that you see here in schema
are the edges in my system.
Like a parent could be spouse of another parent or
could be friend of another parent.
A parent lives in a city, pre-school is located in a city and
a parent is member of a preschool or a daycare.
And parent is parent of child.
So let's get to our schema, I have already created a database and
created the tables for the nodes and edges.
You can see that I have just used the as North syntax to create
the node and Isaac syntax to create the edges may or
may not have any attributes to it,
like the spouseOf edge here does not have any attributes.
While isMember edge has some attributes,
here's a different attributes associated to it.
I've already populated some data in this schema.
Now let's say I want to find out all the preschools
located in the city of Seattle.
So I just use the new match predicate to find my pattern.
And I want to filter on the city of Seattle.
This match predicate will find me all the preschools that are located
in any city, but then later on I'm filtering on the city of Seattle.
So let's execute that.
And this tells me all the preschools that are located in city of Seattle.
Let's say I want to find out all the people in this
app who are sending their kids to a preschool in the city of Seattle.
So I'll execute this query.
This finds me all the people who are sending their kids to preschool
that is located in the city of Seattle, so I run this query and
I find out that these four people are sending their kids to preschool.
Now out of all these people I want to find out my friends
who send their kids to a preschool in Seattle,
because I might be interested in sending my child to
the same preschool as that of my friends.
So let's say Ron is a person in my graph and he wants to find out all
his friends that are sending their kids to a preschool in Seattle.
And Ron finds out that Bob and Mary they send their children
to Learning Word School which is in Seattle.
And now he wants to find out which is the top rated school
in the city of Seattle.
So we just write a query, we order by rating, and we find out
that Lakewood Montessori is the top rated school, most people like them.
One of the scenario which is interesting and which is used by
many systems for graph databases it the recommendation and
engine kind of scenario, people who bought this also bought this.
So I have tried to replicate that kind of scenario here, for example,
we want to find out any school which has been top rated
by people if they also like some other school in the city.
Then we want to find all people who like this school
who also like other school.
Because I might not be in the same neighborhood as that school and
I might want to send my kids to a school which
is closer to my neighborhood.
So I would like to find out people who have rated other schools also
nicely or my friends who have rated other schools also very well.
Then I can just run this query and find out.
And if you notice in this query that arrows in the match class can go in
either direction depending on the direction of your edge
in your schema.
One more thing to note is that this
pattern in the match class can be as long as you want.
But it always goes from a node to another node via an edge.
We are very excited to do these graph extensions to SQL Server.
We hope that you like it and you find it useful for
your applications.
Thank you for your time, we look forward to working with you on this.
[MUSIC]