TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: When should event-driven architecture be avoided?

23 点作者 reisr3超过 3 年前
There are plenty of good resources for how to do domain-driven design, microservices, cloud functions, and event-driven architecture. I understand why these paradigms are useful for rapidly scaling an application. Queueing, the ability to adjust resources per service, and enabling separate teams to build their microservice differently.<p>However, they also add quite a bit of complexity. Using pub&#x2F;sub breaks execution context, cloud functions are difficult to debug&#x2F;test&#x2F;develop locally, etc. I&#x27;m having trouble finding quality dissenting opinions online around this topic. Most resources I&#x27;ve found are geared towards how to implement these technologies properly.<p>In what scenarios would you NOT recommend event-driven architecture?

8 条评论

diatone超过 3 年前
No concurrency? No events. No more than a single team running a single service (even a monolith)? No events. Not dealing with asynchronous 3rd party APIs (eg: webhooks)? No events. Not dealing with arbitrarily many hosts&#x2F;processes&#x2F;tasks&#x2F;objects communicating with each other, potentially asynchronously? No events. Not streaming? No events.
评论 #30206908 未加载
osivertsson超过 3 年前
The customer couldn’t care less, so if you can deliver without all that complexity congrats!<p>That means you either have time to focus more on your customers, and therefore win more business, or you just take home more money if it is fixed-income contract work.<p>I consider companies that add complexity just because BigTechCo does more interested in playing or pretending to be on a path towards success than to actually be.
sfrensch超过 3 年前
I think the move to events makes sense once you want to start decoupling systems, so there is a scale&#x2F;complexity aspect to it. Situations where you would steer clear of events, would be those where you don&#x27;t care to have the benefit of decoupling.<p>As an example, imagine a small system where a user changes their email address. In the beginning you might only have one action &quot;update database&quot;. As the system grows, maybe new teams start to add new features triggered from that event, say &quot;send confirmation email&quot;, &quot;calculate fraud score&quot;, &quot;send new email to marketing vendor&quot;. You could just go and call all those APIs, but at some point you want to emit a &quot;change email event&quot; and just let the other systems do with it what they will.
评论 #30206969 未加载
sorokod超过 3 年前
When unrestricted, event driven systems don&#x27;t have a well defined overall state or consistency.<p>Avoid if you have rules that depend on a system &quot;state&quot;<p>Having said that, toy systems aside, almost all systems require reasoning of their overall state at some point, so in general - avoid.
评论 #30207703 未加载
bjourne超过 3 年前
Event-driven models work great when you have problems that can be modeled as series or sets of reply&#x2F;response events or cycles. It does not work great when your problem is stateful, when minimum latency is important, when your problem is essentially one reply&#x2F;response cycle or naturally sequential. The internals of a 3d engine should probably not be event-driven (the api might be, however). A program for listing files in a directory should also probably not be event-driven. Nor a program for computing solutions to differential equations. A text editor definitely should be event-driven.<p>That said, IME, event-driven architectures are more often than not the right choice for complex software. It&#x27;s just a very intuitive way to model software.
slively超过 3 年前
I tend to think of it the same way I think of moving to an eventually consistent database. You do it when you have to, and as little as possible.<p>You correctly identified the overhead of these approaches is massive and has implications bigger than the software. The impact on developers cannot be understated.<p>The approaches you listed are useful, and the dissent I have isn’t so much on the approach, as the timing of when it gets used. Tons of software will never need its benefits and shouldn’t pay the tax ever. Paying the tax before you have to is very rarely worth it in my experience.
pestatije超过 3 年前
It shouldn´t. The way to proceed is to overcome its drawbacks. The world is async, do not fight it.
freemint超过 3 年前
When doing the necessary communication to solve PDEs numerically on multiple nodes.