"Google-Pubsub"
- AWS SQS → Google Pub/Sub:queue 模型搬到 topic + subscription 模型的跨雲遷移
SQS 是單一 region-scoped pull queue、Pub/Sub 是 global topic + first-class subscription 的 pub/sub 模型;這篇跨雲 migration playbook 走 6 維 diff dimension audit(components / data topology 軸 High)、對位 visibility timeout → ack deadline、maxReceiveCount → dead-letter topic、long polling → streaming pull、IAM policy → Service Account、SQS-to-many-consumer 要重設計成 topic fan-out;含 5 個 production 故障演練(fan-out 行為差 / ack deadline 太短重投 / ordering key vs FIFO / 跨雲網路成本 / DLT 設定差)跟 dual-publish 漸進 cutover
- Google Pub/Sub push vs pull:不是實作偏好,是下游容量的判讀
Pub/Sub 的 push 與 pull subscription 常被當成實作偏好二選一,但它其實是一個容量判讀:push 把流量瞬間打到 endpoint,pull 讓 consumer 自己節流。下游有 RPS 限制就只能 pull。本文展開 subscription 模型、ack deadline、flow control 與 dead-letter topic,5 個把 push/pull 與 ack deadline 寫成下游打爆與重投的 production 踩坑
- Pub/Sub Ordering Key、Dead-Letter Topic 與 Schema Enforcement:三道交付治理
Pub/Sub overview 之下的 implementation-layer deep article — 把 ordering key 的有序代價、dead-letter topic 的 poison message 隔離、schema enforcement 的契約守門三件事寫到可操作:subscription 是 first-class、ackDeadline 與 extension、push vs pull vs streaming pull + flow control、Avro / Protobuf schema、Pub/Sub Lite 與標準版差異、BigQuery / Cloud Storage subscription,含 5 個 production 故障演練(ordering 限流 / ack deadline 太短重投 / DLT max delivery attempts / push 500 retry storm / schema 擋下不相容 publish)
- Kafka → Google Cloud Pub/Sub:從 partition 到 topic-subscription 的模型轉換
從 Apache Kafka 遷移到 Google Cloud Pub/Sub,處理 partition → topic 模型轉換、ordering 語意差異、consumer group → subscription 對應、offset → ack deadline 切換的階段化流程
- 3.C60 Spotify:Event Delivery 從 Kafka 遷到 Pub/Sub
Spotify 全球 event delivery 從 Kafka 遷到 Pub/Sub、~2500 VM、Q1 2019 8M events/s、350TB/day raw、自建 dedup。
- 3.C61 Spotify:Autoscaling Pub/Sub consumer 反效果
Spotify 下游失敗時 consumer 不 ack 仍耗 CPU、autoscaling 越拉越高、解法是 exponential backoff 抑制 CPU。
- 3.C62 Spotify:Pub/Sub → GCS reliable export
Spotify 用 Oldest Unacknowledged Message metric 判斷 hourly bucket 何時可安全關閉、ack 綁定下游 commit。
- 3.C63 Mercari Actionable History:ack deadline 是 batch-level
Merpay 支付流水帳用 Pub/Sub、ack deadline 是整批 batch 而非單訊息、acked 訊息會跟同批 expired 一起 redeliver。
- 3.C64 Mercari Item Feed:DLT 防 poison message 阻塞
Mercari 商品 feed 同步、ack 整批 / nack 重送、重試多次仍失敗送 DLT、topic 同時當 load-leveling buffer。
- 3.C65 Mercari LINE:Pull subscription 對齊外部 RPS
Mercari LINE webhook 轉 Pub/Sub、worker pull subscription 精確控制 RPS、應 LINE API 限制。
- 3.C66 Mercari B2C:自建 PubSub gRPC Pusher
Mercari 全球商品同步、原生 HTTP push 在「長 job + 高吞吐 + 動態 RPS」場景受限、自建 gRPC 版 push。
- 3.C67 Niantic Pokémon GO:Pub/Sub 當 telemetry ingest
Pokémon GO frontend publish 玩家事件、~1M TPS、Pub/Sub elastic buffer、下游 BigQuery streaming。
- 3.C68 Wix:Pub/Sub decouple + Dataflow + BQ archive
Wix App Engine 收 clickstream 進 Pub/Sub、Dataflow 進 Datastore < 100ms、BigQuery 並行存 raw recovery。
- 3.C69 Twitter Ad Engagement:把 stream 切成多 topic 做 partition
Twitter 把 80K msg/s stream 切成 6 個 topic 做 partition、Avro schema、Beam/Dataflow → Bigtable/BQ。