Join us on Dec 1st for ScyllaDB University LIVE, a half-day of FREE instructor-led training. Register for Free
Learn More >

Lab: Getting Started with ScyllaDB Cloud

6 min to complete

Intro

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

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

 

ScyllaDB Cloud allows you to create real-time applications that run at a global scale with the industry’s most performant NoSQL database, sparing your team from database administrative tasks. ScyllaDB Cloud gives you access to fully managed ScyllaDB 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) and the Google Cloud Platform (GCP). In this lab, you’ll learn how to get started with ScyllaDB Cloud by creating a cluster, connecting to it, and running some basic queries. 

Step 1: Connect to ScyllaDB Cloud and Create a Cluster

A cluster is a collection of nodes that ScyllaDB 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 ScyllaDB Architecture in this lesson.

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

Once you’re in, click on Add New Cluster. Notice that you can use the free trial if you’re a new user. 

Leave the default options as they are. Enter “test-cluster” for the cluster name.

To allow connections from the outside world to your new ScyllaDB Cloud cluster, you’ll have to whitelist the public IP address of the machine from which you’ll connect.

To see the machine’s IP address type:

curl http://ipinfo.io

Make sure the IP is added to the Allowed IPs list.

Next click Launch Cluster. This will start a three-node cluster that you will use for this lab. 

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 ScyllaDB Cloud using the ScyllaDB Cloud Bring Your Own Account (BYOA) feature. Learn more about it here

Step 2: Connect to the Newly Created Cluster

Next, you’ll see how to connect to the Cluster, using the CQL shell (Cqlsh) with Docker. Make sure you have Docker installed. 

CQL is a query language that is used to interface with ScyllaDB. It allows you to perform basic functions such as insert, update, select, delete, create, etc.

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

Now you can connect to the cluster. Copy the password from the instructions tab and run the following command with the password you copied and one of your node’s IPs:

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

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 ScyllaDB 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 ScyllaDB Cloud Lab.

You saw how easy it is to get started with ScyllaDB Cloud in this short lab. You created a cluster using the free trial, used cqlsh to connect to it, and performed some basic queries. 

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

fa-angle-up