r/programming • • Aug 15 '22

Event Driven Architecture — 5 Pitfalls to Avoid

https://medium.com/wix-engineering/event-driven-architecture-5-pitfalls-to-avoid-b3ebf885bdb1
57 Upvotes

46 comments sorted by

62

u/drinkingsomuchcoffee Aug 15 '22

At Wix we have been gradually migrating our growing set of microservices (currently at 2300)

Jesus Christ

18

u/Qizot Aug 15 '22

In other article from 2021 they said they had 1500. What can happen in a year?

2

u/natan-sil Aug 15 '22

Tremendous growth and added support for open-platform concepts

21

u/L3tum Aug 15 '22

Some people go nuts. We have a team here that's developed 20 different services that are all basically doing the same but with slightly different applications. Like one service handles data X from service A, while another service handles data X from service B, But they're also slightly different so anyone who has to consume the data needs to implement a dozen different things.

4

u/Zardotab Aug 15 '22 edited Aug 15 '22

A Buzzword Engine that empowers resumes, but not real projects. The vast majority of in-house things people claim microservices improve could be more easily done with stored procedures. Your apps probably already use an RDBMS so you don't have to hook in new communication layers to use stored procedures, and you get A.C.I.D. compliance without reinventing a database, something microservices can struggle with. If your product is cat videos, it may not matter if you lose a few pussies🐈, but for important products it matters.

Warning, rant ahead...

I get pissed when youngbies reinvent true and tried shit to chase fads. My git-off-my-lawn finger bigly twitches when I see that shit. Being a Bullshit Cop is not popular, but necessary. It's why companies like to fire old people: they know what's really going on. Sticking fads in your wares may attract new hires, but makes for shitty software.

7

u/[deleted] Aug 15 '22

ACID is dead. We use a NoSql B.A.S.Ed db with a native GraphQL layer on top. Our shit is literally on fire!

→ More replies (4)
→ More replies (8)

3

u/natan-sil Aug 15 '22

Wix hosts and renders more than 100 million websites, with complete back-office/business solutions as well and an open platform for plugins. with many different verticals (e.g. stores, restaurants, hotels, events, photography). It's a huge production eco-system

22

u/Hnnnnnn Aug 15 '22

They implemented a better service discovery. We are still discovering new species of animals too.

3

u/thruster_fuel69 Aug 15 '22

You'd need top shelf discovery to sift through all the duplicate data 😂😭

4

u/Zardotab Aug 15 '22

DRY is old school, outsource to Timbuctoo such that mass repetition is cheap. Who cares if it makes long-term maintenance difficult, we'll sell the company to a bigger sucker by then, taking the money and running to Fiji before they discover they have a giant wad of tangled sh$t.

→ More replies (1)

2

u/Zardotab Aug 15 '22 edited Aug 15 '22

Bet I could write a Wix clone that uses less than 2300 functions. Meta-tize niche-market interfaces so you don't have to keep re-coding the wheel.

2

u/bwainfweeze Aug 15 '22

Jesus had nothing to do with this mate. I think you’re looking for another god. Possibly Loki.

1

u/efvie Aug 16 '22

Could you explain why a given number of microservices is, if I assume correctly, a problem to you?

12

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?

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:

→ More replies (1)

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

u/natan-sil Aug 16 '22

Thanks for the comment! I agree it's critical

5

u/[deleted] 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

u/natan-sil Aug 21 '22

Sure. I'm writing your request down :)

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

u/ssmihailovitch Aug 16 '22

Great article!