fedify Main Island

The Storehouse Quarter

ja· en· ko
If you're new hereThe shelves that hold outgoing letters for a while, and the mechanism that carries them in order. Where the data is kept.

Restart the server and no letter is lost; a delivery that fails still arrives later. And whether you keep it in postgres, redis, or sqlite, not one line of your code changes—because a storehouse's interface is fixed to two shapes, KvStore and MessageQueue.

The amqp hut has no KvStore. RabbitMQ is a tool for passing messages, not a set of shelves—so it doesn't take on work it can't do. This "what isn't there isn't there" is part of the quarter's design too.

Highlights

  • The interface definitions live on the Main Hall side: federation/kv.ts and federation/mq.ts. cas() (compare-and-swap) since 1.8.0, list() since 2.0.0.
  • The nativeRetrial flag on MessageQueue—if the storehouse has its own retry, fedify stops its own and yields.
  • The redis storehouse allows a swappable JsonCodec, plus a full set of error placards: CodecError/EncodingError/DecodingError.
  • The sqlite storehouse bundles its own thin SqliteDatabase layer. Both hollo and hackers.pub, incidentally, chose the postgres storehouse.

A passage from the sutra

export interface MessageQueue {
  /**
   * Whether the message queue backend provides native retry mechanisms.
   * When `true`, Fedify will skip its own retry logic and rely on the backend
   * to handle retries. When `false` or omitted, Fedify will handle retries
   * using its own retry policies.
   *
   * @default `false`
   * @since 1.7.0
   */
  readonly nativeRetrial?: boolean;
packages/fedify/src/federation/mq.ts L78-L88— If the storehouse can retry on its own, fedify yields

Try it yourself

The storehouse is empty.
Delivered: 0

Floor plan

packages/fedify/src/federation/kv.ts
The KvStore interface: get/set/delete + cas + list
packages/fedify/src/federation/mq.ts
The MessageQueue interface: enqueue/listen + nativeRetrial
packages/redis/src
The Redis storehouse, with a swappable JsonCodec
packages/amqp/src
The courier hut (queue only, no shelves)

Neighboring rooms

Outside links