Redis
Use any Redis client library. Strings, hashes, lists, sets, sorted sets, streams, search, vectors, geo, pub/sub, transactions, Lua scripting. 600+ commands supported.
1. Create a database
From the dashboard, or with the SDK:
from cinchdb import Cinch
client = Cinch(api_key="ck_live_...", org="acme")
scope = client.scope("my-app", environment="production", project="api")
db = scope.create_database(type="redis", name="cache")
print(db.url()) # rediss://cinch:...@tcp.cinchdb.dev:63792. Connect over TCP
Standard Redis connection. Best for persistent connections and lowest latency (~1.4ms).
import redis
r = redis.Redis(
host="tcp.cinchdb.dev",
port=6379,
password="YOUR_DATABASE_TOKEN",
ssl=True,
decode_responses=True,
)
r.set("hello", "world")
print(r.get("hello")) # "world"| Host | tcp.cinchdb.dev |
| Port | 6379 |
| TLS | Required |
| Auth | AUTH <your database token> |
3. Connect over HTTP
For serverless, edge, and environments that cannot hold TCP connections. Same database, same token. Upstash-compatible format.
import requests
URL = "https://http.cinchdb.dev/"
HEADERS = {
"Authorization": "Bearer YOUR_DATABASE_TOKEN",
"Content-Type": "application/json",
}
# Single command
resp = requests.post(URL, json=["SET", "hello", "world"], headers=HEADERS)
print(resp.json()) # "OK"
resp = requests.post(URL, json=["GET", "hello"], headers=HEADERS)
print(resp.json()) # "world"
# Pipeline: multiple commands in one request
resp = requests.post(URL + "pipeline", json=[
["SET", "a", "1"],
["SET", "b", "2"],
["MGET", "a", "b"],
], headers=HEADERS)
print(resp.json()) # ["OK", "OK", ["1", "2"]]| URL | https://http.cinchdb.dev/ |
| Pipeline | https://http.cinchdb.dev/pipeline |
| Auth | Authorization: Bearer <token> |
| Limits | 100 commands/pipeline, 10s timeout, 10MB response |
i
Good to know
- Your database auto-stops after 5 minutes idle. Next request wakes it in ~10ms.
- After 24 hours idle, it archives to cold storage. Wake takes ~25ms.
- No eviction. Data persists to disk, so there is no memory limit to hit.
- Pub/Sub works but keeps the database awake. Use Streams for durable messaging.
- Same token works for both TCP and HTTP.
See Redis Commands for the full supported command list and differences from standard Redis.