Skip to content

Amazon Neptune

A graph database stores nodes and the relationships between them rather than tables of rows or collections of documents. The relationship is a first-class object with its own properties, and traversing one is a direct pointer hop rather than a join.

That difference is the whole argument for the category. A query such as “which accounts are within three degrees of this one, through any combination of shared devices, shared addresses and shared payment instruments” is a self-join three levels deep in SQL, and gets exponentially worse with depth. In a graph database it is a traversal whose cost scales with the number of relationships actually walked, not with the size of the tables.

Amazon Neptune is AWS’s managed graph database. It is a fully managed service in the same mould as Aurora: AWS handles provisioning, patching, backup, replication and failover, and the storage layer is replicated across Availability Zones.

  • Neptune Database — the transactional graph database, provisioned as instances in a cluster.
  • Neptune Serverless — the same database with capacity managed automatically, scaling with the workload instead of being sized in advance.
  • Neptune Analytics — a separate analytics engine for running graph algorithms and vector search over a graph in memory, for questions about the shape of the whole graph rather than about individual traversals.

Identity resolution. Building an identity graph that links the same person across devices, accounts and channels — the substrate for ad targeting, personalisation and deduplication. Updates propagate quickly enough to affect the next interaction.

Knowledge graphs. Modelling a product catalogue, a topic taxonomy or a corpus of general information so that highly connected data can be navigated rather than searched. This has become considerably more prominent as a way of grounding language-model answers in a structured source.

Fraud detection. Detecting the patterns that only exist in the relationships — several accounts sharing a device fingerprint, rings of transactions that return to their origin, a new account behaving like a known bad one. Near-real-time traversal is what makes this useful at the point of transaction rather than in a next-day report.

Recommendations. “People who bought this also bought” and its more sophisticated descendants are graph traversals: from a user, to items, to other users, to items those users chose.

Security and infrastructure graphs. Modelling the dependencies between hosts, services, accounts and permissions so that blast radius, reachability and lateral movement can be queried directly rather than inferred from an inventory.

Neptune is a specialised tool and carries the cost of one: another engine to operate, another query language for the team to learn, and no benefit at all if the relationships in the data are shallow. If the deepest question the application asks is a two-table join, a relational database answers it faster and more cheaply. Reach for a graph database when the traversals are genuinely deep or variable in depth, and when the relationships carry information of their own.