Anyone writing to the Alternator interface in Rust?

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.

1 Like