Was this page helpful?
Connect to Your Cluster¶
Once your ScyllaDB Cloud cluster is running, you can connect your application to it with a ScyllaDB driver or the CQL Shell (cqlsh). The drivers are shard-aware: they route each request to the correct shard, which is important for performance. See ScyllaDB CQL Drivers for the full list of supported drivers and links to their documentation.
The Connect tab of your cluster provides connection details and code snippets generated for your cluster. The snippets include your cluster’s connection details where they are available. Some values may still be placeholders that you need to replace with your own. Before you use the code, review the snippet and any warnings displayed in the Connect tab.
This page explains the steps of the Connect tab and which options you can select to get a snippet that matches your setup.
Open the Connect Tab¶
Go to your cluster and select the Connect tab. It includes four steps:
The snippets in the last step are based on what you choose in the previous steps.
Step 1: Choose a Data Center or Connection¶
In the first step, you choose which data center or network connection the details and snippets target. What you choose depends on the network type you selected when creating the cluster.
Public Clusters¶
Public clusters are clusters created with the Public Internet network type. Your application connects to the cluster nodes directly, so you only need to choose a data center. This is useful if your cluster has more than one data center. The generated code routes queries to the replicas in the selected data center.
The step shows:
DC Name - The name of the data center. Use this name to identify the data center within ScyllaDB, for example, as a parameter to
NetworkTopologyStrategywhen creating a keyspace.Public Endpoint - The addresses of the cluster nodes that your application connects to.
Before connecting, make sure that the IP address of your application is added to the allowed IPs on the General tab of your cluster.
Private Clusters¶
Private clusters are clusters created with the Private Connection network type. Your application connects to the cluster through a network connection, such as VPC Peering, Private Link, or Private Service Connect. A data center can have more than one connection, so you choose a connection rather than a data center. You can choose from:
The connections configured for your cluster. These are the same connections that are listed on the Connections tab of your cluster.
Example connections, such as VPC Peering (Example) and Private Service Connect (Example). Examples show what the snippet for a given connection type looks like and use placeholder values that you need to replace before using the code.
If no connection is configured for your cluster yet, the Connect tab displays a No connections configured warning, and the snippets use an example connection with placeholder values. Make sure that network connectivity is fully configured before you connect your application.
You can also open the snippets for a specific connection directly from the Connections tab by clicking View code snippets in the Actions column of that connection.
Step 2: Encryption¶
The Encryption option defines whether the client connects over an encrypted connection:
TLS - The client connects over TLS and verifies the identity of the server using the CA certificate of your cluster. TLS is a successor of SSL and may be referred to as “SSL” in some contexts. To use TLS, download the CA certificate of your cluster and replace the certificate path in the snippet with the location of the downloaded file. See Obtain the Public Key.
Unencrypted - The client connects without TLS.
Step 3: Credentials¶
The Credentials step shows the username (scylla) and password of the
default user for password authentication. The password is masked; click the
eye icon to reveal it. Click Copy to copy the username or password.
For security purposes, we highly recommend changing the default password with
the ALTER ROLE CQL command, for example:
ALTER ROLE scylla WITH PASSWORD = 'new_password';
To limit the permissions of your application, create dedicated roles instead of using the default user. See Role Based Access Control in the ScyllaDB documentation.
Step 4: Pick a Driver and Connect¶
In the last step, choose the client you want to connect with:
Cqlsh - The command to connect with the CQL Shell. Run it in a terminal on a machine that can reach your cluster, for example, to verify the connection or to run CQL statements interactively.
Java, Go, Python, JavaScript, Rust, or C# - Code that connects to your cluster with the recommended ScyllaDB driver for that language. Use it as the connection code of your application, or run it as a standalone program to verify the connection before you integrate it.
Other - A link to other supported drivers. This option does not include a code snippet.
Some clients let you adjust the generated code with the following options.
Cqlsh: Run With¶
For Cqlsh, the Run with option defines how you run the CQL Shell:
Local installation - The command runs cqlsh installed on your machine. It requires scylla-cqlsh 6.0.1 or newer. With TLS, you can provide the CA certificate in the
SSL_CERTFILEenvironment variable, as in the snippet, or add it to the[ssl]section of your$HOME/.cassandra/cqlshrcfile.Docker container - The command runs cqlsh in a Docker container, which pulls the latest version of cqlsh.
Java: Version¶
For Java, the Version option defines which major version of the ScyllaDB Java Driver the snippet uses:
Java 4.x - Recommended.
Java 3.x (deprecated) - Not recommended for new applications.
The option may not be available for features that do not support Java 3.x, such as Private Connectivity.
Rust: TLS Library¶
For Rust, when you connect over TLS, the TLS library option defines which TLS library the snippet uses. The option changes the dependencies of the generated code:
Rustls - Default. Uses Rustls, a TLS library written in Rust.
OpenSSL - Uses the OpenSSL library installed on your system. To build the code, you need the OpenSSL development packages and
pkg-config.
Run CQL from Your Browser¶
To run CQL statements without installing any client, use the CQL Console on your cluster’s CQL Console tab. The CQL Console is available for publicly accessible clusters.
Hands-On Tutorial¶
The Getting Started with ScyllaDB Cloud tutorial walks you through building a real application connected to ScyllaDB Cloud. It covers creating a keyspace and table, writing and reading data, and best practices for production use. Examples are available in Go, Java, Python, Rust, and more.