Redis
Redis is an in-memory data structure store used as a database, cache, and message broker. Hyperterse provides support for Redis, enabling you to execute Redis commands for key-value operations, caching, session storage, rate limiting, and working with Redis data structures like hashes, lists, sets, and sorted sets.
Connecting to your server
Section titled “Connecting to your server”Redis adapters use the standard Redis URI format:
adapters: my_redis: connector: redis connection_string: 'redis://localhost:6379/0'Adapter options
Section titled “Adapter options”Configure connection pooling and other settings:
adapters: cache: connector: redis connection_string: 'redis://localhost:6379/0' options: pool_size: 10For connection string format and authentication options, see the Redis connection documentation.
Setting up a database
Section titled “Setting up a database”It is very easy to set up a database for Hyperterse. You can use your existing database or create a new one and wire it up to Hyperterse.
-
Start Redis
Start Redis using your preferred method:
Terminal window # Dockerdocker run -d -p 6379:6379 redis:latest# macOS with Homebrewbrew services start redis# Linux (systemd)sudo systemctl start redis# Or run directlyredis-server -
Configure Hyperterse
Add the Redis adapter to your configuration:
adapters:cache:connector: redisconnection_string: 'redis://localhost:6379/0'options:pool_size: 10For password-protected Redis instances:
connection_string: 'redis://:password@localhost:6379/0'For TLS-enabled Redis (cloud providers):
connection_string: 'rediss://:password@host:6379/0' -
Verify connection
Test the connection using the development server:
Terminal window hyperterse dev -f config.terseLook for a successful connection message:
INFO Connected to adapter: cache
Redis queries in Hyperterse execute Redis commands directly. The statement field contains the Redis command to execute:
queries: get-value: use: cache description: 'Get a cached value' statement: 'GET {{ inputs.key }}' inputs: key: type: string description: 'Cache key'Hyperterse supports all standard Redis commands including strings, hashes, lists, sets, sorted sets, and key management operations. Use parameterized inputs for dynamic values in commands. Redis commands return results in JSON format, with multiple values returned as arrays or key-value pairs depending on the command type.
Performance
Section titled “Performance”Hyperterse inherently does not limit any performance optimizations. You can optimize your queries and database to whatever degree Redis allows.
Troubleshooting
Section titled “Troubleshooting”Connection refused
Section titled “Connection refused”Verify Redis is running and accessible:
redis-cli pingShould return PONG. Check firewall rules and network connectivity for remote Redis instances.
Authentication failed
Section titled “Authentication failed”Verify the password in the connection string:
connection_string: 'redis://:correct_password@localhost:6379/0'Ensure the Redis server has authentication enabled and the password matches.
TLS required
Section titled “TLS required”For cloud Redis providers that require TLS, use rediss:// protocol:
connection_string: 'rediss://:password@host:6379/0'Note the double s in rediss:// for secure connections.
Memory issues
Section titled “Memory issues”Monitor Redis memory usage and set appropriate expiration times for keys. Use INFO memory command to check memory statistics and configure maxmemory policy if needed.