Book Review: Getting Started with Graph Query Language (GQL)

Another book that I recently received for review from my friends at PackT Publishing was Getting Started with Graph Query Language (GQL) by Ricky Gun, Jason Zhang, and Yuri Simione.
The subtitle is The complete guide to designing, querying, and managing graph databases with GQL.
I’ve worked with a number of graph-based databases over the years and I was interested to see where GQL is heading.
SQL Server Graph
In 2017, graph databases were all the rage, and so I wasn’t surprised when the SQL Server team decided to implement graph functionality within SQL Server.
I didn’t like how they did this in SQL Server.
For me, it really felt like a we need to have this as well offering, rather than a really serious offering.
A big part of the problem was that the team needed to fit within the bounds of T-SQL and you just can’t do that easily, or at least not with its current limitations. To give you an example, if I have a graph where I have people and things they like (the entities), the things might be restaurants, books, movies, etc. And a real graph database can return objects of different types. That’s a challenge in T-SQL.
T-SQL has no concept of polymorphism, even with direct hierarchies. I can’t create a tiger table that derives from a cat table that further derives from an animal table. I can create each of these separately but there’s no concept of inheritance. Where this bites, is that if I have a procedure or function that expects an animal, I can’t pass a cat or a tiger to it. So, on that same basis, I can’t return different types of things in a single rowset, without getting quite messy coding-wise.
I also didn’t love the syntax that they used for joins. After decades of getting people to move to ANSI style join syntax, having the graph options look like a throwback to the bad old days, wasn’t a good thing. And worse, many of the aspects of the relationships that you can form in graph databases, just weren’t there. There are so many things you can do in, say, Neo4j or Gremlin, that you just can’t do with the graph offering in SQL Server. For example, if I have a relationship (or edge) that says that Peter likes Lord of the Rings, I can’t say how much he likes it, within that edge/relationship. Many graph databases support that as well. For example, I could have a star rating within the edge definition.
I could go on for a long time about this, but I just didn’t love it. And I don’t think I’m alone. I’ve never seen a client using it in anything but a POC. What a waste.
Graph Query Language (GQL)
One of the real challenges with graph databases, is that they all have their own syntax. This is the same problem that SQL was introduced to solve for databases. When I first started working with databases, every database product had its own proprietary language. The SQL standard was designed to fix that. You could argue that what we’ve ended up with, is different variations of SQL rather than different languages, but at least that’s a step forward.
So, GQL is designed to do the same thing for graph-based data. It’s a new evolving standard that attempts to unify how queries, etc. are written for graph databases.
Book Contents
Because GQL is a new standard, there is a real challenge in the book. I feel like the authors were needing to find a balance between documenting the new language, and showing how to really use it.
I think they did a pretty good job of this.
The book starts by positioning GQL in the history of data-related processing and languages. It then dives into defining the language, the data types, expressions, and functions. It does a good job of covering concepts that don’t exist in relational databases like path modes of WALK, TRAIL, ACYCLIC, and SIMPLE, along with how MATCH has been implemented, path searches, and more. There is good content on lower-level concepts like managing sessions, and transactions.
The book finishes out with a good case study around transaction fraud.
I like the way the authors also speculate a little on where GQL is heading. This really is early days for GQL.
Editing and Resources
The book copy editing is good. I wasn’t finding errors while reading it. I liked the way that code was available online, and the way that a PDF of the screenshots was made available. I know many people who find that really useful.
One thing I do want to call out particularly though, is the fact that a GQL playground has been placed online. That makes it really easy for readers to test out what they’re learning. After all the years we’ve had SQL Server (I’ve worked with it for 33 years), there still isn’t an online hosted version that new users can just test queries against. I wish there was.
Summary
Overall, I really enjoyed reading this book, and I found it interesting. The content is covered well and it’s about the right length. I also appreciated the balance between documentation and teaching. Great work Ricky, Jason, and Yuri !
8 out of 10
2025-08-22