Bring clarity to complex data with graph databases on SQL Server 2017

SQL Server 2017, in addition to processing relational data, now fully integrates with graph database models, all on the same familiar system. This will bring clarity to the increasing amounts of data businesses generate every day.

What’s the difference between graph and relational databases?

Relational databases, like SQL Server, use foreign keys to manage relationships between entities and tables. Foreign keys adequately query one-to-many relationships; however, as relationships between various data entities become more complex, queries also become more complex and performance may diminish as a result.

In these cases, developers may opt for graph database models to manage complex relationships and enable operational agility. In a graph database, edges are heterogeneous in nature—a single edge can be used to connect different type of nodes to each other. This is not easy to achieve using foreign keys in a relational database. For example, consider a social graph where a person (node) likes another person (edge) or organization (node) or restaurant (node). Here the same ‘likes’ edge is used to connect three different types of nodes and entities to each other—person to person; person to organization; and person to restaurant.

So, how do graph databases work?

Graph databases are comprised of a collection of nodes and edges. Nodes represent a given entity (a noun), while edges (a verb) represent the relationship between the two nodes they connect. For example, pitcher Randy Johnson (node) faces (edge) batter John Kruk (node).

When do you choose a graph database model over a relational model?

While graph and relational schema are capable of achieving the same ends, graph models make it easier to express certain queries. Since it’s easier to manage many-to-many relationships, graph models are better suited for applications where relationships between data entities are the focus. They’re also better for applications that need to traverse connected data sources to generate insights, such as applications with hierarchical data where the queries may involve traversing the hierarchies. Graph databases allow you to express traversal or navigation queries easily, using join-free pattern matching.

The T-SQL Graph extension offers the best of both worlds.

If you’ve already licensed SQL Server 2017, there’s no need to purchase a second system to manage more complex database needs. SQL Server 2017 fully integrates with Transact-SQL (T-SQL) to create and query graph objects. Maintain your existing SQL Server database and benefit from pairing graph capabilities with other SQL Server technologies like columnstore, HA, R services, and others. SQL graph database also supports all the security and compliance features available with SQL Server.

Download and try SQL Server 2017 on the platform of your choice today, and see for yourself.