Rust version is pretty fast, except writes are still slow if auto-flush is enabled.
Is it smart?
No
So what is YEDB for?
YEDB is ultra-reliable, thread-safe and very easy to use.
I don't like Rust
YEDB is absolutely reliable rugged key-value database, which can survive in any power loss, unless the OS file system die. Keys data is saved in the very reliable way and immediately flushed to disk (this can be disabled to speed up the engine but is not recommended - why then YEDB is used for).
Rust version is built on top of Serde framework.
All key values are serde_json::Value objects.
Storage serialization formats supported: JSON (default), YAML, MessagePack and CBOR.
As binary type is not supported by serde_json::Value at this moment, Rust version can not handle binary key values.
Contains: embedded library, async server and command-line client (TCP/Unix socket only).
The command-line client is very basic. If you need more features, use yedb Python CLI.
```rust use yedb::Database; use serde_json::Value;
fn main() { let mut db = yedb::Database::new(); db.setdbpath(&"/tmp/db1".toowned()).unwrap(); db.open().unwrap(); let keyname = "test/key1".toowned(); db.keyset(&keyname, Value::from(123u8)).unwrap(); println!("{:?}", db.keyget(&keyname)); db.keydelete(&key_name).unwrap(); db.close().unwrap(); } ```
```rust use yedb::YedbClient; use serde_json::Value;
fn main() { let mut db = yedb::YedbClient::new("tcp://127.0.0.1:8870"); let keyname = "test/key1".toowned(); db.keyset(&keyname, Value::from(123u8)).unwrap(); println!("{:?}", db.keyget(&keyname)); db.keydelete(&keyname).unwrap(); } ```