HUB
Sign inSign up
ring-coordinator logo

stacksaga/ring-coordinator

By stacksaga

•Updated 16 days ago

Consistent-hashing token range coordinator for StackSaga microservice transaction retries.

Image
Developer tools
Monitoring & observability
0

292

stacksaga/ring-coordinator repository overview

⁠StackSaga Ring Coordinator

Docker Image Documentation License

StackSaga Ring Coordinator is the dedicated infrastructure service responsible for coordinating 64-bit Murmur3 consistent-hashing token ranges across microservice orchestrator instances (Retry Nodes) in the StackSaga distributed transaction ecosystem.

Instead of building and maintaining a custom Spring Boot application, developers and DevOps teams can run this pre-built, production-grade official image directly.


⁠Supported Tags & Flavors

TagBase OSC LibraryRecommended Use
stacksaga/ring-coordinator:alpine
stacksaga/ring-coordinator:<version>-alpine
Alpine LinuxmuslLightweight (Default): Rapid startup and minimal image footprint (~180MB). Recommended for dev, test, and resource-constrained environments.
stacksaga/ring-coordinator:latest
stacksaga/ring-coordinator:<version>
Ubuntu JammyglibcEnterprise Production: 100% compatible with APM profilers (Dynatrace, Datadog, New Relic) and native Netty epoll performance.

⁠Operational Requirement: NTP & UTC Clock Synchronization

Every component in the StackSaga retry subsystem relies on synchronized clocks for time-windowed token partition grants:

  • The Master calculates and publishes ring partitions at the 30th second of every minute with validity for the upcoming 1-minute window ($T+1$ to $T+2$).
  • Every container must maintain NTP-class UTC clock discipline. The official image enforces TZ=Etc/UTC by default.
  • Ensure your Docker host or Kubernetes worker nodes run active NTP synchronization (chrony, systemd-timesyncd, or cloud NTP).

⁠Real-Time Visual Dashboard & Observability

The Ring Coordinator includes a built-in real-time dashboard and observability endpoints to monitor live cluster activities, connected slave nodes, token range allocations, and connected retry nodes:

EndpointFormatDescription
/dashboard (or /)HTMLInteractive real-time web dashboard displaying live cluster topology, active slave nodes, assigned token ranges, and connected retry nodes.
/banner (or /)Plain TextASCII status banner providing instant cluster diagnostics via curl in terminal or CI/CD scripts.
/api/live/streamtext/event-streamReactive Server-Sent Events (SSE) stream emitting real-time cluster state updates every second.
/api/live/snapshotJSONInstant JSON snapshot of live coordinator state, slave connections, and token ranges.
/actuator/healthJSONSpring Boot Actuator health probe endpoint.
/actuator/metricsJSONPerformance and JVM runtime metrics.
⁠Terminal Quick-Check
curl -s http://localhost:8080/banner

⁠Quickstart

⁠1. Standalone / Hybrid Mode (Docker Run)

Master and Slave run embedded together inside a single container — ideal for local microservice development:

