DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Navigating and Modernizing Legacy Codebases: A Developer's Guide to AI-Assisted Code Understanding
  • Tired of Spring Overhead? Try Dropwizard for Your Next Java Microservice
  • Build a Stateless Microservice With GitHub Copilot in VSCode
  • From Prompt to Running Microservice: ServiceBricks Step-By-Step

Trending

  • How to Build Real-Time BI Systems: Architecture, Code, and Best Practices
  • Data Lake vs. Warehouse vs. Lakehouse vs. Mart: Choosing the Right Architecture for Your Business
  • AI-Driven Root Cause Analysis in SRE: Enhancing Incident Resolution
  • Cloud Security and Privacy: Best Practices to Mitigate the Risks
  1. DZone
  2. Data Engineering
  3. Data
  4. Event-Driven Microservices?

Event-Driven Microservices?

Follow along with this in-depth look into why microservices cannot be "event-driven" using today's techniques.

By 
Cameron HUNT user avatar
Cameron HUNT
·
Jun. 07, 22 · Opinion
Likes (6)
Comment
Save
Tweet
Share
12.0K Views

Join the DZone community and get the full member experience.

Join For Free

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

Here, Vikas apparently decided to simply forget that microservices are always deployed as "competing consumers," in constant competition with each other for workload. Yet, if we look carefully at Vikas’ vanilla-EDA slide, this essential detail is nowhere to be seen and is in no way supported. We are instead shown a single "event channel" and told, “Multiple subscribers subscribe to it," meaning multiple microservices. This is apparently why he claims that an EDA approach is “allowing the creation of more and more microservices.”

What is not explained is why each of the three microservices shown in this diagram – each of the three "competing consumers" – would not all perform exactly the same task when they each receive exactly the same event from exactly the same channel to which they are all subscribed. Indeed, any event would quite obviously lead to the same task being performed 3 times in the above example, which is completely devoid of any notion of competing consumers.

Despite this, Vikas informs us that “event-driven microservices” are nevertheless the future: “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.” It would seem that Vikas suggests reducing “complexities in your application” by simply ignoring those complexities. Should we instead think seriously about these complexities, what we ought to understand is that microservices cannot be "event-driven" using today's techniques – only ever "event-oriented" (e.g., by using a message broker along with its target-specific message queues, rather than an event broker and its openly accessible topics). This is precisely why I suggested in mid-2020 that the EDA community should instead take ownership of a new concept: macroservices.

Macroservices– unlike today's microservices– can be "event-driven," as they do not represent "competing consumers." Instead, their workload is managed by a single "software component" with a single database that will launch individual macroservices operations just as soon as it has an available "work process" (which ought to be most of the time, if the server is correctly sized). Such a macroservice approach is analogous to the ultra-performant Node.js event loop, an approach towards which a great many developers are shifting today. This is an approach that demands a tiny fraction of the complexity and cost of a microservices landscape, perhaps the reason for which Uber publicly started abandoning microservices in April 2020 (see Tweets by @GergelyOrosz).

There is in fact a second gleaming error in Vikas’ brave new world of “event-driven microservices.” Precisely because of the competing consumer constraint, microservice endpoints are triggered synchronously today. Events, on the other hand, are always delivered asynchronously: the broker has to first determine if there are any subscribers to a topic before being able to actually deliver any new events – in no particular order – to ALL topic subscribers.

To avoid giving the impression of Google-bashing – despite the enormity of the discussed omissions – I prefer to mention that we see exactly the same error in a presentation by the CTO of the EDA Summit sponsor, Solace. Shawn McAllister told us during his presentation "Powering Your Real-Time, Event-Driven Enterprise with PubSub+ Platform"  that the retail sector is also moving towards “event-driven microservices,” and provides us with the following slide where, once again, we are given the impression that “event-driven microservices” work side-by-side in perfect harmony and cooperation, while at the same time being entirely independent of one another. Competing microservices, we are again asked to believe, simply need to subscribe to the same topic(s) on the "event mesh", and each of these autonomous event consumers will somehow be aware of which events have, or have not already been treated – asynchronously –  by their competing consumer peers.

Event Mesh Compliments Service Mesh slide from Solace presentation

Rather than merely pointing out to both Google and Solace that their “event-driven microservices” presentations simply do not compute, it is in fact relatively easy to provide them with a little help: Microservices – competing consumers – cannot possibly subscribe to the same channel/topic for their workload. Instead, each requires its own dedicated topic, exactly as per the dedicated message queues of a message broker, but with a major twist: there needs to be a dedicated topic to which each microservice publishes its availability – something which appears to have no equivalent today in the world of message brokers (which typically distribute the workload on a sub-optimal, round-robin basis). Once any possible worker – "microservice" or otherwise – comes online, it simply needs to publish its availability to the workload dispatcher(s). As new work appears, the workload dispatcher(s) – just like the Node.js event loop – simply needs to consume the events published to the "worker availability" topic in sequential order, publishing any new workload to the dedicated worker topic that was nominated in the latest Worker.Available event.

While I have little doubt that a nearly identical approach has been used by operating system developers for decades (given that any kernel obviously needs to be made aware of the fresh availability of work processes), what might be considered revolutionary with such a broker-centric approach is that those workers publishing their availability to the "worker availability" topic need no longer be running upon the same hardware, unlike the work processes of old. Indeed, it is very easy to imagine your domestic workload being shared between your under-utilized PC, laptop, mobile phone, television, and fridge CPUs in parallel: each working in perfect harmony, at their own pace.

microservice

Opinions expressed by DZone contributors are their own.

Related

  • Navigating and Modernizing Legacy Codebases: A Developer's Guide to AI-Assisted Code Understanding
  • Tired of Spring Overhead? Try Dropwizard for Your Next Java Microservice
  • Build a Stateless Microservice With GitHub Copilot in VSCode
  • From Prompt to Running Microservice: ServiceBricks Step-By-Step

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!