Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/enterprise/clustering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,29 @@ platform that can make an outbound gRPC connection.
| Leader election | Deterministic over gossip members | Deterministic over the broker roster (same algorithm) |
| Entity replication | Over the gRPC mesh | Over the broker relay - identical entity types |

### Broker-mode synchronization performance

Broker mode separates cluster traffic into dedicated lanes for general messages,
heartbeats, governance usage, KV-store updates, circuit-breaker events,
load-balancer logs, and diagnostics. This prevents heavy traffic in one lane from
blocking a different kind of cluster traffic.

However, all messages of the same type addressed to a node share that node's
corresponding broker stream:

```text
Node B ─┐
Node C ─┼──> Node A's governance stream
Node D ─┘
```

Mesh mode instead has a separate stream between each pair of nodes. As a result,
slow processing or heavy traffic from one peer can delay same-lane messages from
other peers in broker mode. Broker mode may therefore synchronize more slowly
than mesh mode under contention. Use mesh mode when the environment permits
direct node-to-node connectivity and maximum synchronization performance is
required.

Leadership in broker mode uses the **same deterministic rule** as mesh mode:
the lexicographically-smallest node ID in the roster is the leader. Every node
computes this independently from the roster the broker pushes, so there is
Expand Down
23 changes: 20 additions & 3 deletions helm-charts/bifrost/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,28 @@ false
{{- /* Cluster Config */ -}}
{{- if and .Values.bifrost.cluster .Values.bifrost.cluster.enabled }}
{{- $cluster := dict "enabled" true }}
{{- if .Values.bifrost.cluster.peers }}
{{- $_ := set $cluster "peers" .Values.bifrost.cluster.peers }}
{{- end }}
{{- $clusterType := default "mesh" .Values.bifrost.cluster.type }}
{{- $_ := set $cluster "type" $clusterType }}
{{- if .Values.bifrost.cluster.region }}
{{- $_ := set $cluster "region" .Values.bifrost.cluster.region }}
{{- end }}
{{- if eq $clusterType "broker" }}
{{- $broker := dict }}
{{- $_ := set $broker "address" .Values.bifrost.cluster.broker.address }}
{{- if .Values.bifrost.cluster.broker.listenPort }}
{{- $_ := set $broker "listen_port" .Values.bifrost.cluster.broker.listenPort }}
{{- end }}
{{- if hasKey .Values.bifrost.cluster.broker "tls" }}
{{- $_ := set $broker "tls" .Values.bifrost.cluster.broker.tls }}
{{- end }}
{{- if .Values.bifrost.cluster.broker.authToken }}
{{- $_ := set $broker "auth_token" .Values.bifrost.cluster.broker.authToken }}
{{- end }}
{{- $_ := set $cluster "broker" $broker }}
{{- else }}
{{- if .Values.bifrost.cluster.peers }}
{{- $_ := set $cluster "peers" .Values.bifrost.cluster.peers }}
{{- end }}
{{- if .Values.bifrost.cluster.gossip }}
{{- $gossip := dict }}
{{- if .Values.bifrost.cluster.gossip.port }}
Expand Down Expand Up @@ -696,6 +712,7 @@ false
{{- end }}
{{- $_ := set $cluster "discovery" $discovery }}
{{- end }}
{{- end }}
{{- $_ := set $config "cluster_config" $cluster }}
{{- end }}
{{- /* SCIM Config */ -}}
Expand Down
70 changes: 62 additions & 8 deletions helm-charts/bifrost/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2261,6 +2261,36 @@
"type": "boolean",
"description": "Whether cluster mode is enabled"
},
"type": {
"type": "string",
"enum": ["mesh", "broker"],
"description": "Cluster transport mode"
},
"broker": {
"type": "object",
"description": "Broker transport configuration",
"properties": {
"address": {
"type": "string",
"description": "Broker address in host:port format"
},
"listenPort": {
"type": "integer",
"minimum": 1,
"maximum": 65535,
"description": "Broker listen port"
},
"tls": {
"type": "boolean",
"description": "Whether to use TLS for the broker connection"
},
"authToken": {
"type": "string",
"description": "Optional shared secret sent when connecting to the broker"
}
},
"additionalProperties": false
},
"peers": {
"type": "array",
"description": "List of peer addresses",
Expand Down Expand Up @@ -2422,16 +2452,40 @@
}
}
},
"if": {
"properties": {
"enabled": {
"const": true
"allOf": [
{
"if": {
"properties": {
"enabled": { "const": true },
"type": { "const": "broker" }
},
"required": ["enabled", "type"]
},
"then": {
"required": ["broker"],
"properties": {
"broker": {
"required": ["address"],
"properties": {
"address": { "minLength": 1 }
}
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
}
},
{
"if": {
"properties": {
"enabled": { "const": true },
"type": { "const": "mesh" }
},
"required": ["enabled"]
},
"then": {
"required": ["gossip"]
}
}
},
"then": {
"required": ["gossip"]
}
]
},
"scim": {
"type": "object",
Expand Down
8 changes: 8 additions & 0 deletions helm-charts/bifrost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,15 @@ bifrost:
# Cluster mode configuration for distributed deployments
cluster:
enabled: false
# Cluster transport: mesh or broker (defaults to mesh)
# type: mesh
# region: "" # Region identifier for cluster
# Broker transport settings (used when type is broker)
# broker:
# address: "broker.example.com:50051"
# listenPort: 50051
# tls: false
# authToken: "env.BIFROST_CLUSTER_BROKER_AUTH_TOKEN"
peers: []
# - "bifrost-0.bifrost-headless:7946"
# - "bifrost-1.bifrost-headless:7946"
Expand Down
Loading