3

Event-Driven Architecture 101

 1 year ago
source link: https://blog.bitsrc.io/the-idea-behind-event-driven-architecture-a7236351fe61
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Event-Driven Architecture 101

The basic concepts of EDA: events, event sourcing & CQRS, streaming, logging & monitoring, and implementation strategies

0*mLJYro2HyhGmYF-r

Photo by Sigmund on Unsplash

Event-Driven Architecture (EDA) is a trending software architecture pattern nowadays. Many organizations and systems adopt this pattern due to its scalability and flexibility. Let’s discuss the basics of events, event sourcing & CQRS, streaming, logging & monitoring and implementation strategies through this article.

Events

This is the cornerstone of event-driven architecture. The EDA has evolved from microservice architecture while it replaces legacy architectures such as monolith and SOA. The classic communication between services is command and query. The services either send commands or queries for data.

💡 Treating microservices as composable building blocks is key, and it’s made easier with a tool like Bit which allows your teams to independently publish, version, document, test, and share individual components such as functions, UI elements, or data models, that can be reused across multiple microservices.

Learn more here:

1*MUcDhKVFGN6gK6bE-fwuFQ.png

Command and Query

The main characteristics of this communication are

1*_jnNtihI7_6wmoecmg27Hg.png

There are 3 main problems with command and query,

  • Performance: Due to the synchronous nature
  • Coupling: The calling service calls a specific service
  • Scalability: The calling service calls a single instance of a service

These drawbacks can be overcome by using events. Event indicates that something happened in the system. The main features of event are

  • Asynchronous
  • Calling service has no idea who handles the event
  • Never returns a response
  • Something happened

There are two types of event data, complete and pointer.

1*fookiMrMF-4Nb0-qeMJrOQ.png

Complete is the better approach since it makes the event completely autonomous while pointer can be used for large sets of data.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK