Skip to content

Introduction

DBX is a minimal, blazing-fast Redis API proxy designed for edge and embedded systems. Built in Rust, it provides a clean RESTful interface and real-time WebSocket connections for Redis operations.

What is DBX?

DBX acts as a lightweight proxy that sits between your applications and Redis, providing:

  • Redis-Optimized: High-performance Redis operations with connection pooling
  • Edge-Friendly: Minimal ~50MB Docker image perfect for edge deployments
  • Dual Protocol: Both REST API and WebSocket support for different use cases
  • Type Safety: Full TypeScript SDK with comprehensive type definitions via NAPI bindings
  • Batch Operations: Efficient bulk operations for better performance

Key Features

🚀 Performance

  • Ultra-low latency: Built in Rust for maximum performance
  • Connection pooling: Configurable Redis connection pool
  • Batch operations: Reduce round trips with bulk operations
  • WebSocket support: Real-time operations without HTTP overhead

🔧 Redis Operations

  • String Operations: Get, set, delete with TTL support
  • Hash Operations: Field operations, batch operations, metadata
  • Set Operations: Member operations, set arithmetic, batch operations
  • Admin Operations: Health checks, server stats, configuration management

🌐 Connectivity

  • REST API: Standard HTTP endpoints for all Redis operations
  • WebSocket: Real-time bidirectional communication
  • TypeScript SDK: Full-featured client library with type safety via NAPI bindings
  • Batch Support: Pattern-based and bulk operations

Architecture

┌─────────────────┐    ┌─────────────┐    ┌─────────────┐
│   Your App      │    │     DBX     │    │    Redis    │
│                 │◄──►│   Proxy     │◄──►│             │
│  (TypeScript    │    │  (Rust)     │    │  Database   │
│   SDK)          │    │             │    │             │
└─────────────────┘    └─────────────┘    └─────────────┘

Use Cases

Edge Computing

Deploy DBX on edge nodes to provide local database access with cloud synchronization capabilities.

IoT Applications

Use DBX in embedded systems to provide a standardized API for various database backends.

Microservices

Integrate DBX as a database proxy layer in microservice architectures for consistent data access patterns.

Real-time Applications

Leverage WebSocket connections for real-time data synchronization and event streaming.

Quick Start

Get started with DBX in minutes:

# Using Docker (recommended)
docker run -d --name dbx -p 3000:3000 \
  -e REDIS_URL=redis://localhost:6379 \
  effortlesslabs/dbx:latest
 
# Or run with convenience script
./scripts/run.sh --redis-url redis://localhost:6379
 
# Install TypeScript SDK
npm install @0dbx/redis
import { DbxRedisClient } from "@0dbx/redis";
 
const client = new DbxRedisClient("http://localhost:3000");
 
// String operations
await client.string.set("key", "value", 3600);
const value = await client.string.get("key");
 
// Set operations
await client.set.addMember("tags", "redis");
const members = await client.set.getMembers("tags");
 
// WebSocket client
import { DbxWsClient } from "@0dbx/redis";
const wsClient = new DbxWsClient("ws://localhost:3000/redis_ws");
await wsClient.string.set("key", "value");

API Endpoints

REST API

  • GET /redis/string/{key} - Get string value
  • POST /redis/string/{key} - Set string value
  • DELETE /redis/string/{key} - Delete string value
  • GET /redis/hash/{key}/field/{field} - Get hash field
  • POST /redis/hash/{key}/field/{field} - Set hash field
  • GET /redis/set/{key}/members - Get set members
  • POST /redis/set/{key}/members - Add set members
  • GET /redis/admin/health - Health check
  • GET /redis/admin/ping - Ping server

WebSocket API

  • ws://localhost:3000/redis_ws/string/ws - String operations
  • ws://localhost:3000/redis_ws/hash/ws - Hash operations
  • ws://localhost:3000/redis_ws/set/ws - Set operations
  • ws://localhost:3000/redis_ws/admin/ws - Admin operations

Next Steps

Community

License

DBX is open source and available under the MIT License.