Getting Started With Scylla Cloud Lab

6 min to complete

Intro

Scylla Cloud is a managed NoSQL database as a service running Scylla Enterprise.

In this lab, you’ll connect to Scylla Cloud, create a cluster, connect to it and perform some basic queries.

 

It allows you to create real-time applications that run at global scale with the industry’s most performant NoSQL database, sparing your team from database administrative tasks. Scylla Cloud gives you access to fully managed Scylla clusters with automatic backup, repairs, performance optimization, security hardening, 24*7 maintenance, and support. All for a fraction of the cost of other DBaaS providers.

Currently, it’s available on Amazon Web Services (AWS). In this lab, you’ll learn how to get started with Scylla Cloud by creating a cluster, connecting to it, and running some basic queries. 

Step 1: Connect to Scylla Cloud and Create a Cluster

A cluster is a collection of nodes that Scylla uses to store the data. The nodes are logically distributed like a ring. A minimum cluster typically consists of at least three nodes. Data is automatically replicated across the cluster, depending on the Replication Factor. Learn more about Scylla Architecture in this lesson.

Sign in to Scylla Cloud if you already have a user. Otherwise,
create one. 

Once you’re in, click on Add New Cluster. 

Leave the default options as they are. Enter “test-cluster” for the cluster name and click Launch Cluster. This will start a three-node cluster that you will use for this lab. 

Notice that if you’re a new user, you can use the free trial. 

Wait until the cluster is ready. Next, you’ll connect to it. Click on Connect.

It’s also possible to use your own AWS account with Scylla Cloud using the Scylla Cloud Bring Your Own Account (BYOA) feature, learn more about it here

Step 2: Connect to the Newly Created Cluster

After seeing how to connect to Scylla Cloud and create a Cluster, you’ll use the CQL shell (Cqlsh) with Docker to connect to the cluster. If you decide not to use the Katacoda platform make sure you have docker installed. 

CQL is a query language that is used to interface with Scylla. It allows us to perform basic functions such as insert, update, select, delete, create, and so on.

The CQL Shell is an interactive Command Line Interface to interact with the database. The connection is established to any one of the nodes, which is then designated as the coordinator node for that specific connection. The coordinator node manages the request path and the response back to the client.

Keep in mind that most real-world applications use drivers to interact with the cluster, you can learn more about that in this course

 

To allow connections from the outside world to your newly create Scylla Cloud cluster, you’ll have to whitelist the public IP address of the Katacoda machine.

To see the IP address type:

curl http://ipinfo.io

Now that the IP address of the Katacoda machine is whitelisted, we can connect to the cluster. Copy the password from the instructions tab and run the following command with the password you copied:

docker run -it --rm --entrypoint cqlsh scylladb/scylla -u scylla -p *************** 44.193.147.54

Next, create a Keyspace called mykeyspace (notice that if you changed the AWS Region, you have to change the command accordingly):

CREATE KEYSPACE mykeyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'AWS_US_EAST_1' : 3} AND durable_writes = true;

A Keyspace is a top-level container that stores tables with attributes that define how data is replicated on nodes. It defines a number of options that apply to all the tables it contains, most prominently of which is the replication strategy used by the Keyspace.

Use the newly defined keyspace:

USE mykeyspace;

Next, create a Table:

CREATE TABLE monkeySpecies (
species text PRIMARY KEY,
common_name text,
population varint,
average_size int);

A Table is how Scylla stores data and can be thought of as a set of rows and columns.

Insert some data into the newly created table:

INSERT INTO monkeySpecies (species, common_name, population, average_size) VALUES ('Saguinus niger', 'Black tamarin', 10000, 500);

And read the data you just wrote:

SELECT * FROM monkeySpecies;

Summary

Congratulations! You have completed the Getting Started with Scylla Cloud Lab.

In this short lab, you saw how easy it is to get started with Scylla Cloud. Using the free trial, you created a cluster, used cqlsh to connect to it, and performed some basic queries. 

Check out other courses on Scylla University to improve your skills. Another helpful resource is the Scylla Cloud Documentation website. 

fa-angle-up