What is Event Driven Architecture (EDA)?

IBM Technology
21 May 202112:10

Summary

TLDRIn this informative talk, Whitney from IBM's Cloud team delves into event-driven architectures, highlighting their role in enabling real-time interactions, scalable microservices, and extensible data analytics. She explains the principles of the reactive manifesto, emphasizing asynchronous messaging, scalability, and resilience in system design. Whitney illustrates how events, as immutable statements of past occurrences, facilitate targeted and conversational messaging between services, leading to a responsive and maintainable system. She further explores the benefits of event logs for triggering actions, optimizing data persistence, and supporting stream processing, all of which contribute to a robust, pluggable, and history-aware system.

Takeaways

  • šŸŒŸ Event-driven architectures are designed to enable real-time user interactions, pluggable microservices, and extensible streaming and data analytics.
  • šŸ“œ The Reactive Manifesto provides a set of guidelines for building responsive, resilient, and scalable systems through asynchronous messaging.
  • šŸ”„ Scalability in system design means the ability to expand or contract hardware usage in response to workload changes.
  • šŸ›”ļø Resilience implies the absence of single points of failure and the capacity to handle system failures gracefully.
  • šŸ“¢ Asynchronous messaging is central to the Reactive Manifesto, allowing for non-blocking communication between system components.
  • šŸ“ An event in this context is an immutable statement of fact about something that happened in the past, used for communication between services.
  • šŸ”„ Event-driven systems allow for highly scalable architectures, as the event producer is not concerned with the number of consumers.
  • šŸ—ƒļø Event logs provide a replayable history of events, enabling persistent data storage and the ability to process historical data.
  • šŸ¤– The event backbone is the central system through which all events flow, enabling various applications to produce and consume events.
  • šŸš€ Event logs can trigger actions, such as serverless functions, which can be modular pieces of code associated with specific events.
  • šŸ”§ Event-driven architectures support stream processing, allowing for real-time calculations, business rule implementation, and analytics.
  • šŸ”Œ The publish-subscribe (pub-sub) communication model is integral to event-driven systems, facilitating plug-and-play microservices that can easily integrate into the system.

Q & A

  • What is an event-driven architecture?

    -An event-driven architecture is a system design approach that relies on the production, detection, consumption of, and reaction to events. It enables real-time interactions and is highly scalable and resilient, as services react to events without direct coupling.

  • What does the reactive manifesto aim to provide in system design?

    -The reactive manifesto provides a set of community-driven guidelines intended to offer a cohesive approach to system design, emphasizing principles such as message-driven architecture, scalability, resilience, and responsiveness.

  • What are the core values of the reactive manifesto?

    -The core values of the reactive manifesto include building message-driven, asynchronous systems that are scalable, resilient, and responsive, ensuring the system can handle varying workloads and avoid single points of failure.

  • How does event-driven architecture enable real-time user interactions?

    -Event-driven architecture enables real-time user interactions by allowing systems to react instantly to events as they occur. This is achieved through the use of asynchronous messaging and the ability to trigger immediate actions in response to events.

  • What is the difference between messaging and eventing in system communication?

    -Messaging involves direct communication between services, where the sender has knowledge of the receiver. Eventing, on the other hand, involves the production of events without concern for which service is consuming them, promoting a decoupled and scalable system design.

  • Why is data persistence in event-driven architectures considered to be more permanent compared to messaging?

    -In event-driven architectures, data persistence can be more permanent because events are logged and can be stored indefinitely, depending on the system setup. This creates a replayable event log and a history of all events, unlike messaging where data persistence is often transient.

  • What is the role of the event backbone in an event-driven architecture?

    -The event backbone is the central component of an event-driven architecture through which all events flow. It facilitates the distribution of events from producers to consumers, enabling a scalable and responsive system.

  • How can event logs be utilized to optimize and customize data persistence?

    -Event logs can be used to trigger actions, update local data stores, and produce new streams of data that reflect the most current state. This allows for optimized data persistence tailored to the needs of specific services within the system.

  • What is the significance of the pub-sub communication model in event-driven architectures?

    -The pub-sub (publish-subscribe) communication model is significant in event-driven architectures as it allows for a highly pluggable system. Services can easily produce and consume events without direct coupling, promoting extensibility and scalability.

  • How does event-driven architecture support the implementation of business rules and real-time analytics?

    -Event-driven architecture supports the implementation of business rules and real-time analytics by providing a stream of events that can be processed in real-time. This enables systems to make immediate decisions based on current data and trends.

  • What is the relationship between event-driven architecture and serverless functions?

    -Event-driven architecture can trigger serverless functions, which are modular pieces of code that execute in response to events. Once the function completes its task, it can send another event back into the system, creating a reactive and efficient process flow.

