What Are Events? Always ‘Decoupled’

In January 2021, I wrote that Event Driven Architecture (EDA) should be "Always Asynchronous." At precisely the same time, I argued that "the concept that we are actually trying to explain when we use the term 'Asynchronous' — within the context of EDA — might be better termed: 'Monologueous Communication'" (where no response is ever required). Nonetheless, 'Asynchronous' remains the dominant term in use today, and it was never certain that 'Monologueous Communication' was a good replacement. As the months have passed, however, I see more and more clearly how using the term 'Asynchronous' represents a major obstacle to our shared comprehension of EDA.

Let me give you an almost unbelievable example that I witnessed from the CTO of the global computing giant AWS at its recent re: Invent Summit in December 2022. Of course, it goes without saying that the CTO of AWS is as well placed as anyone in the world to explain to an ignorant public was 'Asynchronous' actually means, for which reason I find this example so incredibly useful (please do not take it as a pointless exercise in AWS-bashing).

What Are Events? API Calls

It is always interesting to note how even today's Cloud giants continue to draw a largely imaginary line between Synchronous and Asynchronous HTTP Requests, such as in the case of a typical REST API call. This line, we are asked to believe, very clearly separates Synchronous Requests – where the Request is made and the caller holds the line until receiving a Response from the relevant HTTP API Endpoint – from Asynchronous Requests – where the caller fires off their Request, (typically) gets a 202 Status Code in reply, and then waits for the actual API Response via some other channel; such as a Webhook, WebSocket, or using the 'HTTP Polling' Pattern described by Microsoft in its Asynchronous Request-Reply pattern Article.

We read in this same Article that: "Most APIs can respond quickly enough for responses to arrive back over the same connection… In some scenarios, however, the work done by [the] backend may be long-running, … [and] it isn't feasible to wait for the work to complete before responding to the Request. This situation is a potential problem for any synchronous request-reply pattern… Some architectures solve this problem using a message broker to separate the request and response stages… But this separation also brings additional complexity when the client requires success notification, as this step needs to become asynchronous."

What Aren’t Events?

Despite the hype around ‘Event-Driven Architecture’ (EDA) over the past few years, I am confident that you will be unable to find a solid definition for ‘Event,’ on the web today. After an hour of research, the best definition I managed to find is one of several definitions provided by Red Hat: “We will define a software event as the immutable record that something happened within an application… Normally, events are broadcast to notify of change or replicate state across multiple applications.” Here, Red Hat are talking specifically about ‘Software Events’: each of which signals a ‘change of state’ in a particular ‘entity’ (e.g. Customer address changed) within a given distributed application.

This definition perhaps seems very straightforward, but what is not mentioned, is that there are in fact three different types of ‘Events’ according to today’s pundits:

Event-Driven Microservices?

When Vikas Anand, Product Director of Google’s Apigee API Management offering, gave the presentation "The Case for a Unified API and Event Strategy" during the recent EDA Summit of 2022, I was again shocked by a gleaming error in what was presented: “Microservices, while they’re providing a great deal of advantages, they also bring in complexity which you need to manage. We can basically manage this better by providing a solution which is called event-driven architecture. This produces a solution for this problem, of microservices and a solution at scale, where it provides the ability to reduce dependencies and complexities in your application, whilst still allowing the creation of more and more microservices.”

Although I genuinely have no idea what any of that means, an error was nonetheless evident in the associated slide:Event driven architecture slide from Vikas Anand presentation

Event Mesh: Point-to-Point EDA

In watching the 2022 EDA Summit presentation "Powering Your Real-Time, Event-Driven Enterprise with PubSub + Platform" by Shawn McAllister, CTO of Solace (sponsor of the Summit), I learned of the origins of his company. This article recounts his presentation with my personal synopsis. As he recounted, let’s “start with capital markets…where Solace started."

Presentation Highlights and Additional Commentary

Shawn began by stating: "Capital markets became digital…over 20 years ago…They had, of course, on-prem applications…but the magic really happened in these 'colocation centers,' ... data centers that are not owned by the bank or the buy-side firm... They’re shared, so they’re kind of like the clouds that you have today… and those colocation centers were then located close to the execution venues, where a lot of the trading happened."

Enough Already With ‘Event Streaming’

Anyone watching the current (streaming?) video series of the 2022 EDA Summit is likely to once again be shocked by the number of EDA thought leaders making interminable references to event streaming. Why shocked? Because events are NEVER "streamed," and anyone claiming to understand EDA probably ought to understand that fairly fundamental point.

