How scylladb/alternator-client-rust works
This crate wraps the AWS DynamoDB Rust SDK to let applications issue DynamoDB-style operations against ScyllaDB Alternator, with client-side node discovery and request routing. The main path builds an Alternator client, discovers live nodes from configured seeds and routing scopes, selects a target per operation, then sends SDK traffic with optional affinity and HTTP optimizations. The README also documents authentication modes, fallback scopes, compression, and header handling. Unsampled modules are represented only where the tree and README establish their role; uncertain internal wiring is omitted.
Main entry points: interceptors.rs SDK Interceptors · client.rs Alternator Client · config.rs Client Config · live_nodes.rs Node Discovery
Components 21
Client API
- Client Config
src/config.rs - Alternator Client
src/client.rs - Operation Customization
src/customize.rs
Discovery Routing
- Routing Scopes
src/routing_scope.rs - Node Discovery
src/live_nodes.rs - Live Node State
src/live_nodes.rs - Query Planning
src/query_plan.rs
Key Affinity
- Affinity Config
src/keyrouting/affinity_config.rs - Operation Classifier
src/keyrouting/classifier.rs - Partition Key Resolver
src/keyrouting/resolver.rs - Key Hasher
src/keyrouting/hasher.rs - MurmurHash3
src/keyrouting/murmurhash3.rs - Go-compatible RNG
src/keyrouting/go_rand.rs
HTTP Features
- SDK Interceptors
src/interceptors.rs - Request Compression
src/compression.rs - Response Decompression
src/decompression.rs - Header Optimization
src/optimize_headers.rs - User Agent
src/user_agent.rs
Other components
- Application
- Alternator Cluster
- AWS DynamoDB SDK
Connections 28
- Application → Client Config: configures
- Client Config → Alternator Client: builds
- Application → Alternator Client: uses
- Alternator Client → AWS DynamoDB SDK: wraps
- Alternator Client → Node Discovery: initializes
- Client Config → Routing Scopes: sets scope
- Node Discovery → Routing Scopes: queries by
- Node Discovery → Alternator Cluster: fetches localnodes
- Node Discovery → Live Node State: updates
- Alternator Client → Query Planning: plans requests
- Query Planning → Live Node State: reads nodes
- Query Planning → Go-compatible RNG: selects affinity
- Alternator Client → AWS DynamoDB SDK: dispatches operations
- AWS DynamoDB SDK → Alternator Cluster: sends requests
- Alternator Client → SDK Interceptors: configures
- SDK Interceptors → Request Compression: compresses request
- SDK Interceptors → Response Decompression: decodes response
- SDK Interceptors → Header Optimization: strips headers
- SDK Interceptors → User Agent: sets identity
- Operation Customization → SDK Interceptors: overrides settings
- Client Config → Affinity Config: enables affinity
- SDK Interceptors → Operation Classifier: classifies inputs
- Operation Classifier → Key Hasher: hashes keys
- Key Hasher → MurmurHash3: computes hash
- SDK Interceptors → Partition Key Resolver: triggers discovery
- Partition Key Resolver → AWS DynamoDB SDK: discovers key schema
- Partition Key Resolver → Key Hasher: uses key hashing
- Partition Key Resolver → Query Planning: builds affinity plan