Upgrading
Docs for other versions and what changed
The version picker in the top bar switches between the latest docs and the docs of every release, keeping you on the same page when it exists there. All versions lists each release with its tag, its docs, the release notes when there are any, and a GitHub compare link to the release before it, such as https://github.com/NimzyMaina/RillKit/compare/v0.1.0...v0.1.1. The compare view is the complete list of changes between two releases.
From 0.3 to 0.4
Without the control plane, nothing changes in behaviour. It is off unless you turn it on, and off means no extra keys, connections, threads or log handlers.
New:
- An optional control plane:
Control(mode="relay")orRILLKIT_CONTROL=relay, withrillkit-serverand its dashboard. It needspip install "rillkit[control]". - A config file (
RILLKIT_CONFIG), andRILLKIT_TENANTandRILLKIT_KEY_PREFIX, which imply hash-tagged keys. subscribe(..., concurrency=n): several consumer loops per stream.Broker.replay_dlq_entries,delete_dlq_entries,purge_dlqandcreate_group.TraceContext(W3Ctraceparentacross streams) andLogCapture(per-message logs), as middleware you can use without the control plane too.- Attempt timings in telemetry (
attempts_total,wait_ms_total,work_ms_total), shown as the dashboard's Time per message chart: queue wait against handler time, for finding the bottleneck of a stream. Control(trace_records=True)/RILLKIT_TRACE_RECORDS,broker.control.trace(trace_id)and View trace on the dashboard: every handler attempt of one trace, across streams, kept for an hour. Metadata only, never payloads or exception text.Settings(max_connections=...)/RILLKIT_MAX_CONNECTIONS: the client connection-pool cap. redis-py 8 defaults it to 100, which a producer with many threads (or a consumer with more than 100 lanes) can exhaust; raise it to peak concurrent commands plus headroom.- Heartbeats are now coalesced: a consumer writes its heartbeat at the top of the loop and after messages, but at most once every
min(5 s, max(0.5 s, heartbeat_ttl/3))instead of after every message. Liveness andactive_workersare unchanged; it removes three Redis commands per message. A handler that runs longer thanheartbeat_ttlstill looks gone, as before. Broker.publish_many(stream, bodies): several entries in one pipeline, with middleware (andTraceContext) applied per entry. Use it for high publish rates;publishis unchanged.rillkit-serverservesGET /api/metricsfor Prometheus (per tenant fleet gauges), and caches each tenant's overview for a second, with a single build at a time, so large fleets do not multiply overview work.- The autoscaler now sizes from the observed arrival rate as well as lag. A stream that is keeping up at zero lag stays at its current worker count instead of dropping to
min_workersand oscillating; it scales down when the rate actually falls.last_decisionnow includes the rate. A new autoscaler leader seeds the rate and per-worker capacity from the latest samples, so a failover does not restart the estimate from zero. rillkit-serveris published asghcr.io/nimzymaina/rillkit-server, with a no-clone Compose file and installer underdeploy/. Running it needs Postgres and nothing else; see Running the server.
License. From 0.4 the SDK is licensed under the Apache License 2.0; releases up to and including 0.3.0 stay MIT. Apache 2.0 is permissive like MIT, and adds an explicit patent grant: nothing changes in how you may use it. rillkit-server and the dashboard are a separate project in the same repository, under FSL-1.1-ALv2 (see the server's license).
For ACL users (several tenants on one server): a managed worker also needs +expire, now part of the documented rule.
From 0.2 to 0.3
Single-server users with the default keys: nothing changes. Stream, DLQ, heartbeat and Idempotent keys are identical.
New:
RILLKIT_HOST,RILLKIT_PORT,RILLKIT_DB,RILLKIT_USERNAME,RILLKIT_PASSWORD,RILLKIT_SSLandRILLKIT_SOCKET_TIMEOUT, each winning over itsREDIS_name. A URL still replaces the separate fields; setting one of them next to a URL now logs a warning. See environment variables.KeyBuilder.idempotency(stream, key):Idempotentmarkers follow the broker's key builder, so brokers with different prefixes or tenants no longer share them. SeeIdempotentmarkers.- A consumer registry per stream and group (
KeyBuilder.consumers).active_workersreads it instead of scanning for heartbeat keys, so it works for ACL users that may not runSCAN. See several tenants on one server for an ACL rule that hides other tenants' key names.
For everyone: active_workers only lists workers running 0.3 or newer, since older workers write no registry entry. Upgrade all workers of a group together, or expect older ones to be missing from active_workers until they are upgraded. Heartbeat keys themselves are unchanged.
Changes for HashTagKeys users (clusters, or RILLKIT_KEY_LAYOUT=hashtag):
Idempotentmarkers move fromrillkit:done:<stream>:<key>tork:{<stream>}:done:<key>(with your prefix and tenant). Markers written by 0.2 are not checked, so a message redelivered right after the upgrade can be processed once more. PassIdempotent(prefix="rillkit:done:")to keep the 0.2 location.- Colons in stream names are now percent-encoded inside the tag: stream
orders:eumoves fromrk:{orders:eu}:streamtork:{orders%3Aeu}:stream, and the same for its DLQ and heartbeats. Streams without a colon keep their keys. In 0.2, streamt-42:ordersand streamorderswith tenantt-42shared keys; they no longer can. Drain or move affected streams before upgrading (pending entries and DLQ entries stay under the old keys). - An empty stream name raises
ConfigurationErrorinstead of producing keys that do not share a slot. - Custom
KeyBuildersubclasses keeprillkit:done:<stream>:<key>for markers unless they overrideidempotency.
From 0.1 to 0.2: Redis and Valkey support
Nothing changes for an existing Redis deployment. Upgrade and keep your configuration:
- Redis (redis-py) is still the default and the only required dependency.
REDIS_URLand the otherREDIS_*variables work as before, includingBroker.from_env(prefix=...).- Standalone key names are unchanged (
orders,orders-dlq,rillkit:workers:...), so pending messages, DLQs and heartbeats carry over. Broker(client=...),Broker(url)andBroker(settings=...)behave the same, andstop()still closes the client.
New, all optional:
pip install "rillkit[valkey]"andSettings(backend="valkey")(orRILLKIT_BACKEND=valkey) to use valkey-py.Settings(mode="cluster", cluster_nodes=[...])(orRILLKIT_MODE=cluster) for Redis Cluster and Valkey Cluster. See Redis and Valkey Cluster.- Key builders that map logical stream names to physical keys, with prefixes and tenants. See Keys.
RILLKIT_*environment variables:RILLKIT_URL,RILLKIT_HOST,RILLKIT_PORT,RILLKIT_DB,RILLKIT_USERNAME,RILLKIT_PASSWORD,RILLKIT_SSL,RILLKIT_SOCKET_TIMEOUT, plusRILLKIT_BACKEND,RILLKIT_MODE,RILLKIT_CLUSTER_NODESandRILLKIT_KEY_LAYOUT. EachRILLKIT_connection variable wins over itsREDIS_name; moving to them is optional.REDIS_USERNAMEis new for ACL users.Settings(username=..., client_kwargs={...})to pass any client option.Broker(keys=...),broker.keys,msg.key, andPlainKeys,HashTagKeys,KeyBuilder.ConfigurationErrorfor bad settings.
Small differences to check:
client_kwargsoptions are validated: an option the client does not accept, or one that has its ownSettingsfield, raisesConfigurationErrorwhen the client is built.Settings(url=..., password=...)used to ignorepassword. Nowusernameandpasswordfill in when the URL has no credentials of its own (credentials in the URL still win).Settings.from_env()is unaffected: it does not readREDIS_PASSWORDwhen a URL is set.repr(Settings(...))lists the new fields and hides passwords.- A
redis.RedisClusterpassed asBroker(client=...)now uses hash-tagged keys (rk:{orders}:stream). RillKit 0.1 did not support clusters; if you ran one anyway with the plain names, keep them withBroker(client=..., keys=PlainKeys()).