Skip to main content

Valkey

Redis-compatible in-memory key-value store with high availability, persistence, and TLS.

Versions

VersionStatus
8Available (recommended)

Connecting

PortProtocolUse
6380TLSProduction — always use this
6379PlainAllowed if within your allowed_cidrs
# TLS
redis-cli -h HOST -p 6380 --tls --user USER --pass PASS

# Test
redis-cli -h HOST -p 6380 --tls --user USER --pass PASS PING

Full connection string examples: Connection Strings →

High Availability (Sentinel)

For HA, add a replica. Sentinel monitors both nodes and promotes the replica automatically if the primary fails:

curl -u admin:password -X POST \
https://api.foundrydb.com/managed-services/{id}/nodes \
-H "Content-Type: application/json" \
-d '{"role": "replica"}'

Failover time is typically 5–15 seconds. Your client should be configured with retry logic and connection timeouts.

Manual failover:

curl -u admin:password -X POST \
https://api.foundrydb.com/managed-services/{id}/nodes/{node_id}/failover

Persistence

Both RDB and AOF are enabled by default:

ModeBehaviour
RDBPoint-in-time snapshots. Fast restarts, small files. Risk of up to ~minutes of data loss.
AOFLog of every write. Near-zero data loss, larger files, slower restarts.

Tune persistence:

curl -u admin:password -X PATCH \
https://api.foundrydb.com/managed-services/{id}/configuration \
-H "Content-Type: application/json" \
-d '{
"parameters": {
"appendonly": "yes",
"appendfsync": "everysec",
"save": "3600 1 300 100 60 10000"
}
}'

appendfsync values:

  • always — safest, slowest
  • everysec — recommended balance
  • no — fastest, OS-controlled flush

Eviction Policies

Set how keys are evicted when memory is full:

"parameters": {
"maxmemory-policy": "allkeys-lru"
}
PolicyDescription
noevictionReturn errors when full (default)
allkeys-lruEvict least recently used keys
volatile-lruEvict LRU keys with TTL set
allkeys-randomEvict random keys
volatile-ttlEvict keys with shortest TTL

Configuration

curl -u admin:password -X PATCH \
https://api.foundrydb.com/managed-services/{id}/configuration \
-H "Content-Type: application/json" \
-d '{
"parameters": {
"maxmemory-policy": "allkeys-lru",
"hz": "15",
"tcp-keepalive": "300",
"timeout": "0"
}
}'

Common parameters:

ParameterDefaultDescription
maxmemory-policynoevictionKey eviction policy
hz10Background task frequency
tcp-keepalive300Keepalive probe interval (seconds)
timeout0Idle connection timeout (0 = disabled)
lazyfree-lazy-evictionnoNon-blocking key eviction

Backups

# List backups
curl -u admin:password https://api.foundrydb.com/managed-services/{id}/backups

# Manual backup
curl -u admin:password -X POST \
https://api.foundrydb.com/managed-services/{id}/backups \
-H "Content-Type: application/json" \
-d '{"backup_type": "manual"}'

Metrics

Key metrics: used_memory, connected_clients, keyspace_hits, keyspace_misses, expired_keys, evicted_keys.

curl -u admin:password \
"https://api.foundrydb.com/managed-services/{id}/metrics?metric=memory&period=1h"