Live data from Hacker News

Ask HN: Has anyone fully embraced an event-driven architecture?

news.ycombinator.com

71–80 of 173 posts

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#71
post #69
post #9

Where I currently work we are all in on event-driven architecture. For our DLQs, we have alerts on when the queue is growing in size or if messages are in the queue too long. When those alerts come in, we manually move the messages back to the normal queue for reprocessing and if they get DLQed again after that we will look into the reason it is failing. One of the benefits of this architecture for us is the ability…

Thanks for your answer, it really helps. Does moving the DLQ messages back to the normal queue mean that all consumers can deal with out-of-order scenarios?

if you're using a queue like SQS and expect it to be ordered and exactly-once, you're in for a lot of surprise. If you need ordering, use a stream/log like Kinesis or Kafka.

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#72

I'm guessing the OP meant event driven with persistent events. If the events exist only at runtime then a lot of burden related to schema evolution disappears. We tried this approach a couple of times with mixed results. In one case, for a new component with strict DDD modeling - it was a boom to productivity. In others , preexisting once we never got to realize the gains, invested quite a bit , not sure if we ever g…

You are right, that's what I was referring to.

I have seen DDD working sufficiently well for some use-cases but issues started appearing when the business redefined what the domains are and how the org is structured. I guess there is not a single straight-forward solution to this.

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#73
post #11

The overhead with this architecture can be cumbersome. Which is why most successful deployments of it tend to be with teams that have embraced full stack serverless. Recommend exploring that community, plenty of event driven systems there.

Interesting, does serverless help with data ownership?

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#74
post #41

You're not going to like the answer, but I think it captures some of what you're getting at. Windows 95. Old style gui programming meant sitting in a loop, waiting for the next event, then handling it. You type a letter, there's a case switch, and the next character is rendered on the screen. Being able to copy a file and type at the same time was a big deal. You'd experience the dead letter queue when you moved a wi…

> Have a plan for building pipelines a->b->c->d. also have a plan for fan out a->b & a->c & a->d How does that look like? Do you mean to learn how this is done with the CI of choice, create helper functions or are there concrete steps that you would recommend? I'm new to this and would appreciate any feedback.

Let's assume a has a time constraint, and needs to start shoveling bytes back to the client in 30ms.

In the pipeline case, a probably only has visibility to b, each service in the chain has ~7ms to provide its response.

In the fan out case, a is aware of b c and d, they can each take 25ms or more and a can still meet its deadline.

The way a sets its timeouts will vary depending on what's happening downstream.

This is a pedantic and fussy point of view. Nobody really does this, some pretend they do. But it can be important for overall performance.

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#75
We definitely haven’t fully embraced an event driven architecture, but we have gone all in on it where it makes sense for us. We’re processing in the order of a billion messages a day from hardware in customer’s homes, which is probably the ideal use case for event based comms. Handling devices being offline for a while becomes much simpler when the response to that can just be queuing up events and transmitting when available.

One of the key lessons we learned was that your event ingest needs to be rock solid. Put up a service, and then make it do one thing only, receive an event and throw it onto the message bus - we do this for messages from devices, but also for 3rd party services which send us webhook notifications. If ingest fails so does everything else, don’t let that happen.

The other thing I’d say is to make sure there’s a central source of truth for what services are consuming which messages. We made the mistake early on of saying services should be responsible for setting up their own subscriptions and it’s made it much more difficult to answer questions around who’s going to be impacted by changes or outages. At a minimum have a wiki page on it. Ideally manage subscriptions in Terraform or similar.

Finally, DLQs. Typically we don’t do much with them, we have logging of messages that get pushed to the DLQ and usually it’s a non-recoverable error, often around validation or accounts being disabled. They are handy in the case of an outage though as you can just push all the messages back into the queue when things recover.

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#76
post #42

You seem to have conflated two things here - do event-driven architectures work at all, and has anyone "fully embraced" it. It doesn't have to be "fully embraced" to be successful. I started going down this rabbit hole a year ago (see the many good replies to this https://twitter.com/swyx/status/1241482183472295939?s=20 ) and most people feel it is "hard to reason about", which often seems code for unfamiliar. What I…

> do event-driven architectures work at all, and has anyone "fully embraced" it. It doesn't have to be "fully embraced" to be successful.

For context, I've seen successful event-driven architecture implementations when it comes to data ingestion for analytics/ML purposes.

What I have yet to see is a successful implementation of microservices using local state stores built by joining streams owned by multiple domains. That's where the (arbitrary) "fully embraced" term came from.

Does everyone implement the outbox pattern themselves? Or treat their streams as the only source of truth, materialising the state that is already embedded in them?

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#77
post #66

Like others have said, it is just one tool in the tool box. We used Kafka for event-driven micro services quite a bit at Uber. I lead the team that owned schemas on Kafka there for a while. We just did not accept breaking schema changes within the topic. Same as you would expect from any other public-facing API. We also didnt allow multiplexing the topic with multiple schemas. This wasn’t just because it made my life…

Thanks for your detailed answer, really appreciate it. Two follow up questions if you don't mind me asking, even though I understand you were not on the publishing side: 1. Do you know if changes in the org structure (e.g. when uber was growing fast and - I guess - new teams/product were created and existing teams/products were split) had significant effect on the schemas that had been published since then? For examp…

I am not the author of the original message, however, I also recommend "Building microservices 2nd edition" if you are trying to answer such questions

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#78
post #30

Yes - I work in an investment bank, we try to do millisecond-level latencies for our order management system that sends client orders to the various exchanges(for sub-milli we use FPGA but it's very expensive and only for some clients). It works alright (like you I hated it all before, coming from more amateurish implementations). It's slow to change (adding a new event type can take years before it works everywhere)…

Hey thanks for you answer, this is pretty informative.

I am basically where you began i.e don't really know what an actual event driven system actually looks like(as in something implemented properly).

1. Could you please tell me what according to you was a major difference between the more amateurish implementation vs the proper implementation(I know this is quite a general question to ask, sorry about that).

2. Since you've seen what proper looks like when it comes to event driven architecture, can you perhaps suggest some resource(could be a book, could be code base) which according to you is the closest someone can get to understanding how a proper event driven system would be implemented.

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#79
post #69

Earlier quoted context omitted.

Thanks for your answer, it really helps. Does moving the DLQ messages back to the normal queue mean that all consumers can deal with out-of-order scenarios?

if you're using a queue like SQS and expect it to be ordered and exactly-once, you're in for a lot of surprise. If you need ordering, use a stream/log like Kinesis or Kafka.

Exactly-once is not a requirement but ordering is. I had Kafka and Kinesis in mind when writing this question but just in case you haven't seen it, there is a way to get ordering guarantees using SNS and SQS:

https://aws.amazon.com/about-aws/whats-new/2020/10/amazon-sn...

Re: Ask HN: Has anyone fully embraced an event-driven architecture?

#80
post #19

Got a list of books for reference?

* Designing Data-Intensive Applications

* Monolith to Microservices

* Streaming Systems

* Designing Distributed Systems

* Building Event-Driven Microservices

* Kafka-Streams in Action

A comment in this post also suggests "Building Microservices" but haven't read it.

Post reply on HN