Aerospike Rust Client
An Aerospike client library for Rust.
Notice: This is a work in progress. Use with discretion. Feedback, bug reports and pull requests are welcome!
This library is compatible with Rust v1.0+ and supports the following operating systems: Linux, Mac OS X (Windows builds are possible, but untested)
Usage:
The following is a very simple example of CRUD operations in an Aerospike database.
extern crate aerospike;
use Arc;
use Instant;
use thread;
use Client;
use ;
use operations;
Known Limitations
The client currently supports all single-key operations supported by Aerospike, incl. the operate command with full support of List and (Sorted) Map operations. The client also supports scan and query operations incl. support for User-Defined Functions in the Lua scripting language, as well as APIs to manage secondary indexes. For Aerospike Enterprise edition deployments the client supports managing users and roles.
However the following features are not yet supported in the Aerospike Rust client:
- Batch requests
- Query Aggregation using Lua User-Defined Functions (which requires integrating the Lua run-time environment into the client)
- Async Task operations (like execute UDF on scan/queries, index drop/create operations, etc.)
- Secure connections using TLS (requires AS 3.10+)
- IPv6 support
Tests
This library is packaged with a number of tests. The tests assume that an
Aerospike cluster is running at localhost:3000
. To test using a cluster at a
different address, set the AEROSPIKE_HOSTS
environment variable to the list
of cluster hosts.
To run all the test cases:
$ export AEROSPIKE_HOSTS=127.0.0.1:3000
$ cargo test
To enable debug logging for the aerospike
crate:
$ RUST_LOG=aerospike=debug cargo test
To enable backtraces:
$ RUST_LOG=aerospike=debug RUST_BACKTRACE=1 cargo test
Benchmarks
The micro-benchmarks in the benches
directory require nightly Rust builds to execute:
$ export AEROSPIKE_HOSTS=127.0.0.1:3000
$ rustup run nightly cargo bench