117 points · by tasn · 5y ago · 63 comments
Webhooks are how servers notify each other of events, so they are a key component of many APIs such as Stripe, Shopify, Slack, Dropbox and Github. They look easy to implement (just a POST request), but they come with a variety of challenges. For example, customer endpoints fail or hang much more often than you would think, so you would need to implement retries. You need to make sure such failures don't clog your send queue or the rest of your system. The webhook system is an additional system separate from your normal web server that needs to be scaled and monitored separately. There are also a variety of security implications such as SSRF, replay attacks, and attackers sending fake webhooks to your customers (so make sure to sign the payload and make it easy to verify!). You also want to avoid overloading your users' endpoints, so you want to automatically rate-limit webhook sending, as well as disabling failing ones, and notifying your users when you do.
I encountered these challenges at my previous company. Our users were constantly asking us for webhooks, but we kept deferring building them because we weren't willing to commit the engineering time, resources, and ongoing maintenance required of a webhook delivery system. This was the seed for Svix, but it's only after a friend of mine asked about adding webhooks to her own product that I realized "Oh, there's maybe a business here".
The idea behind Svix is to make it very easy for everyone to send webhooks. Developers make one API call and we take care of deliverability, monitoring, and retries. We also have a pre-built management UI that our customers can offer their users to manage their webhook endpoints, as well as inspect, debug, and replay failures. This is in addition to a variety of tools, libraries, and tutorials to make both sending and consuming webhooks easy.
We have previously done a Show HN (https://news.ycombinator.com/item?id=26399672) and got a lot of great feedback from the community. A lot has changed since then, for example, we now have libraries for Python, JavaScript (TypeScript), Java and Go; a first version of the Ruby and PHP libraries, and a CLI for interacting with the service. We have improved the management UI, made it easy to embed it in an iframe, and improved the onboarding and documentation to make it even easier to get started. And finally, we have scaled the backend to keep up with the growing needs of our customers. We have a lot more planned for the coming months, and we've grown the team so improvements are going to come at an even higher pace.
One of the common questions from our Show HN was: "Don't developers need to handle deliverability and retries to Svix?" Deliverability to user endpoints (servers) is very different to deliverability to Svix. User endpoints fail all the time and for various reasons, and each of them can fail independently. This means developers need a robust and scalable delivery system that can deal with failures on an ongoing basis. With Svix, outages are rare, and are dealt with as incidents, the same way you would with SendGrid, Twilio and other API providers.
Our goal with Svix is to make it easier for developers to add webhooks to their service. Webhooks make APIs that much more useful and enable a lot of automations and integrations which benefit both the products offering them, and the communities around them. Just think of all the cool Slack bots made possible thanks to webhooks. I'd really love to see every service out there offering a great API!
I'd love to hear about your experience building (or using) webhooks systems. What's a must have? Any war stories to share? Got any questions? Suggestions? Please let me know!
Docs: https://docs.svix.com/
Docs for consuming webhooks: https://docs.svix.com/receiving/introduction
API viewer (and OpenAPI specs): https://api.svix.com/docs/
IMHO you're competing with some fairly simple code built on fairly simple queues that can handle loads of traffic at $5/mo after the build (it took us like 24 hours) and it's tightly integrated to our own app - so those retries/errors are visible.
I'm not clear on where the value is here. I drop my home brew then rework systems to your APIs to get back to baseline. Then what? I hit monthly cost parity at 15k messages a month. But at 20k messages it's $10/mo and goes up - it looks like I'd be over $50/mo on the platform quickly. Maybe I just don't see the Killer Feature here.
1. You spent hours building a small Go tool, assuming your hour is worth at least a $100 (certainly more) and say you spent 5 hours, that's $500. 2. You deployed it on a VM, that's $5 a month 3. You need to keep it updated and manage it, so let's say you spend 1 hour a month. That's a $100 a month.
So right now you spent $500 upfront, and $105 a month to keep it going, and that's assuming 1 hour a month which is crazy low.
You can replace that entire cost with a static Y x 0.001 + what ever up front cost to convert the system to use Svix, which can be factored into the system cost. I have 50,000 users, each user has 1 webhook I need 50,000 x average number of messages a month. Just add that on top of the system monthly cost.
It's a lot easier to manage from a business/accounting point of view a SAAS then your own homebrew.
It's not like you're going to integrate some service into your app in 0 hours.
It's also not like you won't have to spend some time maintaining your integration either.
IMO, a "killer feature" for a business is not /maybe/ saving $100 a month under low usage, and /maybe/ costing you $1k+ under high usage...
All of this assumes you know what you are doing and can just write the code. It doesn't even take into account the research you need to do to make sure you cover all of the security (and other) consideration that GP seemed to have already known about and took care of.
Hmm I would have to disagree here. This is something that most platform teams could build, deploy and forget about. Setting up an account, getting procurement to pay for it, not being able to see why it’s down etc just seems like a lot more hassle.
I'm not, to be clear, expressing an opinion that the business will be successful with that strategy or that I think it's a good trend. On the contrary, this overall trend of feature-x-as-a-service products depresses me a bit. We've gone from the old days when you had to write pretty much everything yourself (which sucked), to the days when there were a ton of feature-x-as-library choices (which was way better but led to complaints of web programming becoming a chore of just bolting libraries together), to the current trend of feature-x-as-service products.
It's a logical evolution in some ways - similar to libraries over roll-your-own, it reduces your own set of responsibilities. But it also reduces your ability to learn (e.g. from reading source) or grow beyond the provided service (much harder to swap out providers or roll-your-own when the current solution is a third party black box). It also feels depressing in that we've gone from a thriving ecosystem of software based on open source to a much more capitalism-first ecosystem of "this could be a library but then how would I make money off of it". (I realize open source funding & maintainer compensation/sanity is its own set of problems. I just wish we could work on those issues without turning everything into a product.)
This might be a simple service, but this is one less thing to worry about
Not easy to use this service when you need follow all kinds of regulation and the GDPR
On a side note, I have lately started seeing various companies graduating from YC that make me question whether they are product or feature. Not sure what the strategy behind them is. Either they end up going on product hunt, get a decent upvotes and then kind of disappear or are in space that slowly starts seeing other people replicate that.
In devtool space, I have seen YC invest in companies that pretty much do the same thing. In my opinion, it is not fair for the operators of a startup if you have a backer that backs your competitor too as it dilutes your orgs value.
Developer time and focus is a scarce resource, and you want to invest it in moving the needle for you business, not reinventing the wheel. Especially when the wheel is actually harder than it first seems.
I can't attest to the YC investment strategy or the whole "product vs feature" trend you are witnessing. Though I think what you are seeing is more of a trend in the industry towards not reinventing the wheel and using external services for many things (e.g. Auth0) rather than a trend led by YC/VCs.
But I think beyond that it is, if you go to larger orgs, if you have engineers who can't write services/client implementations like this. Then you have made bad hires. Don't get me wrong, it is my opinion that you need more defensibility in the product.
I do not think it is re-inventing the wheel, you are abstracting the wheel for me, because now I have to implement your client. If you take a step back and objectively look at it, your product is service-of-a-service, which I think is a problematic approach.
On your comparison with Auth0, it is very naive to generalise that argument. You have to look at them in isolation. At the time, when Auth0 came into existance, state of security was bad. In general, multi-factor authentication, machine-to-machine authentication, implementing oauth/oauth2 correctly was a really big pain in the industry. I can actually bet you that only a handful of engineer even today can do it right and cost of doing it wrong is much higher.
Our POV from when we built ours, if it helps: delivery must be reliable, we need visibility on every delivery attempt (status code, response body and headers), some control in retry logic, must be able to add headers (in our case we add a signature), must be replayable if needed, every attempt must have a unique ID, and must be able to send callbacks as a webhook back to our API. Good luck and congrats for being accepted at YC.
Anyways -- I think really nailing API uptime is going to be critical for a service like this, to reduce the chance of having to do queuing on the customer's end to replay failed requests to Svix. That's one of my big concerns at first glance. Some of the webhooks I send are table-stakes for many customers.
Yeah, API uptime is crucial (and we spend a lot of time on just that). Though I think it's not just for us, but rather for almost all of the external APIs and services out there!
What does latency look like on delivering webhooks? From the time your service is hit, to the time when the webhook is sent?
My primary use case is that I don't want my end user(s) to know the IP address of my core application.
But, the option to pay someone other than AWS/GoogleCloud and then have to write my own lambdas is also a plus.
Something similar, but for "fetch metadata on this URL" (tags, description, title, etc), version 2 of that being support for when the end target is an SPA, or also a "take a screenshot of this URL" would also be nice.
Happy to discuss more if you want.
The devil is in the details
You're conflating low level plumbing with a ready-to-go, multi tenant feature.
This means that in a naive implementation, unless you run as many parallel workers as there are messages in the queue, someone will block someone else from delivering. Depending on your latency requirements, this might not be acceptable.
Making delivery truly parallel — that is, each distinct receiver should not block anyone else, no matter how slow or failure-prone they are — and low latency is a bit more tricky, essentially requiring one logical queue per webhook.
You can solve it in various ways, depending on what solution (Kafka, NATS/JetStream, Pulsar, Google Pub/Sub, etc.) you choose, but as far as I know, nobody provides this out of the box. In particular, one-queue-per-webhook requires worker coordination in a way that classical pub/sub doesn't — after all, you don't want to run one worker per webhook if they're not all full of pending messages — and some systems don't scale to many queues very well (e.g. Google Pub/Sub has a hard limit of 10,000 topics per project).
Retrying can also pose some challenges. What if the webhook has been down for days? Do you still keep messages in the queue, or do you throw them away? If the webhook comes up, do you prioritize new deliveries or do you mix in the old ones? How do keep track of this so that you can alert the webhook owner about the flakiness?
As the other poster says, the devil is in the details. It's all solveable, but nine times out of then, I personally prefer having something off-the-shelf that's been built once, rather than building it from scratch every time.
> Deliverability to user endpoints (servers) is very different to deliverability to Svix. User endpoints fail all the time and for various reasons, and each of them can fail independently. This means developers need a robust and scalable delivery system that can deal with failures on an ongoing basis. While with Svix, outages are rare, and are dealt with as incidents. The same way you would with SendGrid, Twilio and other API providers.