kividb README

项目的 README,来自 github.com/kividbio/kividb。合并为一个 markdown 文件:README.md。

KiviDB: the in-memory database for AI and real-time apps. Redis-compatible, vector search built in.

English · 简体中文

CI Latest release Docker pulls Artifact Hub License: AGPL-3.0 Discussions Discord

kividbio%2Fkividb | Trendshift Hacker News

KiviDB is a fast, multi-threaded alternative to Redis® and Valkey, written in Rust. It speaks the Redis protocol (RESP2 and RESP3), so existing Redis clients, redis-cli and libraries work unchanged, and it has full-text and vector search built in. It runs every core on a sharded in-memory key-value design, and persists to snapshots and an optional append-only file.

On 32 cores of AWS bare metal, KiviDB 1.2.0 serves 21.2 million pipelined GETs per second: 9× Redis 8.10 and 2.3× Dragonfly, ahead of Garnet, at 0.36 ms p99 (benchmarks).

Install

Debian and Ubuntu (apt)

sudo apt update && sudo apt install -y ca-certificates curl
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://packages.kividb.io/kividb.gpg | sudo tee /etc/apt/keyrings/kividb.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/kividb.gpg] https://packages.kividb.io/deb stable main" \
  | sudo tee /etc/apt/sources.list.d/kividb.list > /dev/null
sudo apt update && sudo apt install -y kividb

Fedora, RHEL and compatibles, Amazon Linux 2023 (dnf)

sudo curl -fsSL -o /etc/yum.repos.d/kividb.repo https://packages.kividb.io/kividb.repo
sudo dnf install -y kividb

macOS, Cargo and Docker

brew install kividbio/tap/kividb                  # macOS (Homebrew)
cargo install --locked kividb                     # Linux and macOS, from crates.io
docker run -d -p 6380:6380 -v kividb-data:/home/kividb kividb/kividb:v1.2.2

Docker images are on Docker Hub and the GitHub Container Registry (ghcr.io/kividbio/kividb), tagged v1.2.2, 1.2 and latest; they are distroless (no shell). The data lives in /home/kividb: without a volume there, it is lost when the container is removed or recreated.

The apt and dnf repositories are signed with the key 6492 17DE 0F7F D7DB 3D7B AC3A E21D 8F6E DDE5 F489; check it before you install. docs/INSTALL.md has how to check it, what the packages install, upgrades and pinning, the Lua and TLS variants, the release tarballs and .deb/.rpm files on GitHub Releases, and how to verify a download. To build it yourself, see docs/BUILDING.md.

Quick start

The apt and dnf packages start KiviDB as a systemd service, on 127.0.0.1:6380. Otherwise, start it yourself:

kividb                                   # listens on 0.0.0.0:6380
redis-cli -p 6380 PING                   # PONG
redis-cli -p 6380 SET greeting hello     # OK
redis-cli -p 6380 GET greeting           # "hello"

KiviDB listens on 6380, not Redis's 6379, so the two can run side by side; point your client at that port, or pass --port 6379. Protected mode is on by default: until you set a password or a bind address, only clients on the same machine may connect. docs/CONFIGURATION.md lists the flags and the configuration file, TLS, logs and the startup update check.

Performance

KiviDB 1.2.0 against Garnet, Dragonfly, Redis, Redis Cluster and Valkey: throughput, latency, MSET, memory, snapshots and vector search

KiviDB 1.2.0 against Garnet, Dragonfly, Redis, Redis Cluster and Valkey. Click for the full-resolution video.

docs/PERFORMANCE.md has the bare-metal table and method, the full suite on Azure VMs, where KiviDB loses, earlier runs and independent reviews.

Features

Documentation

Installing · Building from source · Running and configuring · Persistence · Migrating from Redis · Compatibility and differences · Commands · Client examples · Vector search · Performance · Logs and errors · FAQ · Changelog · Releases · Website: kividb.io

Contributing

Contributions are welcome. See CONTRIBUTING.md for how to build, test and submit changes. Contributions are accepted under the Contributor License Agreement, which you sign on your first pull request.

Questions, ideas, or want to talk to the maintainers? Join us on Discord, or open a discussion.

Please follow the Code of Conduct. The Changelog lists what changed in each release.

Security

Please do not report security vulnerabilities in public issues. See SECURITY.md for how to report one privately.

License

Copyright (c) 2026 KIVIDB PRIVATE LIMITED.

KiviDB is open source software, licensed under the GNU Affero General Public License, version 3 (AGPL-3.0-only), an OSI-approved license. You may use, modify and redistribute it under its terms. See NOTICE.

