CDRS is looking for maintainers

CDRS is Apache Cassandra driver written in pure Rust

CDRS

CDRS is looking for maintainers

CDRS is Apache Cassandra driver written in pure Rust.

💡Looking for an async version?

  • async-std https://github.com/AlexPikalov/cdrs-async (API is not fully compatible with https://github.com/AlexPikalov/cdrs)
  • tokio https://github.com/AlexPikalov/cdrs/tree/async-tokio

Features

  • TCP/SSL connection;
  • Load balancing;
  • Connection pooling;
  • LZ4, Snappy compression;
  • Cassandra-to-Rust data deserialization;
  • Pluggable authentication strategies;
  • ScyllaDB support;
  • Server events listening;
  • Multiple CQL version support (3, 4), full spec implementation;
  • Query tracing information.

Documentation and examples

  • User guide.
  • Examples.
  • API docs (release).
  • Using ScyllaDB with RUST lesson.

Getting started

Add CDRS to your Cargo.toml file as a dependency:

Then add it as an external crate to your main.rs:

This example configures a cluster consisting of a single node, and uses round robin load balancing and default r2d2 values for connection pool.

License

This project is licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or #404)

at your option.

Issues

Collection of the latest Issues

bbarin

bbarin

0

It's more a question than an issue. I'm trying to use CDRS in an actix-web application. I would like to share the database session among the HTTP requests but for that, the struct must implement the Clonetrait. Given that, r2d2 would fit nicely. However, when trying to use TcpConnectionsManager to pass to a Poolfrom r2d2, I can only get a TransportTcp struct and not the Session itself. Am I missing something in order to get a proper session from the r2d2 pool?

bmgeek

bmgeek

0

Hello.

Thanks for CDRS crate!!

We have "prepare_tw \ exec_tw" with "with_tracing", but i can't understand how i can get time query (how much time query exec)

jatayl

jatayl

waits for publish
1

This is great software--helping out my project a ton!

I noticed that the only time struct supported by IntoRustByName is time::Timespec. However, since 0.2.0, Timespec has been deprecated in the time crate. Are there plans to update this? Let me know if I am missing something!

Thanks!

code-elf

code-elf

2

Hi! First off, thank you for a great library. I saw that support for rustls was recently added to cdrs - however, it seems that a crucial part is missing to be able to use it. Unless I'm overlooking anything, it's currently not actually possible to construct a session to connect using it, as there's no new_rusttls (or similar) method available in session.rs to use the RustlsConnectionPool. Is there any way to use this or does such a method need to be added?

lseelenbinder

lseelenbinder

bug
7

Due to how the RoundRobin(Sync) is configured, whenever one of the backing nodes is down because of outages or maintenance, all requests that would be routed to that R2D2 pool fail (because that pool has no live connections and cannot create anymore).

This is a blocking bug to using the RoundRobin load balancing mechanism, in my opinion, since it removes all possibility of failover to another node, without implementing somewhat complex logic in the client.

Was this a known limitation I overlooked or should we look into adjusting the implementation so perhaps the collection of known nodes is used equally and when one is down, others can be used?

ayonsaha2011

ayonsaha2011

1

Error

App::new() 70 | | .data(&no_compression.clone()) | |____________________^^^^^^^^^^^^^^^^^^^^^^- argument requires that borrow lasts for 'static | | | creates a temporary which is freed while still in use ... 74 | }) | - temporary value is freed at the end of this statement

ArtRand

ArtRand

enhancement
1

Hello, first off, superb job on this crate and version 2. I really like using it. Along those lines, I'd like to help contribute if possible. I was looking at a way to use rust futures/async-io and came across bb88. It might be possible to simple drop this in where you're using r2d2 for connection pool management and get futures support. Have you thought about this? (Basically I'm asking is this a fool's errand?). If you think this is a viable method - I'd be interested in implementing it. Thanks for the hard work!

A

AlexPikalov

AlexPikalov

enhancement
0

