Migrating from Neo4j to Amazon Neptune
Neo4j and Amazon Neptune are both graph databases, designed for online, transactional graph workloads that support the labeled property graph data model. These similarities make Neptune a common choice for customers seeking to migrate their current Neo4j applications. However, these migrations are not simply lift and shift, because there are differences in languages and feature support, operational characteristics, server architecture, and storage capabilities between the two databases.
This page frames the migration process and brings up things to consider before migrating a Neo4j graph application to Neptune. These considerations apply generally to any Neo4j graph application, whether powered by a Community, Enterprise, or Aura database. Although each solution is unique and may require additional procedures, all migrations follow the same general pattern.
Each of the steps described in the following sections includes considerations and recommendations to simplify the migration process. Additionally, there are open-source tools, and blog posts that describe the process, and a feature compatibility section with recommended architectural options.
Topics
- General information about migrating from Neo4j to Neptune
- Preparing to migrate from Neo4j to Neptune
- Provisioning infrastructure when migrating from Neo4j to Neptune
- Data migration from Neo4j to Neptune
- Application migration from Neo4j to Neptune
- Neptune compatibility with Neo4j
- Rewriting Cypher queries to run in openCypher on Neptune
- Resources for migrating from Neo4j to Neptune
General information about migrating from Neo4j to Neptune
With Neptune support for the openCypher query language, you can move most Neo4j workloads that use the Bolt protocol or HTTPS to Neptune. However, openCypher is an open-source specification that contains most but not all of the functionality supported by other databases such as Neo4j.
In spite of being compatible in many ways, Neptune is not a drop-in replacement for Neo4j. Neptune is a fully managed graph database service with enterprise features like high availability and high durability that is architecturally different from Neo4j. Neptune is instance-based, with a single primary writer instance and up to 15 read replica instances that let you scale read capacity horizontally. Using Neptune Serverless, you can automatically scale your compute capacity up and down depending on query volume. This is independent of Neptune storage, which scales automatically as you add data.
Neptune supports the open-source openCypher
standard specification, version 9
However, many applications running on Neo4j also use proprietary features that
are not open-sourced and that Neptune doesn't support. For example, Neptune doesn't
support APOC procedures, some Cypher-specific clauses and functions, and Char
,
Date
, or Duration
data types. Neptune does auto-cast
the missing data types to data
types that are supported.
In addition to openCypher, Neptune also supports the Apache
TinkerPop Gremlin
openCypher | Gremlin | |
---|---|---|
Style |
Declarative |
Imperative |
Syntax |
Pattern matching
|
Traversal based
|
Ease of use |
SQL-inspired, readable by non-programmers |
Steeper learning curve, similar to programming languages like Java |
Flexibility |
Low | High |
Query support |
String-based queries |
String-based queries or in-line code supported by client libraries |
Clients |
HTTPS and Bolt |
HTTPS and Websockets |
In general, it isn't necessary to change your data model to migrate from Neo4j to Neptune, because both Neo4j and Neptune support labeled property graph (LPG) data. However, Neptune has some architectural and data model differences that you can take advantage of to optimize performance. For example:
Neptune IDs are treated as first-class citizens.
Neptune uses Amazon Identity and Access Management (IAM) policies to secure access to your graph data in flexible and granular ways.
Neptune provides several ways to use Jupyter notebooks to run queries and visualize the results. Neptune also works with third-party visualization tools.
>Although Neptune has no drop-in replacement for the Neo4j Graph Data Science (GDS) library, Neptune supports graph analytics today through a variety of solutions. For example, several sample notebooks
demonstrate how to leverage the Neptune integration with the Amazon Pandas SDK within Python environments to run analytics on graph data.
Please reach out to Amazon support or engage your Amazon account team if you have questions. We use your feedback to prioritize new features that will meet your needs.