Crates.io | cdrs-tokio |
lib.rs | cdrs-tokio |
version | |
source | src |
created_at | 2020-11-17 06:46:58.507075 |
updated_at | 2024-11-29 07:19:30.696641 |
description | Async Cassandra DB driver written in Rust |
homepage | https://github.com/krojew/cdrs-tokio |
repository | https://github.com/krojew/cdrs-tokio |
max_upload_size | |
id | 313199 |
Cargo.toml error: | TOML parse error at line 21, column 1 | 21 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
CDRS is production-ready Apache Cassandra driver written in pure Ru* *s**t. Focuses on providing high level of configurability to suit most use cases at any scale, as its Java counterpart, while also leveraging the safety and performance of Rust.
Due to high configurability of CDRS, the performance will vary depending on use case. The following benchmarks have been made against the latest (master as of 03-12-2021) versions of respective libraries (except cassandra-cpp: 2.16.0) and protocol version 4.
cdrs-tokio-large-pool
- CDRS with node connection pool equal to double
of physical CPU corescdrs-tokio-small-pool
- CDRS with a single connection per nodescylladb-rust-large-pool
- scylla
crate with node connection pool equal to
double of physical CPU coresscylladb-rust-small-pool
- scylla
crate with a single connection per nodecassandra-cpp
- Rust bindings for Datastax C++ Driver, running on multiple
threads using Tokiogocql
- a driver written in GoKnowing given use case, CDRS can be optimized for peak performance.
This example configures a cluster consisting of a single node without authentication, and uses round-robin load balancing. Other options are kept as default.
use cdrs_tokio::cluster::session::{TcpSessionBuilder, SessionBuilder};
use cdrs_tokio::cluster::NodeTcpConfigBuilder;
use cdrs_tokio::load_balancing::RoundRobinLoadBalancingStrategy;
use cdrs_tokio::query::*;
#[tokio::main]
async fn main() {
let cluster_config = NodeTcpConfigBuilder::new()
.with_contact_point("127.0.0.1:9042".into())
.build()
.await
.unwrap();
let session = TcpSessionBuilder::new(RoundRobinLoadBalancingStrategy::new(), cluster_config)
.build()
.await
.unwrap();
let create_ks = "CREATE KEYSPACE IF NOT EXISTS test_ks WITH REPLICATION = { \
'class' : 'SimpleStrategy', 'replication_factor' : 1 };";
session
.query(create_ks)
.await
.expect("Keyspace create error");
}
This project is licensed under either of
at your option.