redis-cli
.
Because it is already covered in Getting Started, we
will skip it here.
Database
After completing the getting started guide, you will see the database page as below:
Clipboard
button on Connect to your database section, you can copy
the code that is required for your client.
Below, we will provide examples from popular Redis clients, but the information above should help you configure all Redis clients similarly.
TLS is enabled by default for all Upstash Redis databases. It’s not possible
to disable it.
upstash-redis
Because upstash-redis is HTTP based, we recommend it for Serverless functions.
Other TCP based clients can cause connection problems in highly concurrent use
cases.
Node.js
Library: ioredis Example:Python
Library: redis-py Example:Java
Library: jedis Example:Jedis does not offer command level retry config by default, but you can handle
retries using connection pool. Check Retrying a command after a connection
failure
PHP
Library: phpredis Example:Phpredis supports connection level retries through
OPT_MAX_RETRIES
. However,
for command level retries, it only supports SCAN
command.