This is an enhancement related to CI pipeline. The aim is to automatize release process.

  • As a developer When my changes are pushed to a feature branch (PR branch) I want to have my changes checked via e2e test

  • As a developer When I commit a fix/new feature/breaking API change And when I make conventional commits And when new tag is created Then git history is parsed by a script And changelog file is generated and committed

  • As a CI script When PR is merged into master And all commit messages have proper format I want to create a tag with new version And the crate is published

Commit format - conventional commits https://conventionalcommits.org/

AlexPikalov

AlexPikalov

4

As we found that CDRS with feature v3 (3-rd version of Apache Cassandra binary protocol) works fine as a driver for ScyllaDB, it would make sense to create an explicit feature scylla-db.

As of now it should behavior as if CDRS has been imported with v3 feature.

AlexPikalov

AlexPikalov

1

I think it makes sense to create some helpers which would be able to convert a date into a proper Value. Generally, the approach is following some_date -> unisigned integer -> Value.

It's under discussion which crates we should provide helpers for, but for me it makes sense to provide that at least for chrono.

Related to #152

kw217

kw217

help wanted
10

Please could CDRS implement token-aware routing? This is important for performance, because it reduces network hops and also reduces load on the Cassandra cluster.

(How difficult would this be to add?)

sroebuck

sroebuck

v2
1

In a clustered cassandra environment I'm hitting occassional errors in code which creates a table and then immediately starts writing into it. The errors appear in the cassandra log as org.apache.cassandra.db.UnknownColumnFamilyException: Got slice command for nonexistent table my.test. If the table was just created, this is likely due to the schema not being fully propagated. Please wait for schema agreement on table creation.

Googling this issue it appears that this issue may be handled by other drivers by waiting for schema agreement before returning from the CREATE TABLE call.

There's a related StackOverflow response here, to quote:

The modern DataStax drivers automatically check and wait for schema agreement after you execute a schema-altering statement. Cassandra returns a special response for schema-altering statements that allows the drivers to do this automatically. Once the drivers gets that response, it (blockingly) queries the system.peers table of the node the query was executed against to check the reported schema versions of other nodes. It will continue to execute this query in a loop until either schema agreement is reached or a timeout is hit.

harrydevnull

harrydevnull

v2
6

I know we just have got the cluster manager api up. the nodes can be brought up online or node can die. we can get those information via the server events. using the server event api we should dynamically add/remove the nodes from manager pool.

Versions

Find the latest versions by id

v2.3.1 - Mar 26, 2020

v2.3.0 - Mar 13, 2020

v2.2.4 - Jan 09, 2020

fix UUID version to 0.8.1

v2.2.3 - Dec 20, 2019

v2.2.2 - Dec 19, 2019

v2.2.1 - Dec 17, 2019

  • Fix config-builder's min_idle setter #295

v2.2.0 - Aug 22, 2019

Refactor:

  • #278 make CDRS compatible with Rust 2018 edition

  • #229 rid of frame exchange duplication logic

v2.1.1 - Aug 15, 2019

  • Fix SSL feature compilation #272

v2.1.0 - May 16, 2019

  • Add StaticPasswordAuthenticator that doesn't require credentials static lifetime

  • Deprecate PasswordAuthenticator in favour of StaticPasswordAuthenticator

v2.0.0 - Apr 01, 2019

Features Implement pager state ejection https://github.com/AlexPikalov/cdrs/issues/250

Fixes

v2.0.0-beta.7 - Mar 04, 2019

2.0.0-beta.6 - Jan 10, 2019

  • fix big decimal number problem (rid of unnecessary E notation)

2.0.0-beta.5 - Jan 01, 2019

  • Fix decimal encoding / decoding algorithm #237

v2.0.0-beta.3 - Oct 06, 2018

v2.0.0-alpha - Oct 03, 2018

1.2.2 - Feb 26, 2018

  • enable session internal mutability

1.2.1 - Dec 28, 2017

