Learning Library

← Back to Library

Event‑Driven Architecture for Reactive Systems

Key Points

  • The Reactive Manifesto defines the core principles for modern system design: asynchronous, message‑driven communication that is scalable, resilient, and ultimately leads to responsive, maintainable, and extensible applications.
  • An “event” is an immutable statement of fact about something that has already happened, serving as the basic unit of information in event‑driven architectures.
  • In a traditional messaging model, services send targeted, often conversational messages directly to one another (e.g., checkout → inventory, shipping, contact), requiring the producer to know each consumer.
  • Event‑driven designs decouple producers from consumers by publishing events without specifying who will consume them, allowing any interested service to subscribe and react independently.
  • This decoupling enables real‑time user interactions, plug‑in microservices, and flexible streaming/data analytics, while supporting the scalability and resilience goals of the Reactive Manifesto.

Full Transcript

# Event‑Driven Architecture for Reactive Systems **Source:** [https://www.youtube.com/watch?v=o2HJCGcYwoU](https://www.youtube.com/watch?v=o2HJCGcYwoU) **Duration:** 00:12:09 ## Summary - The Reactive Manifesto defines the core principles for modern system design: asynchronous, message‑driven communication that is scalable, resilient, and ultimately leads to responsive, maintainable, and extensible applications. - An “event” is an immutable statement of fact about something that has already happened, serving as the basic unit of information in event‑driven architectures. - In a traditional messaging model, services send targeted, often conversational messages directly to one another (e.g., checkout → inventory, shipping, contact), requiring the producer to know each consumer. - Event‑driven designs decouple producers from consumers by publishing events without specifying who will consume them, allowing any interested service to subscribe and react independently. - This decoupling enables real‑time user interactions, plug‑in microservices, and flexible streaming/data analytics, while supporting the scalability and resilience goals of the Reactive Manifesto. ## Sections - [00:00:00](https://www.youtube.com/watch?v=o2HJCGcYwoU&t=0s) **Reactive Manifesto Foundations for Event‑Driven Systems** - Whitney explains how the Reactive Manifesto’s core principles—message‑driven, scalable, resilient, responsive, maintainable, and extensible—shape the design of event‑driven architectures that enable real‑time user interactions, pluggable microservices, and extensible streaming analytics. ## Full Transcript
0:00What are event-driven architectures? And how can  they enable real-time user interactions, pluggable 0:07microservices, and extensible streaming and data  analytics? My name is Whitney, I'm on the Cloud 0:14team here at IBM. Before I dig in on event driven  architecture, specifically I'd like to talk about 0:21system design, more generally and specifically  the reactive manifesto. The reactive manifesto 0:29is a set of community-driven guidelines that are  intended to give a cohesive approach to systems 0:35design. So, at the core of the reactant manifesto  we have, we want our system to be message driven. 0:47And so, specifically asynchronous messaging. 0:55And then also, we want our our  system design to be scalable, 1:06and we want it to be resilient. 1:11So this implies distributed systems or Kubernetes.  So by scalable we mean that we want the 1:18hardware used to expand as the workload  expands and contract as the workload contracts 1:23and by resilient we mean we we don't  want any single point of failure 1:28and if the system does fail we want it to be able  to tolerate tolerate that elegantly so with this 1:34foundation in place we should be able to build a  system that is responsive responsive is the value 1:45on top of that we can expect  a system that is maintainable 1:53so it means it's easy to change easy to fix a bug  or do an update and we want one that is extensible 2:05so we should be able to expand the system easily 2:09so now that we have the core of what we  want our systems designed to look like 2:14now let's talk about let's level set  here and talk about like what is an event 2:20so an event is a statement of fact an immutable  statement of fact about something that happened 2:26in the past so let's give that some context  we'll talk about a retail application 2:33so a retail application has a checkout service 2:38and that checkout service is going to want  to communicate with an inventory service 2:47a shipping service and a contact service 2:55so with the messaging model if the inventory wants  to know what the checkout is doing the checkout 3:03will send a message directly to inventory  to let the inventory know a checkout happen 3:08and another one directly to shipping and directly  to contact so with messaging we have targeted 3:14delivery um not only that but inventory  can maybe send a message back to 3:23checkout it can be a conversational  delivery conversational messaging 3:33and then finally let's talk about where that  message lives before it's sent it's it's 3:38lives on the host service or on the producing  service when it's received it lives on the um 3:45it lives on the host service until it's received  by the consuming service or in the case of a 3:50message broker it might sit on a machine in  between but regardless the the data persistence is 3:56transient 4:03now let's compare that to eventing so if  our checkout service is producing events 4:10it's producing an event every time a checkout  happens without any concern to which service 4:14is consuming that and so with that we have a  system that's highly scalable so we have um 4:22three services here interested in the checkout  but even if we expand it to a hundred services 4:28listening to check out that wouldn't affect  what the checkout service is doing in any way 4:34not only that when we have all the checkouts  in a row we come up with an event log 4:39and it can be replayable  so we have a stream history 4:42and a history of everything that that  every checkout event that has happened 4:50and then our data persistence depending on how the  cluster is set up it can be set up to be immutable 4:56it can be there forever as long as you have the  physical hardware to back it up so we have um 5:01instead of having transient data persistent  so we have uh permanent or possibly permanent 5:09not immutable but permanent data persistence e and  t um so this is the foundation of our event driven 5:22architecture so we have a resilient a reactive  responsive system design and then that message 5:29driven element is is event messaging specifically  so when we go into our proper event design the 5:38first thing we're going to consider are our event  producers so we might have a web application 5:46that produces events and we  might have a a mobile application 5:55and let's say we also have an edge device that's  producing events so uh internet of things device 6:02and all of these are producing  events into our system so 6:10so this piece of the system here that  has all the events running through it 6:15this is called the event backbone 6:25so what does this system enable 6:28well first of all we have our event logs being  produced by all the producing applications 6:38so the event logs can do a few things first it  can trigger an action so if we have an internet 6:46of things device let's say our internet of things  device is a robot vacuum cleaner and when we turn 6:52on that robot vacuum cleaner it spins up a pod  on the infrastructure and that pod is a function 7:00as a service so function as a service is a modular  piece of code often associated with an edge device 7:06that doesn't exist on a server on the server until  it is turned on and that's when it is spun up so 7:13that's called serverless function as a service  is sits on top of serverless infrastructure 7:20but the point is that event triggers an action  of the with the robot vacuum cleaner to spin up 7:28bounce all around the house make everything  squeaky clean and then when the function is 7:34finished running it powers down and perhaps  that'll cause our function as a service to send 7:39another event back into the system to let  it know that the the function is complete 7:46another cool thing about the event log is it  can be used to help optimize and customize data 7:52persistence so if our web application is our maybe  it's our retail application that we talked about 7:59before and it's doing a stream of checkout events  well our inventory service can be reading from 8:06that and it's keeping track of a local data  store that's keeping track of the inventory 8:14so our inventory service will consume from  that data stream from the web application it'll 8:22modify the local data and then it'll produce  again into the event backbone and so this new 8:29stream is giving the most current inventory  to any other application in the system that 8:34wants to consume from it and so while we're  talking about data another thing that happens 8:40we can save all of the data that comes through the  system so all the raw data or all of the transform 8:46data here at the end once it goes through the  system we'll save it all in a huge data lake 8:56and this is what's going to power  really data-heavy applications 9:00like ai for example and the data lake is  accessible from anywhere in the system 9:06that any service that you let consume from it 9:11so another thing that our event-driven  architectures can enable are a stream processing 9:22so this is built on top of  the apache kafka streams api 9:29so let's say that our mobile app is producing  let's say it's a music streaming service and 9:37every time let's say up until your in your whole  life up until this point you've been listening to 9:42only miley cyrus and britney spears but today you  decide you know what i want to see what jay-z is 9:48about and you turn jay-z on well immediately  your streaming app is showing you kanye west 9:54and lauren hill and giving you ideas about what  you might want to listen to next so that stream 10:01processing is a really powerful and what gives  the gives real-time calculations like if it's a 10:07ride share app you um that you know exactly how  far away your ride is but it can also be used to 10:16implement business rules and business policies  and it can be used for real-time analytics 10:26and then let's also talk about with  our system the communications layer 10:36so specifically it's called pub sub communication 10:42for publish subscribe so we could have any  microservice a containerized microservice 10:54and just like we talked about before with it being  extensible we can very easily plug it into we can 11:01write a new microservice and plug it into our  system and immediately have it start consuming 11:07from any stream and producing to a new stream or  even producing to a stream that already exists 11:13and none of the other applications need  to be concerned with it at all so it's 11:17highly plugable not only that but because  of the stream history we talked about before 11:24when you plug it into the system you don't have  to have it start consuming from right this moment 11:29it can be consuming from as long as from the  beginning of your application if you've been 11:34saving your stream history for that long so  as long as that stream history persists when 11:39you plug in a new system it can consume from  either the old data or can be consumed from 11:45the present moment so with that we talked about  the major benefits of event driven architecture 11:52that sit on top of the reactive manifesto ideas  for system design with eventing at its core