Databases 7 min read

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.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
Getting Started with Rudis: A Rust‑Based High‑Performance In‑Memory Database

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 connections

Local 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-musl

Startup 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
helloword

ping

127.0.0.1:6379> ping
PONG

set

127.0.0.1:6379> set user bailiang
OK

set with expiration

127.0.0.1:6379> set user bailiang px 10000
OK
127.0.0.1:6379> set user bailiang ex 10
OK

get

127.0.0.1:6379> get user
bailiang

del

127.0.0.1:6379> del username
(integer) 1
127.0.0.1:6379> del username password
(integer) 2

exists

127.0.0.1:6379> exists user
(integer) 0

keys

127.0.0.1:6379> keys *
(empty list or set)

auth

127.0.0.1:6379> auth 123456
OK

expire

127.0.0.1:6379> expire user 10000
(integer) 0

select

127.0.0.1:6379> select 1
OK

dbsize

127.0.0.1:6379> dbsize
(integer) 2

flushdb

127.0.0.1:6379> flushdb
OK

flushall

127.0.0.1:6379> flushall
OK

append

127.0.0.1:6379> append user bailiang
(integer) 10

move

127.0.0.1:6379> move user 0
OK

rename

127.0.0.1:6379> rename username new_username
OK

rpush

127.0.0.1:6379> rpush key value1 value2
OK

lpush

127.0.0.1:6379> lpush key value3 value4
OK

llen

127.0.0.1:6379> llen key
(integer) 4

Supported 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

Redis CompatibilityIn-Memory DatabaseDatabase CommandsRudis
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.