HUB
Sign inSign up

featurehub/edge

By featurehub

•Updated 4 months ago

FeatureHub Edge: SDK-facing streaming (SSE) and REST feature API

Image
0

100K+

featurehub/edge repository overview

⁠FeatureHub Edge (Streaming + REST)

Edge is the SDK-facing FeatureHub server. This image is published as featurehub/edge. It serves feature state to SDKs through:

  • Streaming: Server-Sent Events (SSE), with near real-time updates
  • REST: GET polling, plus PUT for service accounts allowed to change features (for example in automated tests)

Edge keeps almost no state. It knows only which clients are connected and which environments they listen to. It gets feature data from the Dacha cache and receives feature updates over the async layer (NATS, Kafka or Google Pub/Sub). It never connects to the database, so you can scale it out freely. Run at least two instances in production. See Architecture – Edge (Streaming+REST)⁠.

Edge is part of the scalable streaming deployment (Option 2a⁠), together with mr⁠ and dacha2⁠. For REST only, backed by the database, see edge-rest⁠.

Full documentation: https://docs.featurehub.io⁠

⁠Running

With Dacha2 (recommended):

docker run -p 8553:8553 --user 999:999 \
  -e dacha1.enabled=false -e dacha2.enabled=true \
  -e dacha.url.default=http://dacha2:8902 \
  -e nats.urls=nats://nats:4222 \
  featurehub/edge:latest

⁠Ports

PortPurpose
8553Edge SDK API, SSE and REST (server.port)
8701Prometheus metrics and health checks (monitor.port)

⁠Configuration

You can set any configuration property as an environment variable with the same name and case. You can also mount /etc/app-config/application.properties and /etc/app-config/secrets.properties. See Run configuration⁠.

PropertyDescription
dacha1.enabled, dacha2.enabledWhich cache to use. For Dacha2, set dacha1.enabled=false and dacha2.enabled=true. See Async options⁠.
dacha.url.defaultURL of the Dacha2 service. Required for Dacha2.
nats.urlsNATS servers. For Kafka or Google Pub/Sub, see Async options⁠.
jersey.cors.headersCORS headers allowed for browser SDKs.
edge.sse.drop-after-secondsHow long (default 30) an SSE client stays connected before it is disconnected. 0 keeps connections open.
edge.sse.heartbeat-periodInterval for heartbeat events on SSE connections (default 0, off).
edge.dacha.delay-slotsRandom reconnect delay window when Dacha is not ready, to prevent reconnect storms.
edge.cache-control.headerOverride Cache-Control on GET (polling) responses.
update.pool-size, listen.pool-sizeThread pools for incoming updates and incoming listen requests.

See Edge (all) Config⁠ and Edge (Streaming) Config⁠.

⁠Health and metrics

⁠More information

License: Apache 2 with Commons Clause.

Tag summary

Content type

Image

Digest

sha256:1e9469855…

Size

158.3 MB

Last updated

4 months ago

docker pull featurehub/edge