sabledb-io / sabledb

Ultra fast, persistent database supporting Redis API
https://sabledb-io.github.io/sabledb/
BSD 3-Clause "New" or "Revised" License
422 stars 10 forks source link

Replication mode: add integration framework #28

Open sabledb-io opened 2 weeks ago

sabledb-io commented 2 weeks ago

The current code is tested extensively with roughly 300 tests, however, these tests are focused on the data path and data integrity.

Logic for managing replication and automatic failover is tested manually. This needs to be changed. Adding a testing framework using scripting language (python?) could be very beneficial and increase the resilience of the code

sabledb-io commented 1 week ago

The approach here is using Rust itself to test the code.

Been adding new API:

// Create shard of 3 instances: 1 primary + 2 replicas

let shard = shard::start_shard(3).unwrap();

// Use `shard` (of type `Shard`)  to access the shard nodes
// Connect to the primary node
let mut conn = shard.primary().borrow().connect().unwrap();

// Call 'set hello world'
let res: redis::Value = conn.set("hello", "world").unwrap();
assert_eq!(res, redis::Value::Okay);