Outlines

00:00

šŸŒŸ Introduction to Event-Driven Architectures

Whitney from IBM's Cloud team introduces the concept of event-driven architectures, emphasizing their role in enabling real-time interactions, pluggable microservices, and scalable data analytics. She begins with an overview of system design principles from the reactive manifesto, which advocates for asynchronous messaging, scalability, and resilience in system design. The manifesto promotes a design that is responsive, maintainable, and extensible. Whitney then explains the difference between messaging and eventing, using a retail application as an example to illustrate how eventing facilitates communication between various services without a direct dependency, leading to a highly scalable system with potential for persistent data storage and event replayability.

05:02

šŸ“” The Event Backbone and Its Capabilities

This paragraph delves into the specifics of event producers in an event-driven architecture, such as web and mobile applications, as well as IoT devices. It introduces the 'event backbone' as the central system through which all events flow. The capabilities enabled by this architecture include the triggering of actions based on events, optimization of data persistence, and the maintenance of an up-to-date inventory through local data stores. The paragraph also touches on the use of event logs for data-heavy applications like AI and the importance of a data lake for storing and accessing raw and transformed data. Additionally, it highlights the potential for stream processing using the Apache Kafka Streams API, which can facilitate real-time recommendations and analytics in applications like music streaming services.

10:08

šŸ”Œ Pub-Sub Communication and Microservices Integration

The final paragraph focuses on the pub-sub communication layer of event-driven architectures, which allows for the easy integration of microservices. It discusses the plug-and-play nature of these architectures, where new microservices can be added without disrupting existing applications. The paragraph also addresses the ability of new services to consume data from the beginning of the application's history if stream history has been preserved. This feature, along with the overall benefits of event-driven architectures, is positioned as an enhancement to the reactive manifesto's principles for system design, with eventing at its core.

Mindmap

Keywords

šŸ’”Event-driven architecture

Event-driven architecture is a programming paradigm where the flow of the program is determined by events such as user actions, sensor outputs, or messages from other programs/threads. In the context of the video, it is the core of the system design that enables real-time interactions and scalability. The script mentions how this architecture can be used to build a responsive and maintainable system that can handle various services like checkout, inventory, shipping, and contact in a retail application.

šŸ’”Reactive manifesto

The reactive manifesto is a set of principles that guide the design of reactive systems, aiming to ensure they are responsive, resilient, elastic, and message-driven. It is referenced in the script as the foundation for building systems that can adapt to varying workloads and are capable of handling failures gracefully. The video discusses how these principles are applied to create systems that are both scalable and resilient, like using Kubernetes for distributed systems.

šŸ’”Asynchronous messaging

Asynchronous messaging is a communication method where the sender of a message does not wait for a response before continuing its execution. It is a key aspect of the reactive manifesto and event-driven architecture. The script explains that this approach allows for a system design that can scale and is resilient, as it does not rely on immediate responses from other services, which is crucial for building responsive systems.

šŸ’”Scalability

Scalability refers to the ability of a system to handle a growing amount of work by adding resources or by improving the efficiency of the system. The video emphasizes the importance of scalability in system design, where the hardware can expand or contract based on the workload. This is particularly important in cloud environments and is a core principle of the reactive manifesto.

šŸ’”Resilience

Resilience in system design means the capacity of the system to recover gracefully from failures and continue to function without any single point of failure. The script discusses how this is achieved through distributed systems and Kubernetes, ensuring that if one part of the system fails, the rest can continue to operate effectively.

šŸ’”Event

In the context of the video, an event is defined as an immutable statement of fact about something that happened in the past. It is a fundamental concept in event-driven architectures, where events are used to trigger actions or reactions in the system. For example, a checkout event in a retail application would trigger updates in inventory, shipping, and contact services.

šŸ’”Event log

An event log is a record of all events that have occurred within a system. The video script mentions how event logs can be replayable, providing a history of events that can be used for various purposes, such as debugging, auditing, or restoring system state. This is a key feature of event-driven systems, allowing for persistent data storage and historical analysis.

