No description
  • Erlang 94.8%
  • HTML 3.7%
  • Python 0.6%
  • Shell 0.6%
  • Dockerfile 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
beamologist 07acd1491c docs: the README names OTP 28, and not 28 plus later majors
grpc_plugin's erlware_commons does not compile on OTP 29 (build-push.yml:34), so a 28+ claim is false for this tree. Terra, r=release.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-23 03:19:54 +02:00
.github/workflows ci: run the test gate on branches and pull requests (Refs #12) 2026-10-23 02:59:41 +02:00
architecture build: OTP 28, and the docs and C4 name it 2026-10-23 02:59:41 +02:00
assets build: OTP 28, and the docs and C4 name it 2026-10-23 02:59:41 +02:00
config feat: HTTP/JSON API + embedded admin UI (v0.11.0) 2026-06-22 15:59:36 +02:00
docs build: OTP 28, and the docs and C4 name it 2026-10-23 02:59:41 +02:00
gen/go/gatewayv1 feat: initial reckon-gateway — gRPC gateway for ReckonDB 2026-03-22 22:10:38 +01:00
include feat: cluster leader/follower indicators + gateway telemetry 2026-07-02 13:21:56 +02:00
plans plans(draft): DESIGN_DCB_GRPC_SURFACE 2026-05-27 08:57:23 +02:00
priv/static/admin Decentralization Scorecard: reframe dashboard hero from throughput to autonomy/sovereignty/resilience/footprint (0.30.0) 2026-07-08 22:51:18 +02:00
scripts feat(admin): CCC payload/hash query views; fix Context Query icon (GitHub mark) 2026-06-24 00:39:48 +02:00
src chore: 0.30.2 2026-10-23 02:59:41 +02:00
test fix: boot without IPv6, refuse an unparseable listen_ip (reckon-gateway#11) 2026-10-23 02:59:41 +02:00
vendor/grpc fix: both listeners bind dual-stack, driven by listen_ip (reckon-gateway#11) 2026-10-23 02:59:41 +02:00
.gitignore feat!: remove CausationService (lineage is an app concern) — 0.8.0 2026-06-07 23:38:17 +02:00
CHANGELOG.md build: OTP 28, and the docs and C4 name it 2026-10-23 02:59:41 +02:00
Dockerfile build: OTP 28, and the docs and C4 name it 2026-10-23 02:59:41 +02:00
LICENSE feat: initial reckon-gateway — gRPC gateway for ReckonDB 2026-03-22 22:10:38 +01:00
README.md docs: the README names OTP 28, and not 28 plus later majors 2026-10-23 03:19:54 +02:00
rebar.config chore: 0.30.2 in both relx release tuples 2026-10-23 02:59:41 +02:00
SECURITY.md Add SECURITY.md: where to report a vulnerability, and what happens next 2026-09-28 21:13:45 +02:00

ReckonDB

reckon-gateway

gRPC ingress for ReckonDB.
Federate N remote Erlang clusters over one endpoint, or boot a local store in the same image.

release image license erlang sponsor


What it is

reckon-gateway is a single OCI image that exposes the ReckonDB event-store API over two protocols at once: gRPC (port 50051) and an HTTP/JSON REST API (port 8080). Polyglot clients (Go, .NET, Rust, Python) get the full feature surface without speaking Erlang dist; the HTTP port also serves a browser admin UI at /admin and a live event stream over SSE. Pick gRPC for typed high-throughput clients, REST for curl/browser/scripting.

Three operational modes, selected by environment at boot:

Mode STORE_ENABLED CLUSTERS_PATH Use case
Catalogue (default) false set Federate N remote ReckonDB clusters over one gRPC endpoint. Gateway holds no data.
Embedded true unset One container = one ReckonDB store, served over gRPC.
Hybrid true set Local store and federated remote clusters from the same endpoint.

architecture overview

Quick start

Pull the image

podman pull ghcr.io/reckon-db-org/reckon-gateway:0.30.2

Run embedded (one container, one store)

podman run -d --name reckon-gw \
  -p 50051:50051 -p 8080:8080 \
  -v reckon-data:/data \
  -e RECKON_GATEWAY_STORE_ENABLED=true \
  -e RECKON_GATEWAY_STORE_ID=my_store \
  -e RECKON_GATEWAY_LOCAL_CLUSTER_ID=local \
  -e RECKON_GATEWAY_DIST_HIDDEN_FLAG=-hidden \
  ghcr.io/reckon-db-org/reckon-gateway:0.30.2

50051 is gRPC; 8080 serves the REST API + admin UI (http://localhost:8080/admin).

Run catalogue (federate remote clusters)

podman run -d --name reckon-gw \
  -p 50051:50051 -p 8080:8080 \
  -v /etc/reckon-gateway/clusters.eterm:/etc/reckon-gateway/clusters.eterm:ro \
  -e RECKON_GATEWAY_DIST_HIDDEN_FLAG=-hidden \
  ghcr.io/reckon-db-org/reckon-gateway:0.30.2

Set RECKON_GATEWAY_DIST_HIDDEN_FLAG=-hidden for catalogue and embedded-single deployments so the gateway is invisible to peers' nodes/0 and pg sync doesn't leak across cookie-disjoint clusters. Leave empty when running embedded STORE_MODE=cluster (gateway containers in a Ra quorum need mutual pg visibility). See docs/env-contract.md#hidden-node-flag.

See docs/clusters-eterm.md for the clusters.eterm schema.

Call from a client

A stream id is <prefix>-<32 hex> (1 to 32 lowercase letters, one hyphen, 32 lowercase hex digits); the store refuses any other shape with invalid_stream_id. The rule and how to make one: Stream Ids.

conn, _ := grpc.NewClient("localhost:50051", grpc.WithTransportCredentials(insecure.NewCredentials()))
client := streampb.NewStreamServiceClient(conn)

resp, _ := client.AppendEvents(ctx, &streampb.AppendEventsRequest{
    StoreId:         "my_store",
    StreamId:        "user-7c4b9f1e2a8d4c3b9f7e5d1a2b3c4d5e",
    ExpectedVersion: -1,
    Events: []*streampb.ProposedEvent{{
        EventType: "user_registered_v1",
        Data:      []byte(`{"name":"Alice"}`),
    }},
})

Full example: docs/examples/go-quickstart.md.

Or call over HTTP/JSON (no protobuf needed)

# append
curl -sX POST localhost:8080/v1/stores/my_store/streams/user-7c4b9f1e2a8d4c3b9f7e5d1a2b3c4d5e/events \
  -H 'content-type: application/json' \
  -d '{"expected_version":"any","events":[{"event_type":"user_registered_v1","data":{"name":"Alice"}}]}'
# → {"version":0,"count":1}

# read back
curl -s "localhost:8080/v1/stores/my_store/streams/user-7c4b9f1e2a8d4c3b9f7e5d1a2b3c4d5e/events?from=0&limit=100"

Full HTTP reference: docs/http-api.md. Browser admin UI: docs/admin-ui.md.

gRPC services

Service Description
StreamService Append, read, list, delete event streams
SubscriptionService Persistent server-streaming subscriptions
SnapshotService Aggregate state snapshots
TemporalService Time-based event queries
SchemaService Event schema registration + upcasting
AdminService Store inspection, scavenging, stream links
StoresService Store enumeration via the catalogue
HealthService Health checks, cluster diagnostics, memory pressure
DcbService Dynamic Consistency Boundary: tag-filter conditional append + context read, DCB log/tag/event-type introspection, and CCC payload-index reads (gRPC handlers since 0.14.0; requires reckon-db 5.4+ backing) — see docs/dcb-ccc.md and the DCB guide

Proto definitions are the source of truth and live in reckon-proto. The gateway fetches them as a rebar3 dep at build time.

HTTP/JSON API + admin UI

The same feature surface is served over plain HTTP on port 8080 (RECKON_GATEWAY_HTTP_PORT), for clients that don't want to generate protobuf stubs:

Path prefix What
GET /v1/health, /v1/health/:store, /v1/server-info/:store Liveness + version/integrity info
GET /v1/stores, /v1/stores/:store Store discovery via the catalogue
* /v1/stores/:store/streams/... Append, read, list, delete, version
GET /v1/stores/:store/events/by-type|by-tags|by-metadata|global Cross-stream indexed reads
* /v1/stores/:store/dcb/... DCB context/append/log/tags/event-types + CCC by-payload(-hash)/payload-indexes
GET /v1/admin/events Live catalogue/cluster status over Server-Sent Events
GET /admin Browser admin UI (stores, streams, DCB/CCC query views)

Full reference: docs/http-api.md, docs/admin-ui.md, docs/dcb-ccc.md.

Documentation

Full index: docs/README.md , audience-grouped, with suggested reading orders.

Quick jumps:

Versioning

Component Version (2026-10)
reckon_gateway 0.30.2
reckon_gater (deps) ~> 3.7
reckon_db (deps, opt) ~> 5.5
reckon_proto (deps) v0.8.0
Erlang/OTP 28

Pin to the semver tag (:0.30.2) for reproducible deploys; :latest tracks main.

License

Apache-2.0 , see LICENSE.