| Crates.io | kafka-backup-core |
| lib.rs | kafka-backup-core |
| version | 0.6.0 |
| created_at | 2025-12-03 11:07:57.140085+00 |
| updated_at | 2026-01-18 08:32:48.529139+00 |
| description | Core engine for Kafka backup and restore operations with point-in-time recovery |
| homepage | https://github.com/osodevops/kafka-backup |
| repository | https://github.com/osodevops/kafka-backup |
| max_upload_size | |
| id | 1963842 |
| size | 638,339 |
Core engine for high-performance Kafka backup and restore operations with point-in-time recovery (PITR).
Add to your Cargo.toml:
[dependencies]
kafka-backup-core = "0.1"
tokio = { version = "1", features = ["full"] }
use kafka_backup_core::{Config, backup::BackupEngine};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let config = Config::load_from_file("backup.yaml")?;
let engine = BackupEngine::new(config).await?;
engine.run().await?;
Ok(())
}
use kafka_backup_core::{Config, RestoreEngine};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let config = Config::load_from_file("restore.yaml")?;
let engine = RestoreEngine::new(config).await?;
engine.run().await?;
Ok(())
}
use kafka_backup_core::{OffsetResetExecutor, OffsetResetPlan};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let executor = OffsetResetExecutor::new("kafka:9092").await?;
let plan = OffsetResetPlan::from_file("offset-mapping.json")?;
executor.execute(plan).await?;
Ok(())
}
| Component | Description |
|---|---|
BackupEngine |
Orchestrates backup operations to cloud storage |
RestoreEngine |
Handles restore with PITR filtering |
StorageBackend |
Abstraction over S3, Azure, GCS, filesystem |
OffsetResetExecutor |
Consumer group offset management |
ThreePhaseRestore |
Complete restore with offset recovery |
CircuitBreaker |
Fault tolerance for transient failures |
use kafka_backup_core::storage::{StorageBackendConfig, create_backend};
// S3
let s3 = StorageBackendConfig::S3 {
bucket: "my-bucket".into(),
region: Some("us-east-1".into()),
prefix: Some("backups/".into()),
};
// Azure Blob
let azure = StorageBackendConfig::Azure {
container: "my-container".into(),
account: "myaccount".into(),
prefix: Some("backups/".into()),
};
// Local filesystem
let fs = StorageBackendConfig::Filesystem {
path: "/data/backups".into(),
};
See the configuration guide for complete options.
For command-line usage, install the kafka-backup CLI:
# Homebrew (macOS/Linux)
brew install osodevops/tap/kafka-backup
# Or download from GitHub Releases
MIT License - see LICENSE