šŸ’”Data persistence

Data persistence refers to the storage of data in a way that it can be retrieved and used even after the original process that created it has completed. In the script, it is contrasted with transient data, where data is only available for a short time. The video explains how event-driven architectures can provide permanent or possibly permanent data persistence, which is essential for system reliability and historical data analysis.

šŸ’”Pub-sub communication

Publish-subscribe communication, or pub-sub, is a messaging pattern where the sender (publisher) of information sends data without knowing who, if anyone, will receive it (subscriber). The video script uses this concept to explain how microservices can be loosely coupled in an event-driven architecture, allowing new services to be easily plugged in and consume or produce data from streams without affecting existing services.

šŸ’”Serverless function as a service

Serverless function as a service (FaaS) is a type of cloud computing service that allows users to deploy and run small pieces of code without the need to manage the underlying infrastructure. The script gives an example of how an IoT device, like a robot vacuum cleaner, can trigger a serverless function to perform a task, demonstrating the flexibility and scalability of event-driven architectures.

šŸ’”Stream processing

Stream processing is the act of performing real-time processing on data streams. The video script explains how stream processing, built on top of the Apache Kafka Streams API, can be used for real-time analytics and decision-making in applications like music streaming services or ride-sharing apps. It allows for immediate reactions to data as it is received, enhancing user experience and system efficiency.

Highlights

Event-driven architectures enable real-time user interactions, pluggable microservices, and extensible streaming and data analytics.

The reactive manifesto provides a cohesive approach to system design with guidelines for message-driven, scalable, and resilient systems.

Asynchronous messaging is a core principle for creating scalable and resilient system designs.

Distributed systems or Kubernetes are implied for scalable and resilient system design to avoid single points of failure.

Responsive systems are valued for their ability to maintain and update easily, as well as their extensibility.

An event is defined as an immutable statement of fact about something that happened in the past.

Messaging models in retail applications allow for direct communication between services like checkout, inventory, shipping, and contact.

Eventing allows for a system that is highly scalable, with the ability to expand to numerous services without affecting the producer.

Event logs provide a replayable stream history, offering a permanent or possibly permanent data persistence.

The event backbone is the central system through which all events run, enabling various applications to produce and consume events.

Event logs can trigger actions, such as spinning up a serverless function in response to an IoT device event.

Stream processing allows for real-time calculations and the implementation of business rules and policies.

Data lakes save all data that comes through the system, powering data-heavy applications like AI.

Pub-sub communication allows for pluggable microservices that can easily integrate into the system without disrupting other applications.

New microservices can consume from the beginning of the application's stream history, providing a complete context.

Event-driven architectures build on the reactive manifesto ideas, offering a responsive and message-driven system design.

Transcripts

play00:00

What are event-driven architectures? And how canĀ  they enable real-time user interactions, pluggableĀ Ā 

play00:07

microservices, and extensible streaming and dataĀ  analytics? My name is Whitney, I'm on the CloudĀ Ā 

play00:14

team here at IBM. Before I dig in on event drivenĀ  architecture, specifically I'd like to talk aboutĀ Ā 

play00:21

system design, more generally and specificallyĀ  the reactive manifesto. The reactive manifestoĀ Ā 

play00:29

is a set of community-driven guidelines that areĀ  intended to give a cohesive approach to systemsĀ Ā 

play00:35

design. So, at the core of the reactant manifestoĀ  we have, we want our system to be message driven.

play00:47

And so, specifically asynchronous messaging.

play00:55

And then also, we want our ourĀ  system design to be scalable,

play01:06

and we want it to be resilient.

play01:11

So this implies distributed systems or Kubernetes.Ā  So by scalable we mean that we want theĀ Ā 

play01:18

hardware used to expand as the workloadĀ  expands and contract as the workload contractsĀ Ā 

play01:23

and by resilient we mean we we don'tĀ  want any single point of failureĀ Ā 

play01:28

and if the system does fail we want it to be ableĀ  to tolerate tolerate that elegantly so with thisĀ Ā 

play01:34

foundation in place we should be able to build aĀ  system that is responsive responsive is the value

play01:45

on top of that we can expectĀ  a system that is maintainable

play01:53

