In this section: Learn
Guides
- Guide: choosing and implementing a binding
- Guide: OBSP-COMMUNITY (COMMUNITY)
- Conformance guide
- Guide: OBSP-CONSTELLATION (CONSTELLATION)
- Guide: OBSP-CONSUMER
- Guide: the exchange plane (reference implementation)
- Guide: OBSP-GRID
- Implementers guide
- Guide: OBSP-MOBILE (MOBILE)
- Guide: OBSP-MODEL-OBSERVER (MODEL-OBSERVER)
- Guide: OBSP-NETWORK-SENSING (NETWORK-SENSING, provisional)
- Guide: OBSP-NODE
- Guide: operating the reference stack
- Operators guide
- Guide: OBSP-PROVIDER
- Python SDK: the 0.2 candidate mode (DRAFT)
- Release guide
- Guide: OBSP-SITE
- Guide: OBSP-SOV (operator sovereignty overlay)
- Start here: from a clone to a checked evidence set in 30 minutes
- Guide: the web front ends
Domain packs
- All domain packs
- Agriculture: fields, crops, livestock and stored grain
- Air quality: reference monitors and sensor networks
- Cryosphere: snow, glaciers, permafrost, sea and lake ice
- Greenhouse gases and methane: in-situ, flux and remote sensing
- Health (One Health): environment, animals and people
- Hydrology: river, lake, groundwater and water-quality stations
- Infrastructure: structural health of bridges, dams, tunnels and buildings
- Meteorology: surface synoptic and climate stations (GBON-oriented)
- Ocean: moorings, buoys, profiling floats and coastal stations
- Seismology and geodesy: seismometers, strong motion, GNSS and InSAR
- Space weather: geomagnetism, ionosphere and the solar wind
Participants
- Non-profits, humanitarian organisations, communities and citizen networks
- Device makers
- Enterprises and infrastructure owners
- Governments, agencies and utilities
- Individual experts, developers and students
- United Nations agencies and intergovernmental organisations
- National consortiums, national standards councils and national hosts
- Universities, observatories and research networks
- Managed-service and technology providers
Security and privacy
- Threat note: obsp-mcp (reference Model Context Protocol server)
- Threat note: credential status publisher (reference service)
- Threat note: discovery (reference service)
- Threat note: production public services
- Threat note: implementations and conformance registry (reference service)
- Threat note: transparency log (reference service)
- Supply chain: controls and current status
- Threat model of the Observatory Protocol (version 2)
- Privacy assessments
- Draft privacy impact assessment: COMMUNITY profile (OIP-0017)
- Draft privacy impact assessment: MOBILE profile, person-carried case (OIP-0013)
- Draft privacy impact assessment: NETWORK-SENSING profile (OIP-0011)
- Privacy impact assessment template
Pilot kits
Operations
- Operations
- Capacity scaling
- Capacity plan
- Chaos and resilience experiments
- Data plane
- Deploy
- Error-budget policy
- Game days
- Game day: clock skew
- Game day: disk full
- Game day: federation partition and rejoin
- Game day: replica loss
- Game day: slow or unreachable database
- Incident response
- Key rotation and compromise recovery
- Load and soak testing
- Observability conventions
- Offline site operation
- What the owner must decide
- Restore
- Rollback
- Service-level objectives
- Static web sites
- Supply chain and release hardening: the checks
- Variables
Data plane
On this page
How the reference gateway runs as a production data plane: stateless replicas on one PostgreSQL database, an object
store for large payloads, an event bus, and the workers that carry corrections to subscribers and federation peers.
The code is in reference/rust/obsp-gateway (features postgres, nats, s3, fast-alloc) and
reference/rust/obsp-dataplane. The manifests are gateway-dp, dataplane-relay, nats and dataplane-migrate in
infra/deploy, and the local stack is in infra/compose.
None of this runs anywhere yet.
nodes ──HTTP──▶ gateway-dp replicas (stateless) ──one transaction per write──▶ PostgreSQL + PostGIS
│ payloads ≥ 256 KiB by digest │ change feed (txid, seq)
▼ ▼
object storage (S3 API) dataplane-relay (one leader) ──CloudEvents──▶ NATS JetStream
│ one durable consumer per sink
fan-out workers ◀────────────────┘
├──▶ subscriber webhooks (application/cloudevents+json)
└──▶ federation peers' gateways (POST /node-ingest/v0.1/corrections)
What holds what
| Store | Holds | Durability | Restored from |
|---|---|---|---|
| PostgreSQL | every write: idempotency records, participants, claims, nodes, admissions, intake events (partitioned by month), key records, correction notices, deliveries | the database’s (commit waits for the WAL flush) | managed point-in-time recovery, or dataplane-backup.sh dumps |
| Object storage | intake payloads of 256 KiB or more (canonical form), by SHA-256 digest; every read is checked against the digest | the object store’s | a copy of the bucket (objects never change) |
| NATS JetStream | the stream of CloudEvents (7 days) | file storage, 3 replicas in production | not restored: the relay republishes from the database |
Record tables are append-only: triggers refuse UPDATE, DELETE and TRUNCATE (migrations/0001_initial.sql). A
correction is a new row in corrections, and the corrected record never changes. The view record_correction_state
gives each record’s state after its last notice. Only consumer_cursors (the relay’s progress) changes in place.
How a write stays correct across replicas
Each write is one transaction. The transaction takes advisory locks on every key the decision reads, in ascending
order: the idempotency key, the node whose key records it checks, every event id, and the entity it may create. It
then reads, decides, inserts and commits. Two writes that share a key are decided one after the other, as in the
single-lock reference store, and the answers match. Writes with disjoint keys run in parallel on any replica. Unique
constraints back the locks up: writes.scope_key, event_ids.event_id, entities (kind, uni) and
corrections.notice_uni. Evidence: every gateway test passes against PostgreSQL (OBSP_TEST_DATABASE_URL), and
tests/postgres.rs sends every batch through two replicas at once. Each event is accepted exactly once, and the other
replica answers it as an idempotent replay.
Delivery guarantees
- Relay. It reads the change feed in commit order, below the oldest transaction still in progress, so it never passes a row that commits later. It publishes a batch, waits for the bus to acknowledge every message, and only then saves its cursor. Delivery is at least once. JetStream drops a duplicate by its message id (the CloudEvent id) within its 2-minute window, and every consumer must also treat a repeated id as a duplicate. One relay is active per database, chosen by a session advisory lock; another replica takes over when the leader’s connection ends.
- Fan-out. Each sink has its own durable consumer, so a slow sink delays only itself. A failed delivery is retried
with a doubling delay of up to 60 s, and the sink’s later corrections wait for it. This keeps one worker’s
deliveries in recording order. With two relay replicas sharing a durable consumer, order holds per message only. A
peer gateway answers a repeated notice as an idempotent replay. Every delivery is recorded in
deliverieswith its latency. - Back-pressure. At most 4 096 publishes await their acknowledgement at once. A slow bus slows the relay, never the intake: the intake answers after its own commit and does not wait for the bus.
Operating it
- Migrations are forward-only and embedded in the binary:
obsp-gateway migrate --database-url ... --database-password-file .... Thedataplane-migratejob runs it, and in compose it runs once before the replicas start. A changed migration that was already applied is refused (checksum). Concurrent runs wait on the migrator’s lock. Each run also creates the event partitions of this month and the next two. Run it at least monthly, for example with every release; an event that lands in the default partition makes a later partition for that month impossible to create. - Probes.
GET /livezanswers 200 while the process serves.GET /readyzanswers 200 when every migration is applied and the gateway is not draining, and 503 otherwise. - Drain. On SIGTERM a replica turns not ready at once, stops accepting connections and finishes the requests in
progress. It exits 0 within
--drain-seconds(25 in the manifests, under the 30 s termination grace). Evidence:tests/drain.rs. - Tracing. Requests carry W3C
traceparent(observability).OTEL_EXPORTER_OTLP_ENDPOINTexports spans, and--log jsonwrites structured logs. - Pool.
--database-poolsets the connections per replica (16 in the manifests). Keep the sum over the maximum replicas below the database’s connection limit.
Backup and restore
infra/deploy/scripts/dataplane-backup.sh <folder> writes four things:
pg_dump(custom format);- a manifest with the row count and an MD5 digest of every record table, taken from the same exported snapshot as the dump;
- the object store (a file store; for a bucket, copy it with the operator’s tool after the dump);
- the complete-line prefix of a JSON-lines store.
dataplane-restore.sh <folder> restores into an empty database, object folder and store file. It refuses anything
else. It checks, in order: the backup’s checksums; the manifest’s table digests; the append-only triggers; every
object’s digest; the store’s digest.
It also refuses a target whose transaction counter is not past the backup’s highest transaction id. The relay orders
the change feed by transaction id, so restored rows would otherwise sort after new ones. On a fresh cluster, first
advance the epoch of its transaction counter (pg_resetwal --epoch, with the server stopped). Managed services restore
their own point-in-time copies within the same counter.
make dataplane-restore-test (with OBSP_DRILL_ADMIN_URL) is the drill, 17 checks:
- Load two gateways, one on PostgreSQL with offloaded payloads and one on a JSON-lines store, and record a correction.
- Back up while both serve.
- Restore, and check that gateways on the copies serve the same records, payloads and correction state, and answer a known idempotency key from the restored store.
- Check that the restored gateways accept new writes, and that the triggers still refuse an update.
- Check that a restore into a database that holds tables is refused, and so is a backup whose bytes changed.
Last run: every check passed. The drill found and fixed a race in the file object store (two writes of one object shared a temporary file name).
Capacity
See reference/rust/obsp-load/RESULTS.md. On one shared 4-thread machine, with the harness, the replicas and PostgreSQL all on it, the measured throughput is:
- about 17 000 to 19 000 events per second on PostgreSQL, with 1, 2 or 4 replicas;
- 38 000 to 41 000 events per second on the in-memory store.
This machine is CPU-bound. Per event, the gateway uses about 108 µs and PostgreSQL about 86 µs. The target of 100 000 events per second per region was not reached here. By those figures it needs about 11 gateway cores and 9 database cores; that is an estimate, not a measurement. Correction propagation was at most 232 ms on one machine, against an objective of 60 s or less. It has not been measured across regions.
Not done
- No deployment, account, domain or secret exists. The database address and range, the object store, the subscribers and the federation peers are owner decisions (owner-decisions.md).
- The compose services for PostgreSQL, NATS and the object store emulator were checked statically
(
tests/test_infra.py,docker compose config). No container engine ran in the environment where they were written. - PostgreSQL scales up, not out. Partitioning tenants or regions over several databases is not built.
- Payloads offloaded to the object store are not matched by
find_payload’s member lookup (the 0.2 candidate’s time-quality lookup), because only their digest is in the database. - The relay does not carry the intake request’s
traceparentinto the CloudEvent.