nus-cs2103-AY2122S2 / forum

14 stars 1 forks source link

What is the difference between Transaction processing and Event driven architectural style? #296

Open yuqitanyq opened 2 years ago

yuqitanyq commented 2 years ago

Hey everyone,

I just wanted to check, what is the difference between Transaction Processing Style and Event-Driven Architectural Style? It looks like both styles are quite similar, hope that someone can clarify!

Source: CS2103T Textbook

Transaction processing style: image

Event-driven architectural style: image

ckcherry23 commented 2 years ago

Hi @yuqitanyq!

I'm not sure but I think the difference is that for Transaction Processing Architectural Style, the transactions that are sent to the dispatcher have not been executed yet so they are dispatched for processing. Whereas for Event-Driven Architectural Style, its the events that are sent to the dispatcher, so they don't have to be processed. Instead, they may act like signals to trigger some other actions.

damithc commented 2 years ago

I'm not sure but I think the difference is that for Transaction Processing Architectural Style, the transactions that are sent to the dispatcher have not been executed yet so they are dispatched for processing. Whereas for Event-Driven Architectural Style, its the events that are sent to the dispatcher, so they don't have to be processed. Instead, they may act like signals to trigger some other actions.

Good answer @ckcherry23 To add, a transaction is typically sent to a single destination (because executing a transaction multiple times can cause problems e.g., paying a merchant multiple times for the same purchase) whereas an event is typically broadcast to multiple interested parties.

yuqitanyq commented 2 years ago

Wow thank you @ckcherry23 and prof @damithc for the clarifications and inputs!! Appreciate it a lot!