so it means it's easy to change easy to fix a bugĀ  or do an update and we want one that is extensible

play02:05

so we should be able to expand the system easilyĀ Ā 

play02:09

so now that we have the core of what weĀ  want our systems designed to look likeĀ Ā 

play02:14

now let's talk about let's level setĀ  here and talk about like what is an eventĀ Ā 

play02:20

so an event is a statement of fact an immutableĀ  statement of fact about something that happenedĀ Ā 

play02:26

in the past so let's give that some contextĀ  we'll talk about a retail applicationĀ Ā 

play02:33

so a retail application has a checkout serviceĀ Ā 

play02:38

and that checkout service is going to wantĀ  to communicate with an inventory service

play02:47

a shipping service and a contact service

play02:55

so with the messaging model if the inventory wantsĀ  to know what the checkout is doing the checkoutĀ Ā 

play03:03

will send a message directly to inventoryĀ  to let the inventory know a checkout happenĀ Ā 

play03:08

and another one directly to shipping and directlyĀ  to contact so with messaging we have targeted

play03:14

delivery um not only that but inventoryĀ  can maybe send a message back toĀ Ā 

play03:23

checkout it can be a conversationalĀ  delivery conversational messagingĀ Ā 

play03:33

and then finally let's talk about where thatĀ  message lives before it's sent it's it'sĀ Ā 

play03:38

lives on the host service or on the producingĀ  service when it's received it lives on the umĀ Ā 

play03:45

it lives on the host service until it's receivedĀ  by the consuming service or in the case of aĀ Ā 

play03:50

message broker it might sit on a machine inĀ  between but regardless the the data persistence is

play03:56

transient

play04:03

now let's compare that to eventing so ifĀ  our checkout service is producing eventsĀ Ā 

play04:10

it's producing an event every time a checkoutĀ  happens without any concern to which serviceĀ Ā 

play04:14

is consuming that and so with that we have aĀ  system that's highly scalable so we have umĀ Ā 

play04:22

three services here interested in the checkoutĀ  but even if we expand it to a hundred servicesĀ Ā 

play04:28

listening to check out that wouldn't affectĀ  what the checkout service is doing in any wayĀ Ā 

play04:34

not only that when we have all the checkoutsĀ  in a row we come up with an event logĀ Ā 

play04:39

and it can be replayableĀ  so we have a stream historyĀ Ā 

play04:42

and a history of everything that thatĀ  every checkout event that has happened

play04:50

and then our data persistence depending on how theĀ  cluster is set up it can be set up to be immutableĀ Ā 

play04:56

it can be there forever as long as you have theĀ  physical hardware to back it up so we have umĀ Ā 

play05:01

instead of having transient data persistentĀ  so we have uh permanent or possibly permanent

play05:09

not immutable but permanent data persistence e andĀ  t um so this is the foundation of our event drivenĀ Ā 

play05:22

architecture so we have a resilient a reactiveĀ  responsive system design and then that messageĀ Ā 

play05:29

driven element is is event messaging specificallyĀ  so when we go into our proper event design theĀ Ā 

play05:38

first thing we're going to consider are our eventĀ  producers so we might have a web applicationĀ Ā 

play05:46

that produces events and weĀ  might have a a mobile application

play05:55

and let's say we also have an edge device that'sĀ  producing events so uh internet of things device

play06:02

and all of these are producingĀ  events into our system so

play06:10

so this piece of the system here thatĀ  has all the events running through itĀ Ā 

play06:15

this is called the event backbone

play06:25

so what does this system enableĀ Ā 

play06:28

well first of all we have our event logs beingĀ  produced by all the producing applications

play06:38

so the event logs can do a few things first itĀ  can trigger an action so if we have an internetĀ Ā 

play06:46

of things device let's say our internet of thingsĀ  device is a robot vacuum cleaner and when we turnĀ Ā 

play06:52

on that robot vacuum cleaner it spins up a podĀ  on the infrastructure and that pod is a functionĀ Ā 

play07:00

as a service so function as a service is a modularĀ  piece of code often associated with an edge deviceĀ Ā 

play07:06

that doesn't exist on a server on the server untilĀ  it is turned on and that's when it is spun up soĀ Ā 

play07:13

that's called serverless function as a serviceĀ  is sits on top of serverless infrastructureĀ Ā 

play07:20