1.2.0 - Nov 15, 2017

  • Fixed reconnection when a node went down and evaluation of peer address returns an error
  • Introduced IntoCDRSBytes trait and created the auto derive. See example on how to use derive for values needed to be converted into CDRS Value which could be passed into query builder as a value
  • Performance of node health check was improved

1.1.0 - Nov 02, 2017

  • Create Blob type. It's a wrapper for Vec<u8> which represents Cassandra blob type.

  • Fix full event to simple server event mapping.

  • Derive Clone for Bytes

1.0.1 - Aug 27, 2017

  • Fix simple into full server event mapping
  • Use buffered reads from TcpStream

1.0.0-beta.7 - Mar 05, 2017

1.0.0-beta.6 - Feb 27, 2017

  • bump uuid version to 0.4.0
  • derive Eq and Ord to CDRS and Compression
  • use upstream error types in CompressionError in order to make CDRS compatible with error-chain

1.0.0-beta.1 - Feb 04, 2017

  • Subscription to server events implemented
  • Query batch implemented
  • Authenticator trait changes
  • NoneAuthenticator created. For servers which don't need authentication
  • Tests moved into related src files.

0.7.0 - Jan 25, 2017

New features:

  • support for SSL-encrypted client-node connections
  • connection pools

Fixed:

  • int decoding issue #34

0.6.0 - Jan 08, 2017

Added:

  • tracing flag support
  • warning flag support
  • SchemaChange Aggregation
  • SchemaChange Function

Refactored:

  • Make CDRS-to-Rust mappers to return Result instead of Option

0.5.0 - Jan 01, 2017

Add:

  • SchemaChange response frame handler. It allows to use made changes to tables, keyspaces etc.
  • new factory-method of Query

0.4.1 - Jan 01, 2017

Added:

  • Query builder to avoid requiring a bunch of arguments in session.query. New method was introduced - session.query_with_builder(&self, q: Query).
  • session Drop implementation
  • method get_options of CDRS which retrieves options supported by server before establishing new session

Docs:

  • Added more examples

New Contributor - harrydevnull

Information - Updated Apr 19, 2022

Stars: 334
Forks: 57
Issues: 34

Repositories & Extras

Rust iAQ-Core Indoor Air Quality Sensor Driver

This is a platform agnostic Rust driver for the iAQ-Core indoor air quality sensors

Rust iAQ-Core Indoor Air Quality Sensor Driver

Rust S2-LP Radio Driver

A rust driver for the datasheet

Rust S2-LP Radio Driver

Amazon QLDB Rust Driver

This is the Rust driver for Amazon Quantum Ledger Database (QLDB), which allows Rust developers

Amazon QLDB Rust Driver

ScyllaDB Rust Driver

This is a client-side driver for Tokio

ScyllaDB Rust Driver

Rust VEML6040 RGBW Color Sensor Driver

This is a platform agnostic Rust driver for the VEML6040 RGBW color light

Rust VEML6040 RGBW Color Sensor Driver

Rust CCS811 Driver: Ultra-low Power Digital Gas Sensor for Monitoring Indoor Air Quality

This is a platform agnostic Rust driver for the CCS811 ultra-low power

Rust CCS811 Driver: Ultra-low Power Digital Gas Sensor for Monitoring Indoor Air Quality

Rust MAX44009/MAX44007 Ambient Light Sensor Driver

This is a platform agnostic Rust driver for the MAX44009 and MAX44007 ambient

Rust MAX44009/MAX44007 Ambient Light Sensor Driver

MongoDB Rust Driver

bson crate for BSON support

MongoDB Rust Driver

Rust TMP102 and TMP112 Temperature Sensor Driver

This is a platform agnostic Rust driver for the TMP102 and TMP112

Rust TMP102 and TMP112 Temperature Sensor Driver

Mongo Rust Driver

Mongo Rust driver built on top of the bson crate, the bindings are based on generated bindings by Documentation

Mongo Rust Driver
Facebook Instagram Twitter GitHub Dribbble
Privacy