How to: Get up to speed and scale with Aerospike Graph on Google Cloud Marketplace
Tags: gremlin, gcp, graph, tinkerpop
Published: 2023-08-28 15:00:31

![](https://developer-hub.s3.us-west-1.amazonaws.com/78458717/Screenshot2023-08-25at335PM_1692996518285.png)

In June of this year, Aerospike put graph developers front and center with the announcement of a new, developer-ready, [real-time scalable graph database](https://aerospike.com/news/press-release/aerospike-delivers-real-time-scalable-graph-database/).  Aerospike Graph is a massively scalable, high-performance graph database that simplifies building and deploying applications for highly connected enterprise-scale datasets. 
<!--truncate-->
Aerospike Graph combines the unlimited scale, high throughput, and low latency of the Aerospike Database with the Aerospike Graph Service, an independently scalable graph compute engine built on Apache Tinkerpop. Let’s take a closer look. 

![](https://developer-hub.s3.us-west-1.amazonaws.com/78458717/GraphonGoogleCloudv2_1693004389114.png)
_**Figure 1: Aerospike Graph on Google Cloud** enables developers to use the popular Gremlin query language while keeping graph compute and storage separately scalable to optimize costs._

### Scalable storage

Scalable storage is facilitated by the [Aerospike Database](https://aerospike.com/products/database/) which functions as the storage layer. Aerospike is a shared-nothing, multi-threaded, multimodel database designed to operate efficiently on a cluster of server nodes. Utilizing modern hardware and network architectures, Aerospike delivers exceptional high performance, through petabytes of data, using its patented [Hybrid Memory Architecture <sup>TM</sup>  (HMA)](https://aerospike.com/products/features/hybrid-memory-architecture/); storing data on Flash devices (such as SSDs) and indexes in DRAM.

### Scalable compute

Aerospike Graph Service (AGS) is the compute layer of Aerospike Graph. AGS is a deep integration of Apache TinkerPop and the Aerospike Database, offering a graph-native developer interface through the Gremlin query language. 
AGS is purpose-built to maximize query performance through dozens of custom Gremlin steps, compiler optimization strategies, and a highly optimized graph encoding for the Aerospike Database. AGS nodes are stateless compute instances and can be elastically scaled to meet your application's throughput needs. 

### Unique, efficient architecture

Aerospike Graph’s unique architecture features independent scaling of compute and storage resources. This enables optimal resource utilization, consistently low-latency queries, and extreme throughput for complex multi-hop graph queries at scale. This translates to an industry-leading total cost of ownership, ensuring cost-effective operations without compromising performance.

This focus on performance, extreme scale, and high-efficiency operation provides a new proposition for companies looking to move demand operational workloads to a graph database. Making that available on an elastically scalable cloud environment like Google Cloud provides a future-proof path for IT and development organizations to follow. Let’s see what it takes to get started.

## Getting Started with Aerospike Graph on Google Cloud

To Get Started with Aerospike Graph on Google Cloud, follow these steps:  

1. Locate [Aerospike Database (BYOL) in the Cloud Marketplace](https://console.cloud.google.com/marketplace/browse?_ga=2.258327170.984131431.1692377086-1499964091.1684875212&_gac=1.116258548.1691772468.Cj0KCQjwuNemBhCBARIsADp74QRbLYwJqVpAUtjGcwM9hg2loCNylwc1BzBd7bIYQ5w3E1N1tBgFKjcaAlmXEALw_wcB&q=aerospike%20database). (Note: the other Aerospike Database listed is for Private Offers.) 
   - In the Cloud Console navigation menu, click **Marketplace**.
   - ![](https://developer-hub.s3.us-west-1.amazonaws.com/78458717/graph-2_1692995238621.png)
   - Type **Aerospike** in the **Search Marketplace** bar and click on the highlighted option from the search results.
   - ![](https://developer-hub.s3.us-west-1.amazonaws.com/78458717/graph-3_1692995237775.png)

2. Click on **Launch**.
![](https://developer-hub.s3.us-west-1.amazonaws.com/78458717/graph-4_1692995237032.png)

3. Follow the on-screen guide to configure and deploy your Aerospike Cluster.

4. Once the VMs are provisioned, note the `Internal IP` of the Aerospike Database cluster nodes. You can do this from the Google Cloud UI by navigating to the VM instances section of **Compute Engine** in the navigation menu. (You will need this information later in Step 9).

5. Create a **Compute Optimized** Compute Engine instance to host the Aerospike Graph Service.
![](https://developer-hub.s3.us-west-1.amazonaws.com/78458717/graph-5_1692995240456.png)

6. Now, Locate **Aerospike Graph Service** in the Cloud Marketplace through the Search bar.

7. Click on **Show Pull Command**. This will provide the commands to pull the docker image from the Google Container Registry.  
![](https://developer-hub.s3.us-west-1.amazonaws.com/78458717/graph-6_1692995235842.png)

8. SSH into the GCE instance for Aerospike Graph Service and run the command in Step 7. This will pull the docker image to your instance. 

9. Click on the **Get Started with Aerospike Graph Service** button. This will provide you with instructions on how to connect AGS to the Aerospike Cluster. 

10. Follow along the technical documentation in Step 9 for details on data loading, running gremlin queries and building your graph applications. 

## Working with graph data​

There are several options for connecting to and interacting with Aerospike Graph. Some possibilities are:

- The [Gremlin Console](https://tinkerpop.apache.org/docs/3.6.1/reference/#gremlin-console), an interactive command-line terminal for sending queries and receiving responses.
- A client application. This page provides code samples for Python and Java client code.
- A [Jupyter Notebook](https://jupyter.org/).

You can use a client application or the Gremlin Console to query an existing data set, or add new edges and vertices to a data set. You can view [examples](https://docs.aerospike.com/graph/usage#examples) in the product documentation that demonstrate adding new vertices one at a time to a database. To bulk load new data into a Graph database, use the Graph [bulk loader](https://docs.aerospike.com/graph/usage/bulk-loader).

[Kelvin Lawrence](https://www.kelvinlawrence.net/) has compiled and made public a [data set](https://github.com/krlawrence/graph/tree/master/sample-data) containing information about airlines, airports around the world, and routes between them, designed for use with a graph database. The data set is large enough to be interesting and useful, but small enough to be practical for testing and experimentation purposes. To run the following examples, download one of the [`.graphml` data files](https://github.com/krlawrence/graph/tree/master/sample-data).

To use the `.graphml` file, you must bind it to a Docker volume. When you start the [AGS Docker image](https://docs.aerospike.com/graph/docker/getting_started), use the `-v` option to bind the local `.graphml` file directory to a directory in the Docker container. For example, if you download the data file `air-routes-small.graphml` to the directory `/home/users/data`, start the AGS Docker image with the `-v` option:

```bash
docker run -p 8182:8182 -v /home/user/data/:/opt/air-routes/ aerospike/aerospike-graph-service
```

You can use the Gremlin console to load the `air-routes` data set into Aerospike Graph with the following command:

```bash
g.with("evaluationTimeout", 24L * 60L * 60L * 1000L).io("/opt/air-routes/air-routes-small.graphml").with(IO.reader, IO.graphml).read()
```

View the [Aerospike Graph product documentation](https://docs.aerospike.com/graph/usage) for more information.