but the point is that event triggers an actionĀ  of the with the robot vacuum cleaner to spin upĀ Ā 

play07:28

bounce all around the house make everythingĀ  squeaky clean and then when the function isĀ Ā 

play07:34

finished running it powers down and perhapsĀ  that'll cause our function as a service to sendĀ Ā 

play07:39

another event back into the system to letĀ  it know that the the function is completeĀ Ā 

play07:46

another cool thing about the event log is itĀ  can be used to help optimize and customize dataĀ Ā 

play07:52

persistence so if our web application is our maybeĀ  it's our retail application that we talked aboutĀ Ā 

play07:59

before and it's doing a stream of checkout eventsĀ  well our inventory service can be reading fromĀ Ā 

play08:06

that and it's keeping track of a local dataĀ  store that's keeping track of the inventoryĀ Ā 

play08:14

so our inventory service will consume fromĀ  that data stream from the web application it'llĀ Ā 

play08:22

modify the local data and then it'll produceĀ  again into the event backbone and so this newĀ Ā 

play08:29

stream is giving the most current inventoryĀ  to any other application in the system thatĀ Ā 

play08:34

wants to consume from it and so while we'reĀ  talking about data another thing that happensĀ Ā 

play08:40

we can save all of the data that comes through theĀ  system so all the raw data or all of the transformĀ Ā 

play08:46

data here at the end once it goes through theĀ  system we'll save it all in a huge data lake

play08:56

and this is what's going to powerĀ  really data-heavy applicationsĀ Ā 

play09:00

like ai for example and the data lake isĀ  accessible from anywhere in the systemĀ Ā 

play09:06

that any service that you let consume from it

play09:11

so another thing that our event-drivenĀ  architectures can enable are a stream processingĀ Ā 

play09:22

so this is built on top ofĀ  the apache kafka streams apiĀ Ā 

play09:29

so let's say that our mobile app is producingĀ  let's say it's a music streaming service andĀ Ā 

play09:37

every time let's say up until your in your wholeĀ  life up until this point you've been listening toĀ Ā 

play09:42

only miley cyrus and britney spears but today youĀ  decide you know what i want to see what jay-z isĀ Ā 

play09:48

about and you turn jay-z on well immediatelyĀ  your streaming app is showing you kanye westĀ Ā 

play09:54

and lauren hill and giving you ideas about whatĀ  you might want to listen to next so that streamĀ Ā 

play10:01

processing is a really powerful and what givesĀ  the gives real-time calculations like if it's aĀ Ā 

play10:07

ride share app you um that you know exactly howĀ  far away your ride is but it can also be used toĀ Ā 

play10:16

implement business rules and business policiesĀ  and it can be used for real-time analytics

play10:26

and then let's also talk about withĀ  our system the communications layer

play10:36

so specifically it's called pub sub communicationĀ Ā 

play10:42

for publish subscribe so we could have anyĀ  microservice a containerized microservice

play10:54

and just like we talked about before with it beingĀ  extensible we can very easily plug it into we canĀ Ā 

play11:01

write a new microservice and plug it into ourĀ  system and immediately have it start consumingĀ Ā 

play11:07

from any stream and producing to a new stream orĀ  even producing to a stream that already existsĀ Ā 

play11:13

and none of the other applications needĀ  to be concerned with it at all so it'sĀ Ā 

play11:17

highly plugable not only that but becauseĀ  of the stream history we talked about beforeĀ Ā 

play11:24

when you plug it into the system you don't haveĀ  to have it start consuming from right this momentĀ Ā 

play11:29

it can be consuming from as long as from theĀ  beginning of your application if you've beenĀ Ā 

play11:34

saving your stream history for that long soĀ  as long as that stream history persists whenĀ Ā 

play11:39

you plug in a new system it can consume fromĀ  either the old data or can be consumed fromĀ Ā 

play11:45

the present moment so with that we talked aboutĀ  the major benefits of event driven architectureĀ Ā 

play11:52

that sit on top of the reactive manifesto ideasĀ  for system design with eventing at its core

Rate This
ā˜…
ā˜…
ā˜…
ā˜…
ā˜…

5.0 / 5 (0 votes)

Related Tags
Event-DrivenSystem DesignReactive ManifestoAsynchronous MessagingScalabilityResilienceDistributed SystemsMicroservicesStreaming AnalyticsServerlessPubSub Communication