Concepts
The path of a message
Section titled “The path of a message”publishers ─gRPC/REST─▶ gateway pod ──▶ WAL on a regional disk ── sync ──▶ ack │ └─ uploader ─▶ Cloud Storage segments (about 1 s each) ├─ tail cache (recent messages in memory) └─ Postgres: topics, subscriptions, segment index, acknowledgement positions, leases- A publisher sends a message to any gateway pod.
- The pod appends it to its write-ahead log and syncs the disk. Only then does it acknowledge the publish.
- About once a second, the pod uploads what it wrote to Cloud Storage as a segment and records the segment in Postgres.
- Each zone’s consumers receive the messages published in their zone, from memory on a pod in that zone, or from Cloud Storage once they are older.
Cluster
Section titled “Cluster”Gateway. The lowtide server. Each gateway pod serves the Pub/Sub API (gRPC and REST) and stores what is published to it.
Zone. A cluster runs in two zones of one region. Each zone has its own StatefulSet of gateway pods. Clients are routed to a pod in their own zone when there is one.
Write-ahead log (WAL). Each pod’s log of messages not yet uploaded. It sits on a regional persistent disk, which replicates every write to both zones. If a zone fails, a pod in the other zone can mount the disk and recover the log (Zone failure).
Writer stream. Every pod writes its own stream of messages, named after the pod. A topic’s messages are spread over the streams of the pods that received them. This is why pod names must never change on a running cluster.
Segment. A file in Cloud Storage holding about one second of a pod’s messages. Segments are deleted once every subscription has acknowledged them and no retention setting needs them.
Metadata store. A PostgreSQL database (Cloud SQL on GKE) with topics, subscriptions, the segment index, each subscription’s acknowledgement position and which pod serves what. It holds no message data.
Tail cache. Recent messages each pod keeps in memory, so subscribers that keep up read from memory rather than Cloud Storage.
Shard. A subscription is split into shards, 8 per zone by default. A zone’s shards cover only the messages published in that zone, ordering-key messages included. Each shard is served by one pod at a time, which holds a lease on it in the metadata store. The pods in a zone that have consumers attached share that zone’s shards. A consumer connected to a pod without a shard is proxied to one that has it, in its own zone when there is one.
Ordering lane. Messages with an ordering key go to one of 64 lanes, each owned by one pod, so all messages for a key land in one stream in order, whichever pod the publisher reached.
Delivery
Section titled “Delivery”Zone-local delivery. Consumers in a zone receive the messages published in that zone, so delivery normally never crosses zones. Two cases move a zone’s shards to the other zone: the zone has no consumers of the subscription (fallback), or its consumers fall behind by about 5 seconds while the other zone keeps up (spill). See Cross-zone delivery.
Cross-zone path. How shards served in the other zone read their messages: Fastest, from the other zone’s pods, or Lowest cost, from Cloud Storage about 1 second later. Set per subscription with the lowtide-cross-zone label, or for the cluster in the console.
At-least-once. Like Pub/Sub, lowtide delivers every acknowledged publish at least once. A message can arrive more than once after a pod restarts, a shard moves, or an acknowledgement is lost. Consumers should tolerate duplicates.
Acknowledgement position. For each shard, lowtide records the oldest unacknowledged message and the acknowledged ranges after it, once a second. After a failover, delivery restarts from the last recorded position, so recent messages can be delivered again.
Access
Section titled “Access”Authentication mode. Off, a lowtide policy file, or Cloud IAM. See Authentication modes.
Shadow. With Cloud IAM authorization on, lowtide keeps an empty topic, subscription or snapshot with the same name in real Pub/Sub. It carries no messages. It holds the IAM policy that lowtide checks callers against. For a topic you migrated, the shadow is the original Pub/Sub topic. See Cloud IAM and shadows.
Migration
Section titled “Migration”Mirroring. While a topic moves, lowtide copies every message published to it to the Pub/Sub topic of the same name. Subscriptions still on Pub/Sub keep receiving everything. It goes in one direction only, from lowtide to Pub/Sub. See Mirroring to Pub/Sub.
Hand-over. Moving one subscription’s consumers from Pub/Sub to lowtide. lowtide starts the subscription where the Pub/Sub one stands, so no message is missed. Some arrive twice. See Hand over subscriptions.
Wave. A group of topics to move together. The assessment puts the ready topics that make up most of your Pub/Sub cost in wave 1.
lowtide Cloud
Section titled “lowtide Cloud”Console. lowtide Cloud’s web app at lowtide-516307.web.app/app. It manages clusters, installs, migrations, usage, billing and your team.
Agent. A small Deployment in your cluster. It registers the cluster, sends a heartbeat every 30 seconds and signed hourly usage records, relays the licence to the gateways, and runs migration steps you start in the console. All its connections are outbound HTTPS.
Join token. A one-time token from the console that the agent uses to register a new cluster. It is valid for 24 hours.
Licence. A signed document the agent fetches for its cluster. Gateways check it locally and report its state in metrics. The licence never affects message traffic, in any state.
Provisioner. lowtide’s service account that installs, upgrades and deletes clusters in your project when you choose lowtide sets it up. It holds only the roles you grant it.
Environment. Production or non-production. Production clusters get a highly available Cloud SQL instance and at least two gateway pods per zone.