If Apache Iggy is useful to you, give it a star on GitHubStar apache/iggy
Skip to Content
Apache Iggy
Server
These docs describe the upcoming release. They follow the master branches of apache/iggy and apache/iggy-connectors. For the last release, read the 0.10 release docs, or select a version at the top of the sidebar.

Topic Options

Per-topic retention, durability, storage and read cache options, which ones an update can change, and their defaults.

Retention, durability, and segment layout are per-topic decisions, made when the topic is created. They used to be server-wide [system.*] keys, which gave every knob two homes. The server now refuses to boot on the old keys, and each topic carries its own values instead.

Options are key-value pairs sent with CreateTopic, and some of them can change later with an update. Unknown keys are rejected at the edge, never skipped: a silently ignored knob would leave the client on server defaults with no way to find out. Streams and users have their own catalogs. See Stream options for stream keys and names. User updates accept username and status.

The catalog

OptionDefaultConstraintsDescription
max_topic_sizeunlimitedfinite values at least segment_sizeTopic-wide limit on sealed segment bytes, divided across partitions. The cleaner deletes eligible oldest sealed segments when a partition exceeds its share.
message_expirynoneDelete the oldest sealed segments whose newest message timestamp is older than this duration.
partition_resize_policymutablemutable or fixed, create onlyfixed rejects partition additions and deletions. mutable permits layout changes without a bounded cutover or per-key ordering across layouts.
replication_factorServer default, initially all1 through 32 and no greater than cluster membership, create onlyNumber of nodes that store each partition.
compression_algorithmnonenone or gzipPlaceholder: stored and reported, no compression applied yet.
segment_size1 GiB0 selects the default. Otherwise a 512-byte multiple from 1 MiB through 1 GiBSoft size limit per segment: a segment may close one whole batch past it.
durabilityreplicatedreplicated or persistedMessage completion policy. persisted requires recoverable stable-storage copies at the replication quorum before success.
consumer_offset_durabilityreplicatedreplicated or persistedCompletion policy for explicit consumer-offset stores and deletes, independent of message durability.
messages_required_to_save1024non-zero, at most 16777216Flush the journal once it holds this many messages.
size_of_messages_required_to_save1 MiB0 selects the default. At most 1 GiBFlush the journal once it holds this many bytes. Paired with the message count. Whichever threshold trips first flushes.
preallocate_segmentsfalsesegment_size x partitions at most 64 GiB per createReserve each segment's bytes up front where the filesystem supports it.
segment_max_ageneverat least 10 minutes, or never. Refused with preallocate_segmentsStart a new segment once a batch is stamped this long after the first batch of the active segment, so retention and tiering reach a slow partition. A fully idle partition keeps its segment open.
tiered_storagefalseneeds an object store on every node of the clusterMove sealed segments to the object store and keep only the local retention on disk.
local_retention_age1 day, or a shorter message_expiryat most a finite message_expiryHow long a tiered topic keeps an uploaded segment on local disk. No effect without tiered_storage.
local_retention_sizeunlimited, or a finite max_topic_sizeat most a finite max_topic_sizeTopic-wide cap on the uploaded segments a tiered topic keeps on local disk, divided across partitions. No effect without tiered_storage.
topic_typenormalnormal or geoA geo topic's messages also become readable in other datacenters through the object store. It needs an object store on every node, and refuses tiered_storage and an encrypted stream.
geo_modegeo on a geo topiconly on a geo topic. geo_tiered is refused for nowHow a geo topic writes its messages.
fresh_upload_intervalthe node's [tiered_storage] settingonly on a geo topic. 0 to 10 sThe longest time a send waits for the upload of its fresh object to start.
consumer_offset_upload_intervalthe node's [geo] settingonly on a geo topic. 0 to 1 sThe shortest time between two uploads of the positions that the offsets a group stores itself wait for.
positions_publish_intervalthe node's [geo] settingonly on a geo topic. Longer than 0How often a node uploads the changed positions of the topic's consumer groups.
tombstone_gracethe node's [geo] settingonly on a geo topic. Longer than 0How long the tombstone and the objects of the deleted topic stay in the object store.
positions_resume_timeoutthe node's [geo] settingonly on a geo topicHow long, after a node starts, the group polls of the topic wait for the positions of the geo peers.
long_term_rewrite_max_intervalthe node's [geo] settingonly on a geo topic. At least 1 sThe longest wait between two rewrites of a partition's committed messages into long-term segments.
read_cache_sizethe node's [tiered_storage] setting0, or at least 512 KiBMemory that each node keeps for what the topic's reads fetch from the object store, divided across partitions. See Read cache.
read_aheadthe node's [tiered_storage] setting0, or at least 128 KiB. At most an eighth of a positive read_cache_size the topic setsThe most bytes that readahead fetches from the object store in front of a sequential reader of the topic. See Read cache.

