Streams

Append-only logs of entries with IDs, read by range or by blocking, and shared out by consumer groups with acknowledgements and claims.

30 commands in KiviDB 1.1.2. Every command.

  • XACK: Acknowledges entries the group delivered: they are no longer pending.
  • XACKDEL: Acknowledges entries for the group and deletes them from the stream, in one step (Redis 8.2).
  • XADD: Appends an entry, a set of field-value pairs, to the stream at key.
  • XAUTOCLAIM: Goes through the group's pending entries from start and gives consumer those idle at least min-idle-time milliseconds, COUNT count at a time (100 by default).
  • XCFGSET: Sets the configuration of the stream at key.
  • XCLAIM: Gives pending entries to consumer, if they have been idle at least min-idle-time milliseconds: for when the consumer that had them stopped.
  • XDEL: Deletes entries from the stream at key by ID.
  • XDELEX: Deletes entries from the stream at key, with control over the references consumer groups hold to them (Redis 8.2).
  • XGROUP: Creates and manages consumer groups: named readers of a stream that share its entries among their consumers, and track what each consumer has been given and not yet acknowledged.
    • XGROUP CREATE: Creates the consumer group group on the stream at key, which will deliver entries after id: 0 for every entry, $ for only those added from now on.
    • XGROUP CREATECONSUMER: Creates the consumer consumer in the group.
    • XGROUP DELCONSUMER: Deletes the consumer consumer from the group, with its pending entries: they are no longer pending for anyone.
    • XGROUP DESTROY: Deletes the group, its consumers and its pending entries.
    • XGROUP HELP: Lists the XGROUP subcommands and what each does.
    • XGROUP SETID: Sets the ID the group delivers after: 0 to deliver every entry again, $ to skip to the end.
  • XIDMPRECORD: Records that producer producer-id's idempotent ID idempotent-id produced the entry id, already in the stream at key, as an XADD ... IDMP would have (Redis 8.10).
  • XINFO: Reports on a stream, its consumer groups and their consumers.
    • XINFO CONSUMERS: Returns, for each consumer of the group: its name, how many entries it has pending, the milliseconds since it last read (idle), and the milliseconds since its last read that returned entries (inactiv…
    • XINFO GROUPS: Returns, for each consumer group of the stream: its name, its consumers' count, its pending entries' count, the last ID it delivered, how many entries it has read, and its lag, how many entries it ha…
    • XINFO HELP: Lists the XINFO subcommands and what each does.
    • XINFO STREAM: Returns the stream's length, its first and last entries and IDs, how many entries it has ever had and the greatest it has deleted, its consumer groups' count, and its idempotent-ID settings and count…
  • XLEN: Returns the number of entries in the stream at key.
  • XNACK: Releases pending entries back to the group without acknowledging them, so that another consumer can take them at once, with XREADGROUP ... CLAIM or XAUTOCLAIM.
  • XPENDING: Returns the entries the group has delivered and that are not yet acknowledged.
  • XRANGE: Returns the entries of the stream at key with IDs from start to end, both included, oldest first.
  • XREAD: Reads entries with IDs greater than the ones given, from one or more streams.
  • XREADGROUP: Reads entries for consumer of consumer group group.
  • XREVRANGE: XRANGE, newest first; end comes first.
  • XSETID: Sets the last ID of the stream at key, so that new entries get greater IDs.
  • XTRIM: Removes the oldest entries of the stream at key.