Change your application: migrate from Redis Cloud to KiviDB

The changes are the endpoint, the port, the credentials and the CA certificate.

The changes are the endpoint, the port, the credentials and the CA certificate.

Python (redis-py)

# Before: Redis Cloud, TLS, default user
r = redis.Redis(host="redis-12345.c12345.us-east-1-mz.ec2.cloud.rlrcp.com", port=12345,
                username="default", password=os.environ["REDIS_PASSWORD"],
                ssl=True, ssl_ca_certs="redis_ca.pem")

# After: KiviDB Cloud, TLS
r = redis.Redis(host="my-db.cloud.kividb.io", port=6380,
                username="kividbapp", password=os.environ["KIVIDB_PASSWORD"],
                ssl=True, ssl_ca_certs="kividb-ca.pem")

Node.js (node-redis)

// Before
const client = createClient({
  url: "rediss://default:PASSWORD@redis-12345.c12345.us-east-1-mz.ec2.cloud.rlrcp.com:12345",
  socket: { tls: true, ca: fs.readFileSync("redis_ca.pem") },
});

// After
const client = createClient({
  url: `rediss://kividbapp:${process.env.KIVIDB_PASSWORD}@my-db.cloud.kividb.io:6380`,
  socket: { tls: true, ca: fs.readFileSync("kividb-ca.pem") },
});
await client.connect();

Java (Jedis)

// Before
JedisPooled jedis = new JedisPooled(new HostAndPort("redis-12345.c12345.us-east-1-mz.ec2.cloud.rlrcp.com", 12345),
    DefaultJedisClientConfig.builder().user("default").password(redisPassword)
        .ssl(true).sslSocketFactory(redisCaFactory).build());

// After
JedisPooled jedis = new JedisPooled(new HostAndPort("my-db.cloud.kividb.io", 6380),
    DefaultJedisClientConfig.builder().user("kividbapp").password(kividbPassword)
        .ssl(true).sslSocketFactory(kividbCaFactory).build());

redisCaFactory and kividbCaFactory are SSLSocketFactorys built from a truststore that holds each provider's CA file.

Notes:

  • Port. KiviDB Cloud uses 6380 for TLS and 6379 for plain connections. A self-hosted KiviDB listens on 6380 unless you pass --port.
  • Username. On KiviDB Cloud, send the username kividbapp with the password; the default user can only authenticate.
  • Mutual TLS. If you used client certificates on Redis Cloud, KiviDB Cloud can require them too; issue new ones from KiviDB.
  • OSS Cluster API clients. If the application used a cluster client against Redis Cloud and the KiviDB target is not sharded, switch to the plain client.
  • Module commands. FT.*, JSON.* and TS.* work in KiviDB; BF.*, CF.*, CMS.*, TOPK.* and TDIGEST.* answer ERR unknown command.