I’m working in Rust, and am interested in talking to ScyllaDB via their Alternator API. I gather I can just use the AWS S3 SDK, configured appropriately. Not seeing a lot of examples laying around… anyone here done this?
Indeed, Alternator is API-compatible with DynamoDB, so you can just use Amazon’s regular AWS SDK for Rust - which you called it “S3 SDK” but they are actually SDKs for all of AWS, including S3 but also DynamoDB and other things. There’s a lot of Amazon documentation on how to do this - e.g. DynamoDB examples using SDK for Rust - AWS SDK for Rust.
One thing you should be aware of, however, is that Amazon’s SDKs normally accept one “endpoint URL” for the DynamoDB service. An example endpoint URL is https://dynamodb.us-east-1.amazonaws.com. But Alternator is actually a cluster of multiple nodes - so which of them will you send the requests to? You don’t want to just pick one of them, you want to balance the load of requests between all nodes.
So you’ll probably need some sort of load-balancing solution. You can have a server-side load balancer (e.g., an HTTP load balancer, or a DNS load balancer) in front of your cluster. Or you can have a client-side load balancer - a small “hack” to the AWS SDK that will allow it to pick a different ScyllaDB node for each request instead of always the same node. We have examples of such client-side load balancers in GitHub - scylladb/alternator-load-balancing: Various tricks, scripts, and libraries, for load balancing multiple Alternator nodes - but unfortunately not yet in Rust.
Thanks for getting back to me. I of course meant to say “DynamoDB SDK” (not S3) and have been happily using it to code against the Alternator API for the past few months. Also aware of the load-balancing issue.
To anyone who finds this via search, you can just use the DDB SDK. Connect with aws_config::defaults(BehaviorVersion::latest()).endpoint_url(/* Alternator endpoint */)
& off you go.