r/programming • u/natan-sil • Aug 15 '22
Event Driven Architecture — 5 Pitfalls to Avoid
https://medium.com/wix-engineering/event-driven-architecture-5-pitfalls-to-avoid-b3ebf885bdb112
u/ultimatewooderz Aug 15 '22
Point one is solved with the outbox pattern I'd have thought?
2
u/natan-sil Aug 15 '22
That's a good point, but we don't use the outbox pattern at Wix
3
u/ultimatewooderz Aug 15 '22
Interesting, how come? A reason against it, or just how it was?
→ More replies (1)1
u/natan-sil Aug 15 '22
I think that for most cases resiliency offered by Greyhound Producer was "good enough", and otherwise CDC will be used
3
u/ultimatewooderz Aug 15 '22
Greyhound is bespoke though right? My question was why create Greyhound when the pattern exists, and you can do with a simple transactional insert?
Genuinely curious!
1
u/natan-sil Aug 16 '22
greyhound offers much more than just resilient event producing. it's partly open-sourced as well.
you can read about it here:5
u/hibernatingpanda Aug 15 '22
Agreed. Not sure why they didn't mention this solution - it seems way more obvious and universal.
6
u/bwainfweeze Aug 15 '22
3 No Context Propagation
This should be number 1 on any list, unless the list also contains something about emergent behavior. Event systems are perfect for building Rube Goldberg machines. They are a large semi domesticated animal and if you don’t respect them every minute of every day they will trample you.
1
5
Aug 15 '22
From TFA - "Event driven architecture is very powerful and well suited for a distributed microservices environment. By introducing a broker intermediary, event driven architecture offers a decoupled architecture, easier scalability, and a much higher degree of resiliency."
Sounds like they stumbled onto Win32 and the message pump.
1
u/natan-sil Aug 16 '22
Thank you for the comment!
Insights that are obvious to some may not be for others.
5
u/Mario_x9 Aug 15 '22
I wonder how do you manage such amount of services, do you have some sort of developer platform, etc. I mean how do you store documentation, practical dev knowledge about services, manage services (ownerships, health).
And foremost how do you manage/document dependencies between services so you do not get lost about interactions. I mean mostly how do you track events flow and events relation between services (consumer and producers relations)
3
u/natan-sil Aug 16 '22
Indeed that's a very good point.
We do have a developer platform with very extensive documentation (also for external developers of our open platform). most of it is generated automatically from the protobuf definitions that are used both for gRPC and Kafka interactions.regarding tracing, like I wrote in the article, we have automatic context propagation which allows us to expose this information to prometheus and present it in grafana (search via request id or user id, etc...)
3
u/Mario_x9 Aug 16 '22
Thanks, really nice article.
I would love to read more how do you manage all that at Wix in future, how and what you document services, how do you manage with cognitive load and productivity of devs due to architecture complexity, ownership problems, etc. I faced a problem that when business scales and number of services rises the problem with productivity, documentation, service management, knowledge, etc. became a big deal, even new team member onboarding seems to be quite complicated.
1
2
u/RabidKotlinFanatic Aug 15 '22
I'm interested to know how Greyhound solves the atomicity problem without tailing the binlog or an outbox table in transaction context. What happens in the event of a crash/kill/restart or S3 being unavailable?
2
u/natan-sil Aug 15 '22
Thank you for the great question!
Greyhound does not solve the atomicity problem 100%, it mitigates it. but for real world scenarios the fallback is almost always enough.
2
u/nagonigi Aug 15 '22
Great read! Definitely hitting the nail on the head with some of these issues, and providing nice overviews of multiple potential solutions. Very cool.
1
62
u/drinkingsomuchcoffee Aug 15 '22
Jesus Christ