Local Amazon Neptune Development with gdotv and LocalStack, the AWS Cloud Emulator

Local Neptune with LocalStack

This article will cover how to connect your locally running Amazon Neptune database powered by LocalStack using gdotv – Gremlin IDE. To support this, we’ll use the AWS CLI to create a Neptune database on your local machine and start a connection while loading and querying data interactively on gdotv.

Introduction

Before we start, let’s quickly introduce LocalStack, Amazon Neptune, and gdotv.

LocalStack is a cloud development framework which powers a core cloud emulator that allows you to run your cloud & serverless applications locally. It helps developers work faster by supporting them to build, test, and launch applications locally — while reducing costs and improving agility. The emulator supports various AWS services like S3, Lambda, DynamoDB, ECS, and Kinesis. LocalStack also works with tools and frameworks like AWS CLI, CDK, and Terraform, making it easy for users to connect to the emulator when building and testing cloud apps.

Amazon Neptune is a managed graph database service designed to handle complex datasets with many connections. It’s schema-free and uses the Neptune Analytics engine to quickly analyze large amounts of graph data, providing insights and trends with minimal latency. Users can control access using AWS IAM and query data using languages like TinkerPop Gremlin and RDF 1.1 / SPARQL 1.1.

LocalStack supports Amazon Neptune as part of its core cloud emulator. Using LocalStack, you can use Neptune APIs in your local environment supporting both property graphs and RDF graph models.

gdotv is a Gremlin IDE – its purpose is to complement the Apache TinkerPop database ecosystem with software that is easy to use and install, and provides essential facilities to query, visualize, and model the graph data. If you want to find out more about gdotv, check out From Gremlin Console to Gremlin IDE with gdotv.

Prerequisites

gdotv and LocalStack have partnered to offer a free trial of both LocalStack’s core cloud emulation and gdotv that you can take advantage of now if you haven’t already!

To get started, you’ll need the following:

Once you’ve done all the above, you’ll be ready to connect gdotv to your database and run queries.

Connecting gdotv to your LocalStack Neptune Database

Connecting gdotv to your LocalStack Neptune Graph database is quick and easy.

To create a LocalStack Neptune Graph database, follow these steps:

  • Start your LocalStack instance using either localstack CLI or a Docker/Docker-Compose setup.
  • Create a LocalStack Neptune cluster using Amazon’s CreateDBCluster API with the AWS CLI:
awslocal neptune create-db-cluster \
--engine neptune \
--db-cluster-identifier my-neptune-db
  • Add a LocalStack Neptune instance using Amazon’s CreateDBInstance API with the AWS CLI:
awslocal neptune create-db-instance \
--db-cluster-identifier my-neptune-db \
--db-instance-identifier my-neptune-instance \
--engine neptune \
--db-instance-class db.t3.medium

After starting the LocalStack Neptune database, you can see the Address and Port in the Endpoint field. Navigate to the gdotv IDE and follow the instructions:

  • Click on New Database Connection.
  • Choose the Graph Technology Type as LocalStack.
  • Enter localhost.localstack.cloud as the hostname and 4510 as the port. Customize the values if you have a different hostname and port.
  • Click on Test Connection. gdotv will make sure it can connect to your LocalStack Neptune database. It will then present a final screen summarizing your connection details, which you can now save by clicking Submit.

This will transition to a new query window. Now that your LocalStack Neptune database is up and running in gdotv, let’s run some Gremlin queries:

g.addV('person').property('name', 'Alice').property('age', 30)

Once complete, you can see the summary, results, vertices, graph, and more in the gdotv IDE.

For a more in depth look at using gdotv and LocalStack Neptune together, check out LocalStack’s announcement blog post and this LocalStack Neptune development presentation.

Conclusion

We’re only beginning to see the potential of LocalStack Neptune and gdotv when used together. This post shows how you can easily start working with setting up LocalStack Neptune on gdotv and running basic Gremlin queries. LocalStack also supports other AWS services, which allows you to test integrations supported by Neptune and shift left your database development without maintaining additional dependencies or mocks.

Try gdotv with Amazon Neptune

Query, visualize and model your Amazon Neptune data on your laptop, in your own cloud or across the whole team.

gdotv Desktop

The ultimate graph database IDE.

Install and connect your first graph database in 2 minutes.

gdotv Team

The unified workbench for graph data teams.

Deploy to your team in under 15 minutes. Marketplace or self-hosted.

gdotv Enterprise

The universal graph intelligence platform.

For organization-wide deployments. Bring graph data directly to your analysts.