Hacker News new | ask | show | jobs
by andsbf 1328 days ago
When will people settle on the fact that there is no silver bullet? It's always a matter of trade offs according to the system needs.
1 comments

Because the very real downsides of thin events are not simple or obvious. It may be fine most of the time, but as it usually involves a "get more details" call over http or of some other kind, it has more moving parts, is therefor more prone to failures and slowdowns due to the extra coupling. This can kick in when load goes up or some other issue affects reliability, and cause cascading failure.
But it's a lot less prone to data races and other upsides so it really is contextual to your needs.

I would also push back that it has more moving parts. You'll often need to pull information and getting pushed information as well can duplicate code on both the service side and client. In practice thin events are easier to get right, despite the extra API requests.

I also think the cases where there's some kind of outage but it's an outage such that the information in the event is enough is fairly rare. I would guess it's more rare than outages that also disable event triggering anyhow.

> But it's a lot less prone to data races

What's the reasoning for that statement? My other comments have detailed cases of data races, caused by using thin events, solved by using fat events, so I'm going to push back on that: In my experience, the idea that thin events are "less prone to data races" has not been true at all, and that data race is inherent in the model of "receive an event, go back and get more data over http about it". How would you qualify this as "a lot" - how much is that lot? Citations very much needed.

> I would also push back that it has more moving parts. You'll often need to pull information

"Often" is not always. You seem to be saying that when you don't get the signature benefit of fat events (not having to pull information) ... there's no benefit. Yes, that's a tautology, and also an encouragement to further refine the design until you do get the benefit.

> I also think the cases where there's some kind of outage but it's an outage such that the information in the event is enough

Are you speaking from experience here? Doesn't seem like it. I refer you to point c) here https://news.ycombinator.com/item?id=33392655 It helps reliability to shorten the list of services that your service depends upon being 100% up and responsive.

Data races can occur with fat events because fat events don't usually store a snapshot of the entire world. They're often actually delta events, forcing the consumer to rely on caching (a racey affair) or just fall back to hitting the API anyway.

If you're having issues with thin events causing data inconsistency then the answer should be better data representation in your core API. If you had to solve it by cramming perfectly stale but self consistent data into a fat event, a better solution would be to persist such data and make it queryable, no?

But of course any way can be made to work. Any extra bit of data can be appended to the event details. Any number of separate DB and persistent queues can be maintained and backed up like the business depends on it.

In my experience thin events are just less bug prone because they're more simple. You're not worrying about stale data floating around an event queue or a client cache. You're not guessing what data the consumer needs. Having the event consumer pull data is usually a trivial cost difference.

Fat events have their advantages but I put them under premature optimization and YAGNI.

> fat events because fat events don't usually store a snapshot of the entire world. They're often actually delta events, forcing the consumer to rely on caching (a racey affair) or just fall back to hitting the API anyway.

I think you're saying "I don't like fat events because they're not really fat events", well, sorry that's your experience, I don't think that's a valid criticism of the actual thing at all, just of your poor experience of it.

> Data races can occur with fat events.. hitting the API anyway.

That happens with thin events as a matter of course, right? You stated that thin events are "lot less prone to data races" and now you're saying that they're the same? Where's the fat-event-specific issue that you alluded to? Citation not provided.

> Having the event consumer pull data is usually a trivial cost difference.

As I have stated twice before, it's a non-trivial _reliability_ difference, and that's the key.

>That happens with thin events as a matter of course, right?

No. If you send no data, what is the race? You can structure an API where there are no races. If you concede to API access the API can provide any sort of historical data necessary. The issue is with incomplete event data and assumptions around what the state was when the event was sent.

>As I have stated twice before, it's a non-trivial _reliability_ difference, and that's the key

You can state it until you're blue but the advantage _is_ usually trivial or there would be no debate. It just doesn't bite that often.

I would say the buggy and prone to rot coupling of baked in event data is a bigger concern for most.

That said, I'm making an argument about what is the best bet for dev time and it sounds like you're making an argument about what is best given infinite developer resources, an unchanging APIs, and full knowledge of what data the consumer needs.