ByteHint Logo™
HomeServices
Industries
Resources
About Us
Contact
ByteHintByteHintByteHintByteHint
ByteHint Logo

Building innovative solutions for the digital future. Transform your ideas into reality with our cutting-edge technology.

Quick Links

HomeAbout UsBlogCase StudiesContactClient Testimonials

Legal

Privacy PolicyTerms & ConditionsRefund Policy

Get In Touch

Veerbhadra Nagar
Pune City, Maharashtra
India 411045

info@bytehint.com
+91 93709 55842
© 2026 ByteHint. All rights reserved.
Case studiesRedis-compatible Rust Database

A Redis-compatible database in Rust with JSON, time-series and SQL built in

A Redis-compatible database server in Rust that runs commands on different keys in parallel and builds in JSON, time-series, Bloom filters, schemas and SQL queries.

Client
ByteHint
Industry
Developer tools and infrastructure
Type
API / Backend

Navigate

The problem

Redis is the default in-memory store, but it executes commands on a single thread, and JSON, time-series and probabilistic types need separate modules. The goal was a wire-compatible alternative in Rust that uses every core and ships those types built in.

  1. 01

    Single-threaded execution

  2. 02

    Features spread across modules

  3. 03

    No type checking on stored values

  4. 04

    Staying wire-compatible

  5. 05

    Durability without slowing writes

The solution

A Rust server speaks the Redis protocol, runs a task per connection and keeps every value in one sharded map, so commands on different keys run in parallel. Writes go to a background log writer, so a slow disk never blocks a client.

Redis wire compatibility

A hand-written RESP parser handles partial and pipelined frames, so redis-cli, redis-benchmark and standard client libraries work unchanged.

Native JSON with JSONPath

Set, get and update parts of JSON documents by path, including array appends and numeric increments.

Time-series and Bloom filters

Time series with retention, labels and range queries, and Bloom filters for membership checks, with no modules to install.

Typed schemas

Define a schema, and typed writes are rejected when the value does not match it.

SQL over the keyspace

Select, count and delete keys by name pattern, type, memory or TTL with a SQL statement.

Built-in observability

A Prometheus endpoint with 13 metric families, a health endpoint, a slow log for commands over 1 ms and hot-key tracking.

How it works

Developers start one binary and point any Redis client at it. Familiar commands work as before, and the same connection can store JSON documents, time series and Bloom filters, validate values against schemas, and query the keyspace with SQL. Prometheus metrics, a slow log and hot-key tracking are built in.

Architecture · Architecture

Architecture
Clients over TCP, the protocol parser and auth gate, the command router, a sharded keyspace, background tasks and the metrics endpoint.

One write, end to end · Sequence

One write, end to end
A SET from bytes to reply: frame parsing, auth check, a write to one shard, the async log hand-off and per-command metrics.

Whiteboard on the database · Sequence

Whiteboard on the database
Create, join, draw and archive a board: state in the database, broadcast through Socket.IO, archived to Postgres when empty.

Infrastructure · Infrastructure

Infrastructure
CI test matrix, container images, the hosted database endpoint, the demo bridge on Render and the Postgres archive.

Data model · Data Model

Data model
Server state, the value types, the expiry heap and schema registry, and the whiteboard's archive tables.

Authentication · Auth Flow

Authentication
Per-connection password auth: commands are refused until AUTH succeeds, with PING and QUIT exempt.

Key decisions

Sharded concurrent map instead of one thread

Chose DashMap plus a Tokio task per connection over The single-threaded, lock-free event loop Redis uses

Commands on different keys run in parallel. The project's benchmark shows the gain on non-pipelined commands and the cost under heavy pipelining, where per-command locking dominates.

Write log through a channel

Chose A bounded channel feeding a background append-only-file writer with a 64 KB buffer over Writing and syncing inside the command path

A slow disk never blocks a client. The trade-off is written in the code: when the channel is full, entries are dropped in favour of speed.

Speak the Redis protocol

Chose A RESP2 parser instead of a custom protocol over A new protocol with its own client library

Every demo uses a stock Redis client, and benchmarking uses Redis's own tool, so there is nothing new for developers to install.

