KiviDB 1.1.0: Open Source, and What Else Changed

Murtaza Shajapurwala ·

KiviDB 1.1.0 is out. The headline is the licence: KiviDB is now open source, under the GNU Affero General Public License, version 3. The source, the binaries and the release notes are on GitHub, and the images are on Docker Hub (kividb/kividb) and GHCR (ghcr.io/kividbio/kividb).

The licence is not the only change. 1.1.0 is the largest release since 1.0, and some of it changes how the server behaves, so read Before you upgrade before you move a production server.

Open source, under the AGPLv3

Until now KiviDB was distributed under an end user licence agreement. From 1.1.0 it is licensed under the AGPLv3 (AGPL-3.0-only), and the EULA no longer applies to this or any later release.

What that means in practice:

  • You can read, build, run and change it. Every line of the server is in the repository.
  • Using KiviDB as your application's database does not put your application under the AGPL. The AGPL's network clause applies to KiviDB itself: if you modify KiviDB and offer that modified server to others over a network, you offer them its source too.
  • A commercial licence is available for teams that need different terms.
  • The marketplace entitlement check is gone. Builds for cloud marketplaces used to make a check at startup; that check is removed, along with the marketplace machine images.

Why now: a database is infrastructure people build on for years. They should be able to see exactly what it does, run it anywhere, and not depend on us to keep it alive. Making it open is the honest way to earn that trust.

Security fixes

1.1.0 closes gaps that matter for anyone running KiviDB where untrusted clients or scripts can reach it:

  • Lua scripts stay in their sandbox. Scripts lose package, require, loadfile, dofile, debug and string.dump, and load accepts source text only, not bytecode.
  • A script is held to the caller's ACL. A command a script runs through redis.call is now checked against the same ACL rules as one the user sends directly. Before, a user allowed EVAL could run any command on any key from a script.
  • Protected mode is enforced, as in Redis. With no bind address and no password on the default user, only local clients may connect.
  • TLS client certificates are verified. tls-ca-cert-file used to be read and then ignored; now a client must present a certificate that CA signed, unless you set the new tls-auth-clients to no or optional.
  • Malformed input can no longer crash or stall the server: overflowing counts, oversized RESTORE payloads and similar inputs are refused.

A log you can act on

The server log was the weakest part of 1.0. In 1.1.0:

  • loglevel works, with Redis's levels (debug, verbose, notice, warning, nothing), and CONFIG SET loglevel changes it at runtime. logfile writes to a file. log-format json gives one JSON object per line.
  • Warnings and errors say what to do: a port already in use, a failed background save, a full disk under the AOF, running out of file descriptors.
  • Every [FATAL], [ERROR] and [WARN] line, and every error reply a client can get (OOM, BUSY, NOSCRIPT, CROSSSLOT, …), is explained in docs/ERRORS.md.

Faster, and smaller

From the 1.1.0 release notes:

  • Vector ingest is about six times faster. Each HNSW node now has its own lock. Ingesting 1.18 million vectors (glove-25-angular, 100 clients) took 197 s on 1.0.5 and takes 31 s on 1.1.0, on a 64-core server where Redis 8.10 takes 38 s.
  • Lua scripts run several times faster. A script is now compiled once and kept, and a quick script runs where it arrives. With 50 clients running a short script, throughput went from about 10,500 a second to 36,000–42,000. A BullMQ soak of 5,400 jobs went from 18.5 s to 4.5 s, about what it takes on Redis. Redis is still faster at raw script throughput, and we say so in the notes.
  • Memory per key is lower: 177 bytes a key for ten million 100-byte values, down from 217.

And the throughput benchmark published in the README, on AWS Graviton3 bare metal against Redis 8.10 and Dragonfly 2.0.2:

WorkloadKiviDB 1.1.0Dragonfly 2.0.2Redis 8.10
GET, pipeline 1621.2M ops/s9.1M2.4M
SET, pipeline 1619.2M ops/s8.5M2.0M
GET, no pipelining3.07M ops/s3.35M1.32M
SET, no pipelining3.12M ops/s3.38M1.54M

Pipelined, KiviDB serves more than twice what Dragonfly does and about eight times a single Redis. One request at a time, Dragonfly is slightly ahead. The benchmarks page has the method, latencies and memory figures, including where KiviDB is not first.

Cluster

  • Search across every master. FT.CREATE and the other index-definition commands reach every master, and FT.SEARCH, FT.AGGREGATE, FT.INFO and FT.TAGVALS sent to any node answer from the whole cluster. If a master cannot answer, the search fails rather than return part of the data.
  • min-replicas-to-write and min-replicas-max-lag, as in Redis.
  • cluster-bus-secret, which a node must prove before anything it sends on the cluster bus is read, and TLS between nodes with tls-cluster and tls-replication.
  • Hostnames with cluster-announce-hostname and cluster-preferred-endpoint-type.
  • A restarted master continues its replicas instead of resending the whole dataset.

Before you upgrade

Some changes alter behaviour. The ones most likely to affect you:

  • Protected mode is enforced. A server reached over the network with a passwordless default user needs a password, a bind address or protected-mode no. The Docker image turns protected mode off unless you pass arguments of your own.
  • Scripts are checked against the caller's ACL, and lose the unsafe Lua modules listed above. A script that used them fails.
  • Scripts on one hash tag may not touch keys outside it. lua-parallel-scripts no restores the old behaviour.
  • With tls-ca-cert-file set, clients must send a certificate, or set tls-auth-clients.
  • loglevel now works, and log lines start with a UTC timestamp and the process id. If you parse the log, check your patterns, or switch to log-format json.
  • The server makes one HTTPS request at startup to GitHub's releases page, to tell you when a newer release is out. Nothing is sent but the request itself. Turn it off with update-check no.
  • The arm64 builds need an ARMv8.1 CPU (Graviton2 or later, Ampere). A first-generation Graviton or a Raspberry Pi 4 can no longer run them.

The full list is in the release notes and the changelog.

Try it

With Docker:

docker run -p 6380:6380 kividb/kividb:v1.1.0

Binaries for Linux and macOS are on the releases page, and the downloads page lists every package. On Kubernetes, kividb-operator 0.5.0 runs 1.1.0 with replication and automatic failover.

On KiviDB Cloud

New databases on KiviDB Cloud run 1.1.0, on AWS, Azure and Google Cloud.

Existing databases are not upgraded automatically. A database on 1.0.x keeps running the version it has, and stays supported. Because some 1.1.0 changes alter behaviour, you choose when to move: change the version from the database's Configuration panel once you have checked the notes above against your scripts and clients.

If you build on KiviDB, star the repository, open issues, and tell us what you need next.