{"id":13636908,"url":"https://github.com/krojew/cdrs-tokio","last_synced_at":"2025-05-15T09:07:43.753Z","repository":{"id":36951055,"uuid":"313524652","full_name":"krojew/cdrs-tokio","owner":"krojew","description":"High-level async Cassandra client written in 100% Rust.","archived":false,"fork":false,"pushed_at":"2025-04-29T07:08:23.000Z","size":2385,"stargazers_count":143,"open_issues_count":1,"forks_count":25,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-29T07:27:32.573Z","etag":null,"topics":["cassandra","driver","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krojew.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"krojew"}},"created_at":"2020-11-17T06:14:33.000Z","updated_at":"2025-04-29T06:42:43.000Z","dependencies_parsed_at":"2023-01-17T07:46:01.194Z","dependency_job_id":"52dd4812-9686-4a63-884c-4f6120796fea","html_url":"https://github.com/krojew/cdrs-tokio","commit_stats":{"total_commits":1189,"total_committers":41,"mean_commits":29.0,"dds":0.5820016820857864,"last_synced_commit":"a82a512dce33ee889e755f954c8869957aae11e6"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krojew%2Fcdrs-tokio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krojew%2Fcdrs-tokio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krojew%2Fcdrs-tokio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krojew%2Fcdrs-tokio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krojew","download_url":"https://codeload.github.com/krojew/cdrs-tokio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310515,"owners_count":22049469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cassandra","driver","rust"],"created_at":"2024-08-02T00:01:07.254Z","updated_at":"2025-05-15T09:07:38.744Z","avatar_url":"https://github.com/krojew.png","language":"Rust","funding_links":["https://github.com/sponsors/krojew"],"categories":["Libraries","库 Libraries"],"sub_categories":["Database","数据库 Database"],"readme":"# CDRS tokio\n\n[![crates.io version](https://img.shields.io/crates/v/cdrs-tokio.svg)](https://crates.io/crates/cdrs-tokio) ![build status](https://github.com/krojew/cdrs-tokio/actions/workflows/rust.yml/badge.svg)\n\n![CDRS tokio - async Apache Cassandra driver using tokio](./cdrs-logo.png)\n\nCDRS is production-ready Apache **C**assandra **d**river written in pure **R**u*\n*s**t. Focuses on providing high\nlevel of configurability to suit most use cases at any scale, as its Java\ncounterpart, while also leveraging the\nsafety and performance of Rust.\n\n## Features\n\n- Asynchronous API;\n- TCP/TLS connection (rustls);\n- Topology-aware dynamic and configurable load balancing;\n- Configurable connection strategies and pools;\n- Configurable speculative execution;\n- LZ4, Snappy compression;\n- Cassandra-to-Rust data serialization/deserialization with custom type support;\n- Pluggable authentication strategies;\n- [ScyllaDB](https://www.scylladb.com/) support;\n- Server events listening;\n- Multiple CQL version support (3, 4, 5), full spec implementation;\n- Query tracing information;\n- Prepared statements;\n- Query paging;\n- Batch statements;\n- Configurable retry and reconnection policy;\n- Support for interleaved queries;\n- Support for Yugabyte YCQL JSONB;\n- Support for beta protocol usage;\n\n## Performance\n\nDue to high configurability of **CDRS**, the performance will vary depending on\nuse case. The following benchmarks\nhave been made against the latest (master as of 03-12-2021) versions of\nrespective libraries (except\ncassandra-cpp: 2.16.0) and protocol version 4.\n\n- `cdrs-tokio-large-pool` - **CDRS** with node connection pool equal to double\n  of physical CPU cores\n- `cdrs-tokio-small-pool` - **CDRS** with a single connection per node\n- `scylladb-rust-large-pool` - `scylla` crate with node connection pool equal to\n  double of physical CPU cores\n- `scylladb-rust-small-pool` - `scylla` crate with a single connection per node\n- `cassandra-cpp` - Rust bindings for Datastax C++ Driver, running on multiple\n  threads using Tokio\n- `gocql` - a driver written in Go\n\n\u003cimg src=\"./perf-inserts.png\" alt=\"insert benchmark\"\u003e\n\u003cimg src=\"./perf-selects.png\" alt=\"select benchmark\"\u003e\n\u003cimg src=\"./perf-mixed.png\" alt=\"mixed benchmark\"\u003e\n\nKnowing given use case, CDRS can be optimized for peak performance.\n\n## Documentation and examples\n\n- [User guide](./documentation).\n- [Examples](./cdrs-tokio/examples).\n- [API docs](https://docs.rs/cdrs-tokio/latest/cdrs_tokio/).\n- Using ScyllaDB with\n  RUST [lesson](https://university.scylladb.com/courses/using-scylla-drivers/lessons/rust-and-scylla/).\n\n## Getting started\n\nThis example configures a cluster consisting of a single node without\nauthentication, and uses round-robin\nload balancing. Other options are kept as default.\n\n```rust\nuse cdrs_tokio::cluster::session::{TcpSessionBuilder, SessionBuilder};\nuse cdrs_tokio::cluster::NodeTcpConfigBuilder;\nuse cdrs_tokio::load_balancing::RoundRobinLoadBalancingStrategy;\nuse cdrs_tokio::query::*;\n\n#[tokio::main]\nasync fn main() {\n    let cluster_config = NodeTcpConfigBuilder::new()\n        .with_contact_point(\"127.0.0.1:9042\".into())\n        .build()\n        .await\n        .unwrap();\n    let session = TcpSessionBuilder::new(RoundRobinLoadBalancingStrategy::new(), cluster_config)\n        .build()\n        .await\n        .unwrap();\n\n    let create_ks = \"CREATE KEYSPACE IF NOT EXISTS test_ks WITH REPLICATION = { \\\n                     'class' : 'SimpleStrategy', 'replication_factor' : 1 };\";\n    session\n        .query(create_ks)\n        .await\n        .expect(\"Keyspace create error\");\n}\n```\n\n## License\n\nThis project is licensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)\n  or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))\n- MIT license ([LICENSE-MIT](LICENSE-MIT)\n  or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrojew%2Fcdrs-tokio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrojew%2Fcdrs-tokio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrojew%2Fcdrs-tokio/lists"}