Getting Started with Rudis: A Rust‑Based High‑Performance In‑Memory Database
Rudis is a Rust‑implemented, Redis‑compatible in‑memory database that offers high performance, safety, and reliability, and this guide covers its overview, quick start commands, configurable startup parameters, a comprehensive list of supported Redis commands with examples, and basic performance test results.
Overview
Rudis is a high‑performance in‑memory database written in Rust that re‑implements the core functionality of Redis while maintaining full API compatibility, aiming to provide speed, reliability, and safety.
Quick Start
Launch screen
/\_____/\
/ o o \ Rudis 0.0.1
( == ^ == )
) ( Bind: 127.0.0.1:6379
( )
( ( ) ( ) )
(__(__)___(__)__)
[2024-04-30T02:00:55Z] INFO rudis_server] Start loading appendfile
[=======================================] percent: 100% lines: 6/6
[2024-04-30T02:00:55Z] INFO rudis_server] Server initialized
[2024-04-30T02:00:55Z] INFO rudis_server] Ready to accept connectionsLocal debugging
// ordinary start
cargo run
// start with custom port
cargo run -- --port 8848
// specify configuration file
cargo run -- rudis.properties
// build the program
cargo build
cargo build --release
cargo build --release --target=x86_64-unknown-linux-muslStartup Parameters
port – default 6379
save – RDB persistence strategy, default: None
password – default: None
databases – number of databases, default: 16
appendfilename – persistence log path, default: None
appendonly – enable persistence, default: false
dbfilename – data file name, default: dump.rdb
maxclients – client limit, default: 1000
hz – timer frequency, default: 10 (times per second)
dir – persistence directory, default: "./"
bind – bound host address
Operation Commands
Below are common Redis commands supported by Rudis with example interactions.
echo
127.0.0.1:6379> echo helloword
hellowordping
127.0.0.1:6379> ping
PONGset
127.0.0.1:6379> set user bailiang
OKset with expiration
127.0.0.1:6379> set user bailiang px 10000
OK
127.0.0.1:6379> set user bailiang ex 10
OKget
127.0.0.1:6379> get user
bailiangdel
127.0.0.1:6379> del username
(integer) 1
127.0.0.1:6379> del username password
(integer) 2exists
127.0.0.1:6379> exists user
(integer) 0keys
127.0.0.1:6379> keys *
(empty list or set)auth
127.0.0.1:6379> auth 123456
OKexpire
127.0.0.1:6379> expire user 10000
(integer) 0select
127.0.0.1:6379> select 1
OKdbsize
127.0.0.1:6379> dbsize
(integer) 2flushdb
127.0.0.1:6379> flushdb
OKflushall
127.0.0.1:6379> flushall
OKappend
127.0.0.1:6379> append user bailiang
(integer) 10move
127.0.0.1:6379> move user 0
OKrename
127.0.0.1:6379> rename username new_username
OKrpush
127.0.0.1:6379> rpush key value1 value2
OKlpush
127.0.0.1:6379> lpush key value3 value4
OKllen
127.0.0.1:6379> llen key
(integer) 4Supported Commands Overview
Rudis implements a broad subset of Redis commands covering string, list, set, hash, sorted‑set and server‑control operations. The original documentation marks each command with support status, append‑file logging capability, test‑case availability, and documentation completeness.
Performance Test
100 000 lines processed in 00:00:04
200 000 lines processed in 00:00:09
400 000 lines processed in 00:00:19
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