Both retention policies can be active at once. The active segment is never touched, and its bytes are excluded from the size limit. A segment whose end offset exceeds the lowest stored consumer or consumer-group offset is retained. With no stored offsets, this barrier is absent. Deletion is done by the server's segment cleaner ([data_maintenance.messages], enabled by default).

Both durability policies write data to disk and default independently to replicated. Neither inherits the other. A geo topic in the geo mode is always persisted for both: the server ignores what its create sends for them. A geo topic that an earlier build of the server stored with replicated takes persisted when a node loads its metadata, from a snapshot or from its log, and GetTopic reports what its partitions run with. What it acknowledged before that load has the guarantee of replicated only. Flush thresholds schedule ordinary segment writes. Required persistence, capacity pressure, or lifecycle operations can flush earlier. They do not weaken the persisted completion guarantee.

Value forms are forgiving: byte sizes accept a raw number of bytes or a string like "128 MiB", expiry accepts microseconds or a humantime string like "7 days", booleans accept true/false. Create admission re-parses and re-encodes what you send, so a string segment_size=128MiB is stored as the number it names.

preallocate_segments requests a segment_size reservation for each partition's segment file when it is opened, including during topic creation and rotation. On Linux this reserves disk space without changing the file's logical length. Unsupported or failed reservations log a warning and fall back to ordinary allocation. With the default 1 GiB segment size, the request is 1 GiB per partition up front, which is why it's opt-in and why one create is capped at 64 GiB of requested reservation.

Setting options

At creation, every interface takes the same keys:

# CLI: --set is repeatable. Positional arguments: stream, name,
# partitions count, compression algorithm.
iggy topic create my-stream my-topic 1 none \
  --set segment_size=128MiB \
  --durability persisted \
  --consumer-offset-durability persisted

In the CLI, both durability policies have named flags. --set is repeatable and covers other storage options, such as segment_size. compression_algorithm, message_expiry, and max_topic_size also have first-class parameters. Run iggy options topic to discover what the server accepts.

SDKs expose typed durability values in their topic creation options. In Rust, set TopicCreateOptions::durability and TopicCreateOptions::consumer_offset_durability to Durability::Replicated or Durability::Persisted. The HTTP API takes "durability" and "consumer_offset_durability" as string values in the create body's options map.

Keys absent from the wire request are resolved by the admitting server and stored as derived entries. Typed SDKs can send their default durability values explicitly. Binary GetTopic responses carry explicit and derived blocks. HTTP reports an explicit flag per option. Both report option values and the provenance of the request. Updates preserve the values and provenance of keys outside the patch.

Read cache

A poll of data that a topic keeps in the object store, such as the tiered segments of a topic with tiered_storage or the long-term segments of a geo topic, reads it through the read cache of the partition's shard. Each shard has one, sized by the node's [tiered_storage] read_cache_size, and it reads ahead of a sequential reader by up to [tiered_storage] read_ahead. A topic can override both for itself, with options of the same names:

  • read_cache_size is divided evenly across the topic's partitions. Each share is a limit on what that partition keeps, drawn from the shard's shared budget, not a reservation: what a quiet partition leaves unused is there for the others, and a partition over its limit evicts its own blocks. A share below 8 blocks of the node's read_cache_block_size keeps nothing.
  • read_ahead replaces the node's readahead for the topic's readers. A partition reads ahead at most an eighth of its share of read_cache_size and an eighth of its shard's read cache.
  • 0 turns either off for the topic: with read_cache_size at 0, its reads go to the store each time and nothing they fetch is kept.
  • Unset, each node applies its own [tiered_storage] setting of the same name, and only the shard's budget bounds the topic's partitions.

