Distributed geospatial ping storage and query engine with area queries, a sharded architecture and full observability. Built with Go and Kubernetes (with a Docker Compose version).
A ping is a single point in space and time that lives for a fixed duration (TTL; currently 10 seconds). Pings can be stored by sending a HTTP request to the API with the location coordinates (lat/lng). They can also be queried by area, by sending a HTTP request to the API with a bounding box and a precision. The precision is the number of characters in the geohash prefix, which defines the granularity of the query.
GeoStreamDB is split into three core services:
gateway: HTTP API (/ping,/pingArea) and request routingworker-node: shard storage/aggregation workers (gRPC)registry: service discovery and heartbeat coordination (gRPC)
The repo also includes observability and test tooling:
- Prometheus + Grafana + Alertmanager
- Kubernetes manifests
- Docker Compose local stack
- k6 test scenarios
- Registry acts as a single point of truth for worker/gateway heartbeats for service discovery.
- Client sends a HTTP request to the Load Balancer entrypoint (Docker Compose:
loadbalancernginx on:8080; Kubernetes: Gateway API via NGINX Gateway Fabric). - Load Balancer routes the request to a
gatewayreplica. - Gateway maps the ping to a worker node via consistent hashing (a ring with virtual nodes). The sharding key is the first
SHARDING_PRECISIONcharacters of the geohash. - Gateway calls the selected worker node via gRPC (
SendPing). - Worker node stores the ping in a 10s TTL time-buffer, where each time slot contains a Trie keyed by geohash prefixes (with a dense leaf optimization at
SHARDING_PRECISION→MAX_GH_PRECISION) with the ping count as value.
- Client sends a HTTP request to the Load Balancer entrypoint.
- Load Balancer routes the request to a
gatewayreplica. - Gateway computes a geohash cover set for the bounding box and chooses an aggregated precision to bound fanout.
- Gateway either:
- routes each covered geohash to its responsible worker(s) via gRPC (
GetPingArea) when the aggregated precision is at/above the sharding precision, or - broadcasts the request to all workers (when the aggregated precision is below the sharding precision).
- routes each covered geohash to its responsible worker(s) via gRPC (
- Worker nodes traverse their TTL time-buffer and aggregate counts from the Trie for the requested area (with bbox intersection filtering), then return results.
- Prometheus scrapes metrics from all components.
- Grafana dashboards for monitoring and alerting.
- Alertmanager with Prometheus alerting rules.
gateway/- HTTP API and routing logicworker-node/- gRPC worker serviceregistry/- gRPC registry/discovery serviceproto/- protobuf definitionsk8s/- Kubernetes manifests (deployments, services, HPA, Gateway API)overlays/- Kustomize overlays (minikube,prod)prometheus/- Prometheus and Alertmanager configurationgrafana/- dashboards and provisioningtest/- test scripts and results.run-tests.ps1orchestrates tests.loadbalancer/- NGINX configuration for Docker Compose version
There are 2 versions for local development and testing:
- Docker + Docker Compose (default)
- Kubernetes + Minikube
Required tooling:
- Docker Engine and Docker Compose for local containers (Docker Desktop is recommended).
- kubectl to interact with the cluster.
- Minikube for local Kubernetes.
- Helm to install NGINX Gateway Fabric and Chaos Mesh.
- k6 to run load and chaos-style tests.
Start the stack:
docker compose up --build -dDefault local endpoints:
- API entrypoint:
http://localhost:8080 - Grafana:
http://localhost:3000 - Prometheus:
http://localhost:9090 - Alertmanager:
http://localhost:9093 - Example web app:
index.html
Stop:
docker compose downRun a k6 scenario and bootstrap infra automatically:
./test/run-tests.ps1 -UseKubernetes -Test sustained-loadThis script uses:
- Minikube
- NGINX Gateway Fabric + Gateway API resources
- App and observability manifests
- Local port-forwards for API/Prometheus/Grafana/Alertmanager
Gateway HTTP endpoints:
POST /pingwith JSON body:{ "lat": <float>, "lng": <float> }GET /ping?lat=<float>&lng=<float>GET /pingArea?minLat=...&maxLat=...&minLng=...&maxLng=...&precision=...GET /metrics
Prometheus alerting is configured with Alertmanager.
Current baseline alert rules include:
- target down (
up == 0) - high node CPU/memory
- high pod CPU/memory (namespace
geostreamdb) - Prometheus-to-Alertmanager disconnect
Local UIs:
- Prometheus:
http://localhost:9090 - Alertmanager:
http://localhost:9093 - Grafana:
http://localhost:3000
Examples:
# default (Docker Compose)
./test/run-tests.ps1 -Test sustained-load
# Kubernetes
./test/run-tests.ps1 -UseKubernetes -Test all-direct
# Orchestrated scenarios (includes known disruptive tests)
./test/run-tests.ps1 -UseKubernetes -Test all-orchestratedArtifacts are written under k6/outputs.
No open-source license has been granted at this time. All rights reserved.



