Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Getting Started With GridGain Cloud: In-Memory Computing as a Service

DZone's Guide to

Getting Started With GridGain Cloud: In-Memory Computing as a Service

Check out how to install and run GridGain Cloud services to handle the management, deployment, and monitoring of your distributed clusters.

· Cloud Zone ·
Free Resource

Discover a centralized approach to monitor your virtual infrastructure, on-premise IT environment, and cloud infrastructure – all on a single platform.

GridGain in-memory computing platform was always famous for an ability to be deployed and managed in heterogeneous environments. It doesn't matter if you'd like GridGain to work on-premise or to operate on the cloud, to scale out across commodity servers or scale up within powerful mainframes. Moreover, if you need to get GridGain provisioned by Kubernetes or Docker Swarm — you get it. Literally, no deployments or provisioning limitations.

So, what is GridGain Cloud all about? It's an entirely new solution that is intended to help both GridGain customers and Apache Ignite users to forget about all the hustle and bustle of distributed clusters deployment, management, and monitoring. You as a software engineer or architect invest your time and resources in applications and services development, while GridGain Cloud takes care of and manages your GridGain as an in-memory cache (current version) or memory-centric database (on roadmap) deployments.

Enough words, let's get started with GridGain Cloud and experience how straightforward it's to launch our first cluster there and use SQL for data processing.

Sign Up and Start a Free Cluster

We'll skip covering the sign-up process in details. It's easy to follow. Just go the main page and create an account there.

Once you're in, launch the very first cluster by clicking on "Launch Cluster" button and get a window like the one below popped up:

The service allows us to start a single-node cluster for free or select a more powerful configuration and pay for it on-the-go. Let's go for the free option for now by pressing "Launch" button.

Connect to the Cluster

As soon as the cluster is booted, you'll see it in the "Running" state as follows:

What do we do next? Sure, we'd like to make use of the deployment connecting from an application side. GridGain Cloud goes with several connectivity options (SQL, REST, Thin Clients) and SQL was favored for the sake of getting started.

Below "My Cluster" block, you'll see the "Demo" section that shows us how to start with our cluster within minutes. Go for "Command Line" to test GridGain Cloud being in the shoes of a software developer:

As the first step suggests, let's download GridGain Cloud Client Pack and unzip it on our local laptops.

Next, move to Step 2 (SSL) and download your personal SSL certificate putting it under {gridgain_cloud_pack}/bin directory.

Finally, it's time to connect to GridGain Cloud. Just follow Step 3 (Connect): open your favorite command line tool (CMD), navigate to{gridgain_cloud_pack}/bin folder, copy the connection string like the one below:

Run the connection string from CMD. You'll get SQLLine tool started which connects you to GridGain Cloud through GridGain JDBC driver. That's the output you should see on your laptop:

./sqlline.sh -u "jdbc:ignite:thin://54.183.252.222:9276;user=ignite;password=52saqhhYyD;sslMode=require;sslClientCertificateKeyStoreUrl=keyStore.jks;sslClientCertificateKeyStorePassword=tkwZtWqn2LPqHQhFYjS4;sslTrustCertificateKeyStoreUrl=keyStore.jks;sslTrustCertificateKeyStorePassword=tkwZtWqn2LPqHQhFYjS4"

sqlline version 1.3.0

0: jdbc:ignite:thin://54.183.252.222:9276>


Preloading and Querying World Database

GridGain is fluent in SQL. So, the next step would be to take an SQL script with a sample database and preload the data into the cloud.

Luckily, GridGain Cloud Client Pack already goes with a sample World Database that represents a snapshot of countries and cities across the globe. So, as Step 4 (Preload) suggests, let's execute the command below from our SQLLine session:

!run ../examples/sql/world.sql


Once the database is created, we're good to run any queries we like including aggregations, grouping, ordering and distributed join. For instance, let's find out top 3 most populated countries in the world by running this query from the command line connection:

SELECT name, MAX(population) as max_pop 
FROM country GROUP BY name, population 
ORDER BY max_pop DESC LIMIT 3;


Here's the answer (note, the database is a little bit outdated, and the current population numbers can be completely different):

| China                          | 1277558000                     |
| India                          | 1013662000                     |
| United States                  | 278357000                      |


Next, if we want to find the most inhabited cities in China, the USA, and Russia then our query would be the following:

SELECT country.name, city.name,
MAX(city.population) as max_pop FROM country
JOIN city ON city.countrycode = country.code
WHERE country.code IN ('USA','RUS','CHN')
GROUP BY country.name, city.name ORDER BY max_pop DESC LIMIT 3;


Turns out to be that the top list is as follows:
| China                | Shanghai                  | 9696300    |
| Russian Federation   | Moscow                    | 8389200    |
| United States        | New York                  | 8008278    |


Next Steps

In general, that's it. It's simple to start the first cluster in GridGain Cloud and connect to it from our development environment. Now, we can focus on applications development while our distributed storage will be managed for us.

As the next steps, check out Thin Clients (that make it easy connecting from Java, .NET, Node.JS, Python, and other languages) as well as REST APIs as connectivity options.

Learn how to auto-discover your containers and monitor their performance, capture Docker host and container metrics to allocate host resources, and provision containers.

Topics:
apache ignite ,gridgain ,in-memory computing ,in-memory caching ,sql ,cloud as a service ,cloud

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}