Revisit Amazon Web Services re:Invent 2024’s biggest moments and watch keynotes and innovation talks on demand
Graph databases, like Amazon Neptune, are purpose-built to store and navigate relationships. They have advantages over relational databases for use cases like social networking, recommendation engines, and fraud detection, where you need to create relationships between data and quickly query these relationships. There are a number of challenges to building these types of applications using a relational database. You would need multiple tables with multiple foreign keys. SQL queries to navigate this data would require nested queries and complex joins that quickly become unwieldy, and the queries would not perform well as your data size grows over time. At re:Invent 2018, Amazon Web Services presented an On-ramp to Graph Databases that provides more information and detail.
Neptune uses graph structures such as nodes (data entities), edges (relationships), and properties to represent and store data. The relationships are stored as first order citizens of the data model. This allows data in nodes to be directly linked, dramatically improving the performance of queries that navigate relationships in the data. Neptune’s interactive performance at scale effectively enables a broad set of graph use cases.
If you already have your data in a graph model, it’s easy to get started with Amazon Neptune. You can load data in CSV or RDF formats and begin writing graph queries with Apache TinkerPop Gremlin or SPARQL. You can use the quick start guide below, or see the full getting started instructions. We've consolidated Best Practices for Amazon Neptune as well.
There are other samples and examples available to help you get started. We have example code for visualizing your Neptune graph. We have an application to ETL IMDB into Neptune using Amazon Glue to try out graph queries to find "Six Degrees of Kevin Bacon". We have a recommendation engine sample that shows how to use collaborative filtering.
If you're interested in enabling GraphQL for access to Amazon Neptune, there's an example application showing how to use Amazon AppSync GraphQL and Amazon Neptune.
If you'd like to migrate to Amazon Neptune, we have a utility to convert GraphML data to the Neptune CSV format, and there is also a Python Library to help with writing to Neptune from Amazon Glue jobs.