Using KiviDB does not put your application under the AGPL. An application that talks to KiviDB over the network, through any Redis client, is a separate program: you can run an unmodified KiviDB as your database, in any product, open or closed, commercial or not, with no obligation on your application's code. The AGPL asks for one thing beyond the GPL: if you modify KiviDB itself and let others use your modified version over a network (for example, as a hosted service), you must offer them the source code of your modified KiviDB.

Commercial license. KIVIDB PRIVATE LIMITED owns the copyright in KiviDB and also offers it under a commercial license, for organizations that cannot use AGPL software or that want to modify or embed KiviDB without publishing their changes. Write to [email protected].

Our commitment. Every version of KiviDB we release under the AGPLv3 stays available under the AGPLv3. The Contributor License Agreement lets us offer the commercial license alongside it; it is not a way to take the open source version away.

Questions about the license are answered in the FAQ.

Trademarks

Redis® is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by KiviDB is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and KiviDB. KiviDB is not affiliated with Redis Ltd. Other names mentioned are trademarks of their respective owners.

kividb (kividbio/kividb)

正在搜索数据库…

1.2K ·GitHub
这是什么?KiviDB 是一个用 Rust 编写的快速多线程数据库,可替代 Redis 和 Valkey。它兼容 Redis 协议(RESP2/RESP3),因此现有的 Redis 客户端无需修改即可使用,并且内置全文搜索和向量搜索功能。
它是直接替换,还是需要专门的客户端?它可以直接替换。KiviDB 实现了 Redis 的网络协议,因此 redis-cli 和任何现有的 Redis 客户端库都可以无需修改地与它配合使用,只是默认端口不同(6380 而不是 6379)。
怎么把它跑起来?可以运行已发布的 Docker 镜像,或从 GitHub Releases 下载适用于 Linux(x86_64/aarch64)或 macOS(Apple Silicon/Intel)的发行版二进制文件,也可以使用 Cargo 从源码构建。它默认监听端口 6380,所以只需将任意 Redis 客户端指向该端口即可。
在把真实流量接入之前,有哪些需要注意的地方?默认情况下,除非你设置了密码或绑定地址(保护模式),它只接受本地回环连接。因此,如果在没有密码的情况下对外公开,它将暴露在互联网上。另外,Docker 默认的 seccomp 配置通常会屏蔽 io_uring,此时它会悄悄回退到 Tokio;而除非你在编译时启用了 lua 特性,否则 Lua 脚本相关命令会直接报错。
AGPL 许可证有什么讲究?KiviDB 采用 AGPL-3.0-only 许可证,但 README 明确说明,将 KiviDB 作为客户端使用,不会使你自己的应用程序受 AGPL 约束。
实际使用中,它比 Redis 快多少?在项目自己于 2026 年 10 月在 AWS Graviton3 上进行的基准测试中,KiviDB 的流水线 GET 吞吐量约为每秒 2100 万次,而 Redis 8 为 240 万次,Dragonfly 为 910 万次,其 p99 延迟不到 Dragonfly 的一半。README 提醒,这些结果只是一次受控测试的数据,并不保证你自己的工作负载也能获得同样的表现。
我能像使用 Redis Stack 一样使用向量搜索和全文搜索吗?可以。KiviDB 实现了类似 Redis Stack 的 FT. 命令(FT.CREATE、FT.SEARCH、FT.HYBRID),支持基于 BM25 的全文搜索、标签和数值过滤,以及在哈希字段上使用 FLAT 或 HNSW 索引进行近似最近邻向量搜索。因此,现有的教程和二进制向量数据在很大程度上无需修改即可使用。
重启后我的数据会怎样?KiviDB 会将数据持久化为原生快照文件(dump.kdb),其中包含每个 HNSW 向量图;同时还可以选择启用仅追加文件(AOF),在启动时回放。因此,使用 --aof 参数时,崩溃最多只会丢失约一秒的写入数据。
为什么它监听 6380 端口而不是 Redis 的 6379?这样,KiviDB 实例就可以与同一台机器上真正的 Redis 或 Valkey 实例并行运行,而不会发生端口冲突。如果你想改用其他端口,可以传入 --port 6379 来覆盖默认设置。
有哪些类似的项目?dragonfly, phpredis, redis, valkey, dicedb, pgrust, garnet, memcached
作者
kividbio
大小
108.9 MB
星标
1.2K
时长
1个月
提交 · 90 天