HN
Today

The Valley of Webhooks

This post meticulously dissects the silent architectural debt incurred by misusing webhooks for state synchronization, highlighting their fundamental inadequacy for data replication. It proposes SCROLL, a log-based, pull-oriented protocol, as a superior alternative. The Hacker News community strongly resonates with these well-articulated struggles, sparking a rich discussion on existing workarounds, alternative solutions, and the perennial challenge of adopting new standards in a deeply entrenched ecosystem.

113
Score
51
Comments
#7
Highest Rank
9h
on Front Page
First Seen
Aug 5, 4:00 PM
Last Seen
Aug 6, 12:00 AM
Rank Over Time
13127121213151623

The Lowdown

The author, weli, shares a recurring nightmare: building the same complex system three times to keep local data in sync with an external provider via webhooks. What starts as a simple endpoint quickly balloons into a sprawling architecture of signature verification, deduplication, event buffering, bootstrap importers, and a dreaded 3 a.m. reconciliation cron—a "written confession" of distrust in the replicated data.

  • Webhooks are Notifications, Not Data Transfers: The core problem, the author argues, is that webhooks are designed for simple, fire-and-forget side effects, not for reliable state synchronization. They lack critical properties like guaranteed order, completeness, bootstrap capabilities, and verifiability.
  • The "Valley of Webhooks": This misuse creates a "local optimum" where engineers pour excellent effort into complex mitigations (e.g., Svix, Hookdeck, AWS EventBridge pipelines, local tunnels) instead of seeking a more fundamentally sound approach.
  • The Log Escapes: Paradoxically, the ordered, complete data log already exists within the providers (e.g., Stripe's Events API, WorkOS Events API), yet is often shredded into unreliable webhook notifications.
  • Introducing SCROLL: The author proposes SCROLL (Synchronized Change Replication Over Line Logs), a new, pull-based protocol that exposes an ordered, cursor-paginated change log. This allows consumers to reliably bootstrap, resume, and verify their local replicas, eliminating much of the current webhook-related complexity.
  • Benefits of SCROLL: This approach removes the need for dedup tables, ordering buffers, bootstrap importers, and the notorious reconciliation cron, offering a verifiable, simpler sync mechanism.

The article concludes by acknowledging the significant challenge of widespread adoption for a new protocol, but offers SCROLL as a precise, concrete design to spark critical discussion and identify where current approaches fall short.

The Gossip

SCROLL's Skeptical Scrutiny

Many commenters acknowledge the problem but raise practical concerns about SCROLL's proposed solution. Doubts include the efficiency of persistent connections for all consumers, the potential for increased network traffic from constant polling, and the difficulty of wide adoption for a new protocol when existing (albeit flawed) methods are ubiquitous. Alternatives like a simple paginated `/events` endpoint, with webhooks as optional 'pokes,' are suggested, and parallels are drawn to existing systems like Kafka or CouchDB replication.

Reconciliation Rules Regardless

A significant thread emphasizes that webhooks should primarily serve as 'hints' or 'pokes' to trigger reconciliation, rather than the sole source of truth. Many advocate for a robust, periodic reconciliation process (full or incremental polling) as the primary mechanism for state synchronization. This approach inherently builds resilience against webhook failures, ensuring eventual consistency and validating the author's observation about the underlying workarounds developers already implement.

The Log's Lasting Legacy

Several commenters underscore the article's core insight that the problem stems from not leveraging an ordered, append-only log. They draw connections to fundamental distributed systems concepts like accounting journals, transaction logs, and papers such as 'The Log: Real-time data's unifying abstraction.' This highlights that the architectural pattern of a verifiable log is well-established, but its application across inter-company API boundaries remains a challenge.

Provider Pain Points & Promises

Users share personal anecdotes of the frustrations caused by unreliable webhook systems, citing specific providers like QuickBooks with 'untrustworthy' APIs and WorkOS's challenges with local development and event retention. Conversely, some providers (like Svix's founder) acknowledge the issues and outline their efforts to offer more robust event streaming and synchronization mechanisms, reinforcing the industry's awareness of these problems.

LLM Authorship Allegations

A notable meta-discussion emerged about the writing style of the blog post, with several users suggesting it exhibited characteristics of LLM-generated text. While some found this 'Claudish' or 'slop' and distracting from the technical content, others defended the writing or questioned the validity of the LLM detection itself. The author even chimed in, noting minimal LLM assistance.