Change your application: migrate from Google Memorystore to KiviDB

The changes are the address, the port, the credentials and the CA. Memorystore clients often connect by IP address; KiviDB Cloud's certificate is issued for…

The changes are the address, the port, the credentials and the CA. Memorystore clients often connect by IP address; KiviDB Cloud's certificate is issued for the hostname, so connect by name.

Python (redis-py)

# Before: Memorystore for Redis, AUTH and in-transit encryption
r = redis.Redis(host="10.0.0.3", port=6378, password=os.environ["REDIS_AUTH"],
                ssl=True, ssl_ca_certs="memorystore-ca.pem")

# Before: Memorystore for Valkey, cluster mode enabled, IAM authentication
r = RedisCluster(host="10.0.0.5", port=6379, password=fetch_access_token())

# After: KiviDB Cloud
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")

Go (go-redis)

// Before: Memorystore for Redis Cluster
rdb := redis.NewClusterClient(&redis.ClusterOptions{
    Addrs:    []string{"10.0.0.5:6379"},
    Password: token,
})

// After: KiviDB Cloud
caPEM, _ := os.ReadFile("kividb-ca.pem")
pool := x509.NewCertPool()
pool.AppendCertsFromPEM(caPEM)
rdb := redis.NewClient(&redis.Options{
    Addr:      "my-db.cloud.kividb.io:6380",
    Username:  "kividbapp",
    Password:  os.Getenv("KIVIDB_PASSWORD"),
    TLSConfig: &tls.Config{RootCAs: pool, ServerName: "my-db.cloud.kividb.io"},
})

Node.js (ioredis)

// Before: Memorystore for Redis with AUTH, no TLS
const redis = new Redis({ host: "10.0.0.3", port: 6379, password: process.env.REDIS_AUTH });

// After: KiviDB Cloud
const redis = new Redis({
  host: "my-db.cloud.kividb.io",
  port: 6380,
  username: "kividbapp",
  password: process.env.KIVIDB_PASSWORD,
  tls: { ca: fs.readFileSync("kividb-ca.pem") },
});

Notes:

  • Port. KiviDB Cloud uses 6380 for TLS and 6379 for plain connections. A self-hosted KiviDB listens on 6380 unless you pass --port.
  • IAM authentication. Remove the code that fetches access tokens and use the password.
  • Cluster clients. If the KiviDB target is not sharded, switch from the cluster client to the plain one. Into a sharded KiviDB Cloud database, keep it and point it at my-db-s1.cloud.kividb.io:6380.