respd is a Redis-compatible server using metastore as its backend. It is designed to work seamlessly with Redis clients and supports a subset of Redis commands, along with namespace management features.
respd --data-dir=/tmp/respd/dataWith admin authentication:
respd --data-dir=/tmp/respd/data --admin=mypasswordBy default, respd listens on 127.0.0.1:6379 and can be accessed using any Redis client.
| Command | Description | Example Usage |
|---|---|---|
| GET | Get the value of a key | GET mykey |
| MGET ... | Get the values of multiple keys | MGET key1 key2 |
| SET | Set the value of a key | SET mykey somevalue |
| DEL | Delete a key | DEL mykey |
| EXISTS | Check if a key exists | EXISTS mykey |
| PING [message] | Ping the server (optionally with message) | PING or PING hello |
| CHECK | Verify data integrity for a key | CHECK mykey |
| LENGTH | Get the size (in bytes) of a key's value, returns nil if key doesn't exist | LENGTH mykey |
| KEYTIME | Get the last-update timestamp of a key (Unix time), returns nil if key doesn't exist | KEYTIME mykey |
| AUTH | Authenticate as admin | AUTH mypassword |
| SELECT [password] | Switch to a different namespace (with optional password for protected namespaces) | SELECT mynamespace or SELECT mynamespace mypassword |
| NSNEW | Create a new namespace (admin only) | NSNEW mynamespace |
| NSINFO | Show info about a namespace | NSINFO mynamespace |
| NSLIST | List all available namespaces | NSLIST |
| NSSET | Set a property for a namespace (admin only) | NSSET mynamespace worm 1 |
| DBSIZE | Get the number of keys in the current namespace (approximate) | DBSIZE |
| SCAN [cursor] | Incrementally iterate over keys in the current namespace | SCAN 0 or SCAN mycursor |
| RSCAN [cursor] | Incrementally iterate over keys in backward direction | RSCAN 0 or RSCAN mycursor |
- All commands are case-insensitive.
- Namespace commands (
SELECT,NSNEW,NSINFO,NSLIST) allow multi-tenant data separation. - Authentication with
AUTHis only applicable if the server was started with the--adminparameter. - Some commands (like
NSNEW) require admin privileges.
- Redis protocol compatibility (subset)
- Namespace support with configurable properties
- Data integrity checking
- Simple to run and integrate
Namespaces can be configured with various properties using the NSSET command. These properties control the behavior and security of the namespace.
| Property | Values | Description |
|---|---|---|
password |
string | Sets a password for the namespace. When set, users must provide the password when using the SELECT command to switch to that namespace. Without authentication, write operations are denied and read operations may be restricted based on the public property. |
worm |
0 or 1 | Write Once Read Many mode. When enabled (1), keys cannot be modified or deleted once written. |
lock |
0 or 1 | Temporarily locks the namespace. When enabled (1), write operations are not allowed. |
public |
0 or 1 | Controls read access. When disabled (0), users must authenticate to perform read operations like GET and MGET. Default is enabled (1). |
Example usage:
NSSET mynamespace password mysecretpassword # Set namespace password
NSSET mynamespace worm 1 # Enable WORM mode
NSSET mynamespace lock 1 # Lock namespace (read-only)
NSSET mynamespace public 0 # Require authentication for read operations
- The
NSLISTcommand currently collects all namespace names before sending the response. Future improvements will implement streaming responses to handle large numbers of namespaces more efficiently.
For project overview and build instructions, see the main README.