Catalogue / Edge

Real-time gateway

edgerealtime-gateway

Holds long-lived client connections and pushes events.

Category
Edge
Properties
11
Components
20
Rules
3
Properties · 11 defined by this kind

A node of this kind resolves each property from its own props, then the component's defaults, then the default below.

propertytypevaluesrequireddefault
ackIntervalSeconds · advancedinteger—no—
autoscalingboolean—nofalse
channelAssignment · advancedenumrandom | hash | stickynorandom
drainOnScaleIn · advancedboolean—nofalse
managedboolean—nofalse
protocolenumwebsocket | sse | long-poll | grpc-stream | udp-multicastnowebsocket
pushFallback · advancedboolean—nofalse
sequenceNumbers · advancedboolean—nofalse
stampedeGuard · advancedboolean—nofalse
statefulboolean—notrue
subscriptionsPerUser · advancedinteger—no—
Rules for this kind · 3
reconnect-stampede-without-guard

When a gateway holding millions of sockets restarts, every client reconnects at once and the gateway asks the coordination service about each of them. Without a stampede guard that lookup storm takes the coordination service down too.

  • — all of these hold:
  • — the node has at least one synchronous outgoing edge to a coordination-service
  • — the node's `stampedeGuard` is false
shared-host-per-channel-without-isolation

With heavy-tail traffic a few channels carry most of the load. Assigning channels at random lands those hot channels on arbitrary hosts, and every tenant sharing a host suffers for it.

  • — all of these hold:
  • — the node's `channelAssignment` is "random"
  • — the design requirement `traffic.skew` is "heavy-tail"
stateful-websocket-scale-in-without-drain

Scaling a gateway down kills every live WebSocket on the removed instance at once. Without a drain step those clients all reconnect together.

  • — all of these hold:
  • — the node's `autoscaling` is true
  • — the node's `drainOnScaleIn` is false
Components · 20
Source
# yaml-language-server: $schema=../schema/kind.schema.json
# Holds long-lived client connections and pushes events (WebSocket gateways, chat servers, long-poll and multicast feeds).
# stampedeGuard and drainOnScaleIn default false so reconnect and scale-in rules can fire.
schemaVersion: "1"
type: "kind"
id: "realtime-gateway"
category: "edge"
properties:
  protocol:
    type: "enum"
    values: ["websocket", "sse", "long-poll", "grpc-stream", "udp-multicast"]
    default: "websocket"
  stateful:
    type: "boolean"
    default: true
  autoscaling:
    type: "boolean"
    default: false
  channelAssignment:
    type: "enum"
    values: ["random", "hash", "sticky"]
    default: "random"
    advanced: true
  drainOnScaleIn:
    type: "boolean"
    default: false
    advanced: true
  stampedeGuard:
    type: "boolean"
    default: false
    advanced: true
  sequenceNumbers:
    type: "boolean"
    default: false
    advanced: true
  ackIntervalSeconds:
    type: "integer"
    advanced: true
  subscriptionsPerUser:
    type: "integer"
    advanced: true
  pushFallback:
    type: "boolean"
    default: false
    advanced: true
  managed:
    type: "boolean"
    default: false

The same page as markdown, for an agent: /catalogue/kinds/realtime-gateway.md