Extra types built into one value enum

Chose JSON, time-series, Bloom filters and schemas as variants of one value type over A plug-in module system

One binary, one memory estimate per value, and one keyspace that the SQL query command can scan by type.

Real-time fan-out in the app layer

Chose Socket.IO broadcasting in the demo, with state stored in the database over Database-level publish and subscribe

The server has no pub/sub or transactions yet, so the demo apps handle broadcasting and order serialisation themselves.

API architectureArchitecture
The Redis wire protocol over TCP for data, with a hand-written parser that handles partial and pipelined frames, and HTTP for metrics and health.
Horizontal partitioningArchitecture · Partial
The keyspace is striped across DashMap shards inside one process, so commands on different keys do not wait on each other. It does not partition data across nodes.
Message queuesArchitecture · Partial
An in-process bounded channel decouples the request path from the append-only-file writer, with write, flush and shutdown messages.
Observability stackReliability & Operations · Partial
Built-in Prometheus metrics with 13 families, a health endpoint, a slow log and hot-key tracking, available without an external agent.

How we delivered it

  1. Phase 1

    Core server

  2. Phase 2

    Feature-complete database

  3. Phase 3

    Collaborative whiteboard demo

  4. Phase 4

    Order-book simulator

Results

103

Commands routed

Redis-style commands plus JSON, time-series, Bloom, schema and SQL commands, counted in the command router.

+42.8%

Non-pipelined INCR vs Redis

Single machine, redis-benchmark, as reported in the project paper. Pipelined writes are slower than Redis.

78

Automated tests passing

32 library and 46 command tests, run for this case study. 7 integration tests need a live server.

Tech stack

Languages & Runtime

  • RustThe database server, edition 2021
  • Node.js20Demo app servers

Frameworks

  • Axum0.7.9HTTP server for the metrics, health and info endpoints

UI

  • React18.3.1Whiteboard client

Backend Libraries

  • Tokio1.49.0Async runtime: a task per connection, expiry loop and log writer
  • DashMap6.1.0Sharded concurrent map for the keyspace and metrics counters
  • Redis protocol (RESP)Wire protocol, so stock Redis clients and tools work unchanged
  • sqlparser0.39.0Parses the SQL query and explain commands
  • jsonpath-rust0.7.5JSONPath for the JSON commands
  • serde1.0.228Config and schema serialisation
  • clap4.5.54Command-line flags
  • Socket.IO4.8.3Real-time whiteboard events

Database & Storage

  • PostgreSQLArchive of finished whiteboard boards and strokes

Cloud & Infrastructure

  • RenderFree web service hosting the order-book demo

IaC & Deployment

  • DockerMulti-stage images for the server and the whiteboard

CI/CD

  • GitHub ActionsTests on three operating systems, format and lint checks, coverage and release builds

Observability

  • PrometheusExposition endpoint with 13 metric families

Have a similar challenge?

Tell us what you're building and we'll show you how we'd approach it.

Talk to us

Navigate

Get started with
your project

More case studies

A one-month deadline, no team, and a working team in eight days
Consumer apps and creator economy
AI Social App Team BuildProject

A one-month deadline, no team, and a working team in eight days

A studio promised its creator client an AI social app in a month with one developer. We scoped the real need and had four roles working eight days after the first call.

React NativeExpoLLM orchestration
Velocity Tweaks: a design-first e-commerce site that reached a 25% CTR
Gaming and PC optimization
Velocity TweaksWebsite

Velocity Tweaks: a design-first e-commerce site that reached a 25% CTR

A full-stack, design-first e-commerce build for a PC optimization brand, with cart, checkout and key delivery, that reached a client-reported 25% CTR in a low-conversion niche.

ReactExpressStripe
An Amazon deals bot that posts the best gaming discounts to Discord
Gaming and PC optimization
Amazon Deals BotBot

An Amazon deals bot that posts the best gaming discounts to Discord

A Discord bot that pulls the best gaming deals from Amazon through its Product Advertising API and posts them to the community every four hours.

Pythondiscord.pyAmazon Product Advertising API