The Oxford Dictionary defines "streaming" as "a method of transmitting or receiving data (especially video and audio material) … as a steady, continuous flow, allowing playback to start while the rest of the data is still being received." Events, you are probably aware, are never split across separate payloads. Indeed, on major platforms such as AWS where event payloads are limited to a maximum of 256 KB, even then I have never seen an individual event payload that came close to exceeding this limit.

APIs Outside, Events Inside

This is an article from DZone's 2022 Enterprise Application Integration Trend Report.

For more:


Read the Report

In the echo chambers of application development, we constantly hear the mantra "API-first," but this slogan has a fundamental flaw: APIs should typically be the last choice when building a distributed application. The correct war cry ought to instead be: "APIs outside, events inside."

Events Are the New Data

The Oxford Dictionary defines ‘Data’ as: “Facts … collected together”. Should we instead use the specialized language of application architects, ‘Data’ can be more accurately defined as: ‘Events folded together’. ‘Folding’ represents the act of merging a particular Entity’s (State-changing) Events, in chronological order, to compute the latest Entity ‘State’ — what we typically refer to today as a Data 'Record'. Data — unlike Events — is an abstract notion. Whilst ‘Events’ represent actual changes to an Entity’s State (e.g. PurchaseOrder.Deleted), ‘Data’ represents no more than the calculated State of a particular Entity, once all preceding Events have been folded together; something that cannot even be performed should you ever lose any Events. 

At some point in history it was decided — clearly owing to restrictive hardware costs at the time — that we could not possibly store all State-changing ‘Events’ in our Data-bases, but that instead, we could only store ‘Data’: the current ‘Folded State’ of each business Entity (until such a time as even that was archived, owing to archaic hardware constraints).

From SOA, to GraphQL, to Macroservices

SOA vs Microservices

Should you happen to be researching "Service-Oriented Architecture" (SOA) on the Internet today, the latest articles you are likely to find will typically be titled: "SOA vs microservices". Complicating the battle somewhat is that you will also find respected industry experts, such as Martin Fowler, stating that some “consider microservices to be one form of SOA, perhaps service orientation done right”.

Martin goes on to declare: “The problem…is that SOA means too many different things and that most of the time we come across something called 'SOA' [there is]…a focus on ESBs (Enterprise Service Buses) used to integrate monolithic applications. This common manifestation of SOA has led some microservice advocates to reject the SOA label entirely”. As such, for the remainder of this article, I will assume the use of ESB middleware as a fundamental characteristic of SOA landscapes, as well as representing the most fundamental distinction there is between SOA and REST.

APIs: Our Legacy from Flawed 1960’s Thinking

Object-Oriented Programming and Design principles have now existed for over 50 years, so it seems odd that apparently, no one has noticed the substantial flaw in Object-Oriented Design that has existed since the very beginning. We are instead told that Object-Oriented (OO) Design principals have won the day, as they provide a programmatic mirror image of the real-world scenarios they are intended to reflect. If we look a little deeper, OO Design is in fact completely detached from the world that it is intended to model. Whilst it is obviously true that the world consists of objects — known and unknown, real and abstract — the unimaginable flaw in OO Design fundamentals that seems to remain undetected until this day is that calling objects can never have complete mastery of the Interfaces of the objects they call: objects can only ever be masters of their own Interface — of themselves.

Example

Let’s imagine a Customer Object in negotiations with a SalesContact Object, in any given IT Landscape. OO Design asks us to pretend that the Customer Object has perfect mastery of the SalesContact Object Interface, and therefore knows exactly how to call the relevant RequestQuotation method of the SalesContact Object: having already guessed at the name of that method, its latest publicly-available version, and based upon the false hope that the definition of the RequestQuotation method will not change over time. The obvious reality is that the Customer Object can only guess at the Interface of the SalesContact Object, and hope that this Interface does not change in the short-term (e.g. as the product range offered by the SalesContact becomes more developed, and therefore more complex). Add to this the fact that the very same Customer Object may need to exchange with several different SalesContact Objects in several different departments, not all using the same Interface Version or even the same Interface — the same API — and we must consider that the OO Design philosophy, as it stands today, is massively flawed.

EDA ‘Model-View-Broker’ Pattern: The New MVC

Virtually every software developer in the world has heard of the ‘Model-View-Controller’ (MVC) Design Pattern, which is not entirely surprising given that it was “first introduced by Trygve Reenskaug, a Smalltalk developer at the Xerox Palo Alto Research Center in 1979.” Today, Oracle provides us with a nice representation of a 'Common MVC Implementation:'

Model-View-Controller Diagram
Now, more than forty years later, and in the context of an emerging star in software integration — ‘Event-Driven Architecture’ — it seems high time for the next generation of MVC to be announced: the ‘Model-View-Broker’ (MVB) Pattern. Here is a reworked version of the earlier MVC Diagram, with key changes marked in yellow: