Scripts2026年5月21日·1 分钟阅读

Redka — Redis-Compatible Database Backed by SQLite

A Redis-compatible API implemented on top of SQLite, combining the simplicity of Redis commands with the durability and portability of SQLite.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Redka Overview
直接安装命令
npx -y tokrepo@latest install d354246d-5551-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Redka is an embedded and standalone database that reimplements core Redis data structures on top of SQLite. It was created for use cases where you want the familiar Redis API for strings, hashes, lists, sets, and sorted sets, but need the data to be durable, portable, and queryable as a single file — without running a separate Redis server.

What Redka Does

  • Implements Redis-compatible commands for strings, hashes, sets, sorted sets, and lists
  • Stores all data in a single SQLite file with full ACID durability
  • Provides both a standalone server mode and an embeddable Go library
  • Supports key expiration and TTL management like Redis
  • Allows direct SQL queries on the underlying SQLite tables for advanced use cases

Architecture Overview

Redka maps each Redis data type to a set of SQLite tables with appropriate indexes. The standalone server speaks the Redis RESP protocol, so any Redis client library can connect without modification. Internally, each command translates to one or more SQL operations within a transaction. The Go library provides the same API for embedding directly into Go applications without the network layer.

Self-Hosting & Configuration

  • Install the binary via go install or download pre-built releases from GitHub
  • Run redka with a database file path to start the RESP-compatible server
  • Configure the listen address and port with command-line flags
  • Embed as a Go library by importing the redka package and opening a database handle
  • Back up the database by copying the single SQLite file while idle or using SQLite backup API

Key Features

  • Redis RESP protocol compatibility means existing clients work without changes
  • Single-file storage makes backup, replication, and migration trivial
  • ACID transactions ensure data is never lost on crash or power failure
  • No external dependencies or server processes when used as an embedded library
  • Direct SQL access to the underlying data for reporting and analytics

Comparison with Similar Tools

  • Redis — Redis runs as a separate server with in-memory storage; Redka is file-based with SQLite durability
  • KeyDB — KeyDB is a multithreaded Redis fork; Redka trades speed for zero-ops SQLite portability
  • DragonflyDB — Dragonfly is a high-performance Redis replacement; Redka targets embedded and single-node use
  • BoltDB/bbolt — bbolt is a key-value store; Redka adds Redis data structures (hashes, sets, sorted sets)
  • Valkey — Valkey is the Redis fork; Redka is a clean-room SQLite implementation of the Redis API

FAQ

Q: Is Redka as fast as Redis? A: No. Redka trades raw speed for durability and simplicity. It is suitable for moderate workloads where persistence matters more than microsecond latency.

Q: Does Redka support all Redis commands? A: Redka supports the core data structure commands (strings, hashes, lists, sets, sorted sets, keys). Advanced features like Lua scripting, pub/sub, and clustering are not supported.

Q: Can I use Redka with my existing Redis client library? A: Yes. The standalone server speaks the RESP protocol, so any standard Redis client in any language can connect.

Q: Is the SQLite database portable across operating systems? A: Yes. SQLite databases are cross-platform binary files that work on any OS without conversion.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产