详细拆解IMAXXING如何用Temporal实现持久化工作流监控全美70mm IMAX场次,Entity Workflow模式分离用户订阅与场次监控,60秒内批量合并警报。
当《奥德赛》70mm IMAX 的 150,000 张票开售时,几乎瞬间售罄。但计划会变,退票会发生,好的座位会在奇怪的时间随机放出。
为此,Temporal 的 Andrew Baker 构建了 IMAXXING:一个监控全美所有 70mm IMAX 场次的服务,并在好座位一出现就提醒订阅者。这个原本只是周末有趣项目的想法迅速扩展,现在已有超过 9,000 名用户。
我和 Andrew 深入探讨了系统架构:持久执行如何保持长时间运行的工作流活跃,如何消减提醒以避免骚扰用户,以及 Google Cloud Run 上的无服务器工作器如何处理需求突增而不需要过度配置。
Durable execution 101: How Temporal allows you to rewind history to the point of failure.
持久执行入门:Temporal 如何允许你将历史回滚到失败点。
The Entity Workflow pattern: Why there is one persistent workflow per user subscription and separate monitoring workflows per showing across the country.
Entity Workflow 模式:为什么每个用户订阅有一个持久工作流,而全国每个场次有独立的监控工作流。
Signals & smart debouncing: How showing workflows send signals to wake up subscription workflows, and how a 60-second in-workflow timer batches multiple theater alerts into a single digest—without consuming active CPU while sleeping.
信号与智能消减:场次工作流如何发送信号来唤醒订阅工作流,以及工作流内的 60 秒定时器如何将多个影院提醒批量处理成单一摘要——在睡眠时不消耗 CPU。
Serverless workers on Cloud Run: How running Temporal workers as serverless containers lets compute autoscale directly with task queue depth rather than generic CPU metrics.
Cloud Run 上的无服务器工作器:将 Temporal 工作器作为无服务器容器运行如何让计算直接根据任务队列深度而非通用 CPU 指标自动扩展。
AI agents for ops: How modern coding agents paired with Terraform and the gcloud CLI accelerated the deployment and operational dashboard setup.
用于运维的 AI agents:现代编码 agents 如何与 Terraform 和 gcloud CLI 配合加速部署和运维仪表板的设置。
让我印象最深的一点是,持久执行从根本上改变了你对长期状态和重试的思考方式。不需要构建复杂的 cron 任务、自定义重试数据库和告警队列,工作流状态本身就是队列和定时器。
你有没有尝试过 entity workflows 或者在无服务器基础设施上运行工作流工作器?在你自己的应用中,你如何处理消减和下游 API 噪声问题?