# Event driven architecture

## &#x20;Microservices vs Event-Driven Architecture

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2FvCUnxGi8IN9N1YpmHDzy%2FScreenshot%202022-05-03%20at%2008.56.45.png?alt=media\&token=3d9a1e80-4bea-4921-924d-518d4f662e74)

## Big picture

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2FGGsafDPXWXXTmkMHAZ5P%2FScreenshot%202022-04-29%20at%2008.59.09.png?alt=media\&token=771cf5bc-7a6f-4873-9640-8b228235264a)

### Workflow event pattern

Self-healing mechanism to programmatically fix failed transactions.

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2FWqVrRhK2qo2Xh7ggbgeU%2FScreenshot%202022-04-29%20at%2009.09.17.png?alt=media\&token=e3564a69-06ad-4fd7-9faf-cce1f7ddafde)

* :warning:**Known problem of the approach**: if the order of messages is important then this approach does not work, because while Workflow processor is trying to fix the message other messages from main queue will be processed by Trade processor. And if Workflow processor finally fixes the message it will resubmit the message to the main queue and obviously initial order of messages in main queue will be broken.

## Patterns

* [Pipes and Filters](https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html)
* [Staged event-driven architecture (SEDA)](https://github.com/mdwelsh/mdwelsh.github.io/blob/master/papers/seda-sosp01.pdf)
* [Event Sourcing](https://ibm-cloud-architecture.github.io/refarch-eda/patterns/event-sourcing/)
* [Command Query Responsibility Segregation (CQRS)](https://ibm-cloud-architecture.github.io/refarch-eda/patterns/cqrs/)
* [Saga](https://ibm-cloud-architecture.github.io/refarch-eda/patterns/saga/)
* [Stream processing](https://ibm-cloud-architecture.github.io/refarch-eda/patterns/realtime-analytics/)
* [Microservices chassis](https://microservices.io/patterns/microservice-chassis.html)
* [Dead letter queue (DLQ)](https://ibm-cloud-architecture.github.io/refarch-eda/patterns/dlq/)
