It's 2021, and we're in the heyday of SaaS. As the SaaS economy has grown, so has the need for these services to communicate events to eachoth

How to Build a Webhook System in Rails Using Sidekiq

submited by
Style Pass
2021-06-16 13:30:07

It's 2021, and we're in the heyday of SaaS. As the SaaS economy has grown, so has the need for these services to communicate events to eachother asynchronously. Complex business logic can often span across both internal and external services, and one way external communication is accomplished is with a design pattern called "webhooks."

If you've ever integrated with an API service such as Stripe, you're probably well aware of what a webhook is. For Stripe, events like customer.created and invoice.* are table-stakes for many businesses. (At least they are for ours.)

Many other services, and even our own API, send webhooks for important events. There are even entire businesses built on the concept of webhooks.

Suffice it to say — webhooks are here to stay. They've gone from nice-to-have to must-have for any sort of API-based SaaS.

There are a number of webhooks-as-a-service options out there, such as YC-backed Svix. But much to my dismay, none of these existed back when I started Keygen, so I figured I'd share the knowledge on how I've built mine over the years.

Leave a Comment