Avro serialization and schema derivation from Rust types
| benches | ||
| evola-derive | ||
| examples | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
Evola
A high-performance, minimal Avro binary codec implementation in Rust with built-in schema evolution support.
Features
- Fast binary encoding/decoding - Optimized for speed with zero-copy deserialization
- Schema evolution - Built-in support for schema migration with defaults, aliases, and optional fields
- Derive macros - Automatic schema generation and serialization from Rust types
- Minimal dependencies - Lightweight and focused on performance
Quick Start
use evola::{AvroSchema, AvroSerialize, AvroDeserialize};
#[derive(AvroSchema, AvroSerialize, AvroDeserialize)]
struct User {
#[avro(0)]
id: i64,
#[avro(1)]
name: String,
#[avro(2, default = "unknown@example.com")]
email: String,
}
// Serialize
let user = User {
id: 1,
name: "Alice".to_string(),
email: "alice@example.com".to_string(),
};
let bytes = user.serialize_to_vec().unwrap();
// Deserialize
let decoded = User::deserialize_from_slice(&bytes).unwrap();
Schema Evolution
Evola supports seamless schema evolution with:
- Default values - Fields can have default values for backward compatibility
- Optional fields - Option fields automatically default to None
- Field aliases - Rename fields while maintaining compatibility
- Zero-copy strings - Borrow strings directly from the input buffer
Performance
Benchmarks show Evola is significantly faster than other Rust serialization libraries:
- ~35% faster deserialization with zero-copy strings
- Optimized varint encoding
- Minimal allocations
License
MIT or Apache 2.0