docker run -d \
  --name ring-coordinator \
  -p 7777:7777 \
  -p 8080:8080 \
  -e STACKSAGA_COORDINATOR_INSTANCE_TYPE=master,slave \
  -e STACKSAGA_TARGET_SERVICES=* \
  -e STACKSAGA_CLUSTER=dev-cluster \
  -e STACKSAGA_REGION=default \
  stacksaga/ring-coordinator:alpine
  • Port 7777: RSocket TCP port (connect your application orchestrators here).
  • Port 8080: Live visual dashboard (http://localhost:8080/) and Actuator endpoints.

⁠2. Minimal Standalone (Docker Compose)

docker-compose.yml:

services:
  ring-coordinator:
    image: stacksaga/ring-coordinator:alpine
    container_name: stacksaga-ring-coordinator
    ports:
      - "7777:7777"   # RSocket server (Microservices connect here)
      - "8080:8080"   # Live Dashboard & Health Endpoints
    environment:
      - TZ=Etc/UTC
      - STACKSAGA_COORDINATOR_INSTANCE_TYPE=master,slave
      - STACKSAGA_TARGET_SERVICES=*
      - STACKSAGA_CLUSTER=dev-cluster
      - STACKSAGA_REGION=default
    volumes:
      - /etc/localtime:/etc/localtime:ro
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
      interval: 5s
      timeout: 3s
      retries: 10
      start_period: 10s
    restart: unless-stopped

Run with:

docker compose up -d

⁠3. Horizontally Scalable Cluster (Docker Compose)

A single Master coordinates a dynamically scalable pool of Slaves. docker-compose.scalable.yml:

services:
  coordinator-master:
    image: stacksaga/ring-coordinator:alpine
    container_name: stacksaga-master
    hostname: coordinator-master
    ports:
      - "7777:7777"   # Master RSocket
      - "8080:8080"   # Master Live Dashboard
    environment:
      - TZ=Etc/UTC
      - STACKSAGA_COORDINATOR_INSTANCE_TYPE=master
      - STACKSAGA_TARGET_SERVICES=*
      - STACKSAGA_CLUSTER=production-cluster
      - STACKSAGA_REGION=default
    volumes:
      - /etc/localtime:/etc/localtime:ro
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
      interval: 5s
      timeout: 3s
      retries: 10
      start_period: 10s
    restart: unless-stopped

  coordinator-slave:
    image: stacksaga/ring-coordinator:alpine
    depends_on:
      coordinator-master:
        condition: service_healthy
    environment:
      - TZ=Etc/UTC
      - STACKSAGA_COORDINATOR_INSTANCE_TYPE=slave
      - STACKSAGA_TARGET_SERVICES=*
      - STACKSAGA_CLUSTER=production-cluster
      - STACKSAGA_REGION=default
      - STACKSAGA_MASTER_HOST=coordinator-master
      - STACKSAGA_MASTER_PORT=7777
    volumes:
      - /etc/localtime:/etc/localtime:ro
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
      interval: 5s
      timeout: 3s
      retries: 10
      start_period: 10s
    restart: unless-stopped

Deploy with 3 Slaves:

docker compose -f docker-compose.scalable.yml up -d --scale coordinator-slave=3

Scale to 5 Slaves dynamically:

docker compose -f docker-compose.scalable.yml up -d --scale coordinator-slave=5

Note for Production: Switch image: stacksaga/ring-coordinator:alpine to image: stacksaga/ring-coordinator:latest for enterprise production deployments with APM profilers.


⁠Environment Variable Reference

Environment VariableProperty NameDefaultDescription
STACKSAGA_COORDINATOR_INSTANCE_TYPEstacksaga.coordinator.instance-typemaster,slaveRole to run: master, slave, or master,slave (hybrid).
STACKSAGA_TARGET_SERVICESstacksaga.coordinator.target-services*Comma-separated target service names or * for all.
STACKSAGA_INDEX_BASEDstacksaga.coordinator.deploy.index-basedfalseEnable Kubernetes StatefulSet ordinal detection (Pod-0 is Master).
STACKSAGA_MASTER_HOSTstacksaga.coordinator.slave.target-master.hostlocalhostMaster host for Slave nodes to connect to.
STACKSAGA_MASTER_PORTstacksaga.coordinator.slave.target-master.port7777Master port for Slave nodes to connect to.
RSOCKET_PORTspring.rsocket.server.port7777Port for the embedded RSocket TCP server.
SERVER_PORTserver.port8080Port for the live dashboard and health endpoints.
STACKSAGA_CLUSTERstacksaga.instance.clusterdefault-clusterVirtual cluster identifier.
STACKSAGA_REGIONstacksaga.instance.regiondefaultDeployment region identifier.
STACKSAGA_COORDINATOR_DASHBOARD_ENABLEDstacksaga.coordinator.dashboard.enabledtrueEnable or disable the live visual dashboard and SSE stream.
STACKSAGA_COORDINATOR_DASHBOARD_PATHstacksaga.coordinator.dashboard.path/dashboardBase web path where the live HTML dashboard is served.
STACKSAGA_COORDINATOR_DASHBOARD_EXPOSE_ROOTstacksaga.coordinator.dashboard.expose-roottrueExpose dashboard & banner at root path (/).

⁠Documentation & Community

Tag summary
Recent tags
Content type
Image
Digest
sha256:df5c6f0ba…
Size
141.2 MB
Last updated
16 days ago
docker pull stacksaga/ring-coordinator:latest