Readers may be familiar with graph databases in the form they have been most commonly used – to capture networks of relationships and social networks.
Early graphs emerged from in-house work by social web giants like Google, Facebook and LinkedIn, which shouldn’t surprise us, as social media networks are already graphs.
There’s no point converting a graph database into SQL tables and then back again, after all.
However, there are also applications of graph databases that may not be so obvious. It’s mapping networks of things – more specifically devices and machine-to-machine relationships that a smart city will rely on.
With two thirds of the world’s population set to inhabit cities by 2045, city administrators face big problems. After all, modern cities are enormously complex; the Victorian engineers produced some remarkable feats in planning and managing our urban landscape, but the challenges were relatively modest, compared to the complexity of a modern urban waste management, energy supply and transport infrastructure.
Smart city = IoT structure
Happily, graph databases can help, as graph technology has proven itself a useful way of understanding complex relationships.
This is important as smart cities will look set to improve quality of life, streamline operational control and deliver cost savings for governments.
But how will society achieve this smart metropolis? To make all an urban network ‘smart’ means managing a complex synergy of multiple sensors, networks, devices, CCTV cameras, power grids, utility frameworks, traffic lights and smart water and power metres.
If you consider all these components, it’s clear that this is a connected Internet (network) of many things (devices) – an IoT structure, carrying a mind-bogglingly large number of connections.
Abstract that out a little, and you’re working with a complex data structures of many nodes, and graph technology may be the only pragmatic way of capturing all that density and inter-connectedness.
That’s important, as managing that data and those connections is going to be at least as important as understanding and managing the devices themselves.
It’ll be about quick traversal of graphs to solve problems, basically. So in a transport network, the question, “What road is experiencing the most congestion?” or “Which train is going to arrive late?” becomes: “What is the impact of the problem on the rest of the network?”
Understanding connections is the key to understanding dependencies and uncovering cascading impacts.
Most IoT applications must work with dynamic and rapidly changing systems: new devices and applications are regularly coming online, each needing to fold seamlessly into the network.
This requires a data model that can evolve without undue database and application re-engineering, and without impacting application availability.
In other words, a database technology that does not require a predefined and fixed schema, a well-known limitation of SQL databases.
Graph databases, by contrast, allow developers to create new fields or data elements very easily with low impact to the application.
This sort of flexibility is pivotal for the IoT as new generations of devices with new types of data arrive in unpredictable ways.
Context, attributes, connections
Meanwhile, the connections between devices and other entities can change faster than the data describing each thing.
With telecoms data, each time you call a new person or authorise a new device, you make a new connection. The same is true of the smart parking meters, smart traffic lights, or the cameras in the hospital driveways.
When a new piece of equipment comes online, it will look around for the relevant controllers or other devices that it needs to listen to or send data to.
The powering up or down of a device will make or break dozens of connections. Again the natural way to represent such connections is using a graph database.
In addition, connections are more than lines between entities: they each include a richness of information, such as direction, type, quality, weight, and more — all of which can be represented in a graph database as an integral part of each relationship object.
In this context, relationship attributes describe each connection. Attributes may indicate when the connection was created, the type of connection, the data related to the connection, and more. Just like the data describing a thing, the attributes of connections may change rapidly.
That is a challenge for traditional databases, as relational databases, with their more rigid structure, capture only a fraction of the story.
>See also: The role of telcos in smart cities
Graph databases enable an individual or body to represent thousands of interconnections between nodes on a network and then slice and dice the data based on any type of relationship you choose.
Graph query can handle relationships at scale, no matter how frequently they change. A user who troubleshoots networks comments, “[I] don’t have to do a relational join between every machine with every other machine… 15 machines die and you don’t know which one caused the problem — now imagine that’s in a collection of 100 machines, or 1,000 machines”.
It’s not just programmers waking up to the power of graph. The limitations of relational databases in handling the flexibility and scale of IoT that the smart city represents means graph-based approaches to IoT management are the smart way to get us to the bright urban futures society desires.
Sourced by Emil Eifrem, co-founder and CEO of Neo Technology