ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Server
  • Cloud
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Download
ScyllaDB Docs Scylla Operator Resources ScyllaClusters ScyllaDB clients Using Alternator (DynamoDB)

Caution

You're viewing documentation for an unstable version of Scylla Operator. Switch to the latest stable version.

Using Alternator (DynamoDB)¶

Alternator is a DynamoDB compatible API provided by ScyllaDB. You can enable it on your ScyllaClusters by adding this section:

spec:
  alternator: {}

While this is enough to turn it on, there are more options available. Please refer to our API documentation for details.

Note

Contrary to CQL clients, Alternator clients don’t need to connect to every ScyllaDB node directly, nor discover the ScyllaDB node IP addresses. Alternator protocol is based on HTTP and you can also expose the service “manually” with other networking concepts like Ingresses.

Credentials¶

Scylla Operator enables Alternator authorization by default. Here is a quick example of how to get the token for accessing Alternator API. To find out more, please refer to ScyllaDB Alternator documentation.

Caution

The salted_hash is only present if password authentication for CQL is set up.

Always make sure your clusters are configured to use Authentication and Authorization.

Tip

You can find a quick example that enables Authentication and Authorization here.

kubectl exec -it service/<sc-name>-client -c scylla -- cqlsh --user <cql_user> \
-e "SELECT salted_hash FROM system_auth.roles WHERE role = '<cql_user>'"

AWS CLI¶

This paragraph shows how to use aws dynamodb cli to remotely connect to ScyllaDB Alternator API.

Note

This example uses Service ClusterIP to connect to the ScyllaDB cluster. If you have configured networking options differently, or are using additional networking concepts like Ingresses, this address will need to be adjusted.

Caution

At the time of writing this document kubectl exec -i echoes passwords into the terminal. It can be avoided by manually running kubectl exec -it and copying the output into a file / variable. Because using kubectl exec with -t option merges standard and error outputs, we can’t use it in the scripts bellow.

See https://github.com/kubernetes/kubernetes/issues/123913 for more details.

SCYLLACLUSTER_NAME=scylladb
CQL_USER=cassandra
SCYLLADB_EP="$( kubectl get "service/${SCYLLACLUSTER_NAME}-client" -o='jsonpath={.spec.clusterIP}' )"
AWS_ENDPOINT_URL_DYNAMODB="https://${SCYLLADB_EP}:8043"
export AWS_ENDPOINT_URL_DYNAMODB

AWS_ACCESS_KEY_ID="${CQL_USER}"
export AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY="$( kubectl exec -i "service/${SCYLLACLUSTER_NAME}-client" -c scylla -- cqlsh --user ${CQL_USER} --no-color \
-e "SELECT salted_hash from system_auth.roles WHERE role = '${AWS_ACCESS_KEY_ID}';" \
| sed -e 's/\r//g' | sed -e '4q;d' | sed -E -e 's/^\s+//' )"
export AWS_SECRET_ACCESS_KEY

AWS_CA_BUNDLE="$( mktemp )"
export AWS_CA_BUNDLE
kubectl get "configmap/${SCYLLACLUSTER_NAME}-alternator-local-serving-ca" --template='{{ index .data "ca-bundle.crt" }}' > "${AWS_CA_BUNDLE}"

Now we can use aws dynamodb cli without modifications.

aws dynamodb create-table --table-name MusicCollection --attribute-definitions AttributeName=Artist,AttributeType=S AttributeName=SongTitle,AttributeType=S --key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
TABLEDESCRIPTION        2024-03-01T16:35:41+01:00       5c8aae70-d7e1-11ee-a99e-6f31aaf1d6d3    MusicCollection ACTIVE
ATTRIBUTEDEFINITIONS    Artist  S
ATTRIBUTEDEFINITIONS    SongTitle       S
KEYSCHEMA       Artist  HASH
KEYSCHEMA       SongTitle       RANGE
PROVISIONEDTHROUGHPUT   5       5
aws dynamodb list-tables
TABLENAMES      MusicCollection

Was this page helpful?

PREVIOUS
Using CQL
NEXT
Node operations using Scylla Operator
  • Create an issue
  • Edit this page

On this page

  • Using Alternator (DynamoDB)
    • Credentials
    • AWS CLI
Scylla Operator
  • master
    • v1.17
    • v1.16
    • v1.15
    • master
  • Architecture
    • Overview
    • Storage
      • Overview
      • Local CSI Driver
    • Tuning
    • ScyllaDB Manager
  • Installation
    • Overview
    • Kubernetes
      • Generic
      • EKS
      • GKE
    • GitOps (kubectl)
    • Helm
  • Resources
    • Overview
    • ScyllaClusters
      • ScyllaClusters
      • ScyllaDB clients
        • Discovering ScyllaDB Nodes
        • Using CQL
        • Using Alternator (DynamoDB)
      • Node operations using Scylla Operator
        • Upgrading version of Scylla
        • Replacing a Scylla node
        • Automatic cleanup and replacement in case when k8s node is lost
        • Maintenance mode
        • Restore from backup
      • Deploying multi-datacenter ScyllaDB clusters in Kubernetes
        • Build multiple Amazon EKS clusters with inter-Kubernetes networking
        • Build multiple GKE clusters with inter-Kubernetes networking
        • Deploy a multi-datacenter ScyllaDB cluster in multiple interconnected Kubernetes clusters
      • Exposing ScyllaDB cluster
    • ScyllaDBClusters
      • ScyllaDBClusters
      • Exposing ScyllaDB cluster
    • ScyllaDBMonitorings
    • NodeConfigs
    • ScyllaOperatorConfigs
    • RemoteKubernetesCluster
  • Quickstarts
    • Deploying ScyllaDB on GKE
    • Deploying ScyllaDB on EKS
  • Support
    • Support overview
    • Known issues
    • Troubleshooting
      • Troubleshooting installation issues
    • Gathering data with must-gather
    • Releases
  • API Reference
    • scylla.scylladb.com
      • NodeConfig (scylla.scylladb.com/v1alpha1)
      • RemoteKubernetesCluster (scylla.scylladb.com/v1alpha1)
      • RemoteOwner (scylla.scylladb.com/v1alpha1)
      • ScyllaCluster (scylla.scylladb.com/v1)
      • ScyllaDBCluster (scylla.scylladb.com/v1alpha1)
      • ScyllaDBDatacenter (scylla.scylladb.com/v1alpha1)
      • ScyllaDBMonitoring (scylla.scylladb.com/v1alpha1)
      • ScyllaOperatorConfig (scylla.scylladb.com/v1alpha1)
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 13 May 2025.
Powered by Sphinx 8.1.3 & ScyllaDB Theme 1.8.6