Both keys work the same on normal and geo topics. A topic without tiered_storage accepts them, and they apply once its data is read from the store. An update can change either one, and the next poll reads with the new value, with no restart. Neither can be reset, because the default is each node's own setting and 0 is a value. So no update returns a topic to the node's settings: an update that sets the node's current value fixes it for the topic, with read_cache_size divided across its partitions, and the topic does not follow later changes to the node's settings. The fresh objects that a shard uploads for geo topics are held for the polls at the tail whatever a topic sets.

iggy topic create my-stream archive 4 none --set tiered_storage=true --set read_cache_size=64MiB
iggy topic update my-stream archive --set read_ahead=0

A shadow topic inherits both keys from the geo topic that it shadows in another datacenter, and converges to the values that the geo topic publishes last, typically within about 35 seconds of a change. When the geo topic changes them again before the shadowing datacenter reads the first change, the shadow topic takes only the latest values. The shadowing datacenter proposes a limited number of shadow operations per pass, read cache changes last, so a change can wait for later passes while earlier operations, such as the adoptions of many new topics, are queued. A key that the geo topic does not set is unset on the shadow topic too, and each node that reads it applies its own setting. A client cannot set them on a shadow topic: an update of a shadow topic is refused with ShadowStreamReadOnly.

Create-only vs updatable

Updates use UpdateResource with a set/reset patch. SDKs retain resource-specific update methods, but these methods send the shared command. These keys can change on a topic:

OptionUpdateReset
nameyesno
message_expiry, max_topic_sizeyesyes
local_retention_age, local_retention_sizeyesyes
tiered_storageturn on only, never offno
read_cache_size, read_aheadyesno
fresh_upload_interval, consumer_offset_upload_interval, positions_publish_interval, tombstone_grace, positions_resume_timeout, long_term_rewrite_max_intervalyes, only on a geo topicno

A geo topic keeps its name and every other option: an update of a geo topic may carry only its durations and read_cache_size and read_ahead.

An absent key keeps its value. In HTTP, null also leaves a value unchanged. A name in reset returns that option to the server default and marks it as derived. Do not send the same key in both sets. Unknown keys, read-only keys and create-only changes are rejected. An empty patch, including a patch with only null values or zero sentinels, is rejected.

iggy topic update my-stream my-topic --message-expiry 7days
iggy topic update my-stream my-topic --reset message_expiry --reset max_topic_size
iggy topic update my-stream my-topic --name archived-events

HTTP updates use a flat JSON object, not a nested options object:

{
  "message_expiry": "7 days",
  "reset": ["max_topic_size"]
}

compression_algorithm, segment_size, both durability policies, flush thresholds, preallocate_segments, partition_resize_policy, replication_factor, segment_max_age, topic_type and geo_mode are create-only. Select them before creating the topic. A finite size limit must still be at least the segment size.

Replication factor

When replication_factor is absent, the server resolves cluster.default_replication_factor and stores the result with the topic. The default all uses every cluster node. A later server configuration change does not change existing topics.

A factor of one stores one copy. Replicated durability can acknowledge it before stable storage. A factor of two requires both replicas to make progress. Three copies tolerate one unavailable replica. See Cluster durability for larger quorum rules.

iggy topic create my-stream replicated-events 6 none --set replication_factor=3

The example needs a cluster with at least three nodes. The metadata group still spans the full cluster, independent of each topic's factor.

Discovering the catalog

Ask the server which keys it accepts, with their types, defaults, and descriptions:

iggy options topic

For HTTP, set IGGY_TOKEN to a valid JWT or personal access token:

curl --fail-with-body \
  -H "Authorization: Bearer $IGGY_TOKEN" \
  http://localhost:3000/options/topic

The Rust SDK exposes the same call as describe_options. The scope is topic, stream, or user.

Discovery matters most on the binary transports: TCP, QUIC, and WebSocket carry only an error code for a rejected key, not its name, so the catalog is how a client finds out what this server supports. Over HTTP the error message names the offending key directly.

Durability

replicated waits for quorum commit and application without an additional stable-storage barrier. persisted also requires recoverable stable-storage copies at the required quorum. On a single node that means recoverable local persistence before success. In a cluster it uses durable prepare history. Setting messages_required_to_save=1 is not required for persisted.

The former enforce_fsync option is rejected. Use durability for messages and consumer_offset_durability for explicit offset changes. Poll auto-commit remains asynchronous, and HTTP ack=none confirms dispatch only, regardless of these policies.

See Durability for single-node failure behavior and Cluster Durability for the quorum and WAL guarantees.

On this page