Skip to content

安装

系统要求

  • 操作系统 Linux / macOS / Windows
  • 内存 建议 ≥ 512 MB
  • 磁盘 SSD 推荐(LSM-Tree 写入密集型)

作为 Rust 依赖使用

toml
[dependencies]
talon = { git = "https://github.com/darkmice/talon-bin.git", tag = "v0.1.10", package = "talon-sys" }

功能开关(Feature Flags)

toml
[dependencies]
talon = { git = "https://github.com/darkmice/talon-bin.git", tag = "v0.1.10", package = "talon-sys", features = ["server"] }
Feature说明
default嵌入式模式,包含所有 9 引擎
server启用 HTTP + TCP + Redis 服务端
cluster启用 Primary-Replica 集群

配置

rust
use talon::{Talon, StorageConfig};

let config = StorageConfig {
    cache_size: 256 * 1024 * 1024,  // 256 MB 块缓存
    ..Default::default()
};
let db = Talon::open_with_config("./data", config)?;

配置参数

参数默认值说明
cache_size64 MBLSM-Tree 块缓存大小
max_write_buffer_size64 MB写入缓冲区上限
compaction_styleLeveled压缩策略

验证安装

rust
use talon::Talon;

let db = Talon::open("./test-data")?;
db.run_sql("SELECT 1 + 1")?;
println!("Talon 安装成功!");

Released under the Talon Community Dual License.