How ran-gan/rendis works
Rendis is a Redis-compatible in-memory key-value database with a WebSocket bridge for deployments that cannot expose TCP. The main workflow is a client SDK or CLI encoding Redis commands, connecting directly over TCP or through the WebSocket gateway, then receiving RESP responses from the server’s command handler and store. The graph also preserves expiration, snapshot persistence, language clients, and the local TCP tunnel. Several server and CLI details are unsampled; those links are included only where the README or shown excerpts support them.
Main entry points: server.go WebSocket gateway · client.js JavaScript SDK · client.py Python SDK · main.go Rendis CLI
Components 22
Client interfaces
- Rendis CLI
client/cli/main.go - Go SDK
client/golang/client.go - JavaScript SDK
client/javascript/src/client.js - JS RESP codec
client/javascript/src/protocol.js - JS WebSocket connection
client/javascript/src/connection.js - Python SDK
client/python/rendis/client.py - Python RESP codec
client/python/rendis/protocol.py - Python WebSocket connection
client/python/rendis/connection.py
WebSocket bridge
- TCP tunnel client
server/internal/tunnel/main.go - WebSocket gateway
server/internal/gateway/server.go - Connection proxy
server/internal/gateway/proxy.go - Gateway authentication
server/internal/gateway/auth.go
Database engine
- TCP server
server/internal/server/server.go - Client handler
server/internal/server/client.go - Command handler
server/internal/server/handler.go - RESP reader
server/internal/protocol/reader.go - RESP writer
server/internal/protocol/writer.go
Storage operations
- In-memory store
server/internal/store/store.go - Key expiration
server/internal/store/expiry.go - Snapshot worker
server/internal/persistence/worker.go - Persistence providers
server/internal/persistence
Other components
- Application client
Connections 27
- Application client → Rendis CLI: issues commands
README.md - Application client → Go SDK: uses SDK
README.md - Application client → JavaScript SDK: uses SDK
README.md - Application client → Python SDK: uses SDK
README.md - JavaScript SDK → JS RESP codec: encodes commands
client/javascript/src/client.js - JavaScript SDK → JS RESP codec: decodes responses
client/javascript/src/client.js - JavaScript SDK → JS WebSocket connection: sends and receives
client/javascript/src/client.js - Python SDK → Python RESP codec: encodes commands
client/python/rendis/client.py - Python SDK → Python RESP codec: decodes responses
client/python/rendis/client.py - Python SDK → Python WebSocket connection: sends and receives
client/python/rendis/client.py - Rendis CLI → WebSocket gateway: connects by WebSocket
README.md - Go SDK → WebSocket gateway: connects by WebSocket
README.md - JS WebSocket connection → WebSocket gateway: opens WebSocket
client/javascript/src/connection.js - Python WebSocket connection → WebSocket gateway: opens WebSocket
client/python/rendis/connection.py - TCP tunnel client → WebSocket gateway: dials WebSocket
server/internal/tunnel/main.go - WebSocket gateway → Connection proxy: routes connection
server/internal/gateway/server.go - WebSocket gateway → Gateway authentication: guards profiling
server/internal/gateway/server.go - Connection proxy → TCP server: forwards to TCP
README.md - Rendis CLI → TCP server: connects directly
README.md - TCP server → Client handler: dispatches clients
server/internal/server/server.go - Client handler → RESP reader: parses RESP
server/internal/server/client.go - Client handler → Command handler: dispatches commands
server/internal/server/client.go - Command handler → In-memory store: executes commands
README.md - Command handler → RESP writer: formats responses
- In-memory store → Key expiration: expires keys
README.md - Snapshot worker → In-memory store: reads snapshot
server/internal/persistence/worker.go - Snapshot worker → Persistence providers: saves snapshot
server/internal/persistence/worker.go