ScyllaDB University LIVE, FREE Virtual Training Event | March 21
Register for Free
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Ask AI
ScyllaDB Docs ScyllaDB Documentation Get Started with ScyllaDB Develop with ScyllaDB Connect an Application

Connect an ApplicationΒΆ

To connect your application to ScyllaDB, you need to:

  1. Install the relevant driver for your application language.

    This step involves setting up a driver that is compatible with ScyllaDB. The driver acts as the link between your application and ScyllaDB, enabling your application to communicate with the database.

  2. Modify your application code to connect the driver.

    The following is some boilerplate code to help familiarize yourself with connecting your application with the ScyllaDB driver. For a detailed walkthrough of building a fictional media player application with code examples, please see our Getting Started tutorial.

use anyhow::Result;in various languages
use scylla::{Session, SessionBuilder};
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<()> {
    let session: Session = SessionBuilder::new()
        .known_nodes(&[
            "localhost",
        ])
        .connection_timeout(Duration::from_secs(30))
        .user("scylla", "your-awesome-password")
        .build()
        .await
        .unwrap();

    Ok(())
}
func main() {
    cluster := gocql.NewCluster("localhost")

    cluster.Authenticator = gocql.PasswordAuthenticator{Username: "scylla", Password: "your-awesome-password"}

          session, err := gocqlx.WrapSession(cluster.CreateSession())

          if err != nil {
                    panic("Connection fail")
          }
 }
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.PlainTextAuthProvider;
import com.datastax.driver.core.Session;

class Main {

    public static void main(String[] args) {
    Cluster cluster = Cluster.builder()
        .addContactPoints("localhost")
        .withAuthProvider(new PlainTextAuthProvider("scylla", "your-awesome-password"))
        .build();

    Session session = cluster.connect();

    }
}
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
cluster = Cluster(
    contact_points=[
        "localhost",
    ],
    auth_provider=PlainTextAuthProvider(username='scylla', password='your-awesome-password')
)
const cluster = new cassandra.Client({
    contactPoints: ["localhost", ...],
    localDataCenter: 'your-data-center',
    credentials: {username: 'scylla', password: 'your-awesome-password'},
    // keyspace: 'your_keyspace' // optional
})

Was this page helpful?

PREVIOUS
Install a Driver
NEXT
Tutorials and Example Projects
  • Create an issue
  • Edit this page
ScyllaDB Documentation
  • Get Started with ScyllaDB
    • Why ScyllaDB?
    • Develop with ScyllaDB
      • Run ScyllaDB
      • Install a Driver
      • Connect an Application
      • Tutorials and Example Projects
    • Query Data
      • CQL
      • Schema
      • Inserting Data
      • Reading Data
      • Updating Data
      • Deleting Data
    • Data Modeling
      • Query Design
      • Schema Design
      • Data Modeling Best Practices
    • Learn to Use ScyllaDB
  • Versioning and Support Policy
    • ScyllaDB Version Support
    • Driver Support Policy
Docs Tutorials University Contact Us About Us
© 2025, ScyllaDB. All rights reserved. | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 16 Sep 2025.
Powered by Sphinx 7.4.7 & ScyllaDB Theme 1.8.8
Ask AI