Creating an Event-Driven Architecture in a Microservices Setting
Is it possible for event-driven architectures and microservices to co-exist? We find out in this interview with Adam Bellemare.
Join the DZone community and get the full member experience.Join For Free
Event-driven-based architectures and microservices are both known to improve agility and scalability in systems. Event-driven architectures decouple the producer and consumer of the data, while microservices are a modern service-oriented architecture.
But can these two architectures co-exist?
“The big difference is that the system that writes the data that produces it is producing — what I would call a general-purpose event — and then leaves it up to the consumers to do whatever they will with it. That's a big change in terms of boundaries and in terms of responsibilities that weren't really available to us based on the technologies we had, say, 20 years ago,” Bellemare shares.
So, how can you take advantage of this opportunity to leverage your organizational data at scale with event-driven microservices?
Bellemare shared some tools, patterns, and workflows, while also defining some fundamental concepts of event-driven microservices during an episode of Coding over Cocktails, a podcast by Toro Cloud. You can view the full interview on YouTube below.
Liberating Your Data
During the episode, Bellemare explained how “data liberation” can lead to having an event-driven architecture.
He describes data liberation as “getting data out of an existing operational system into event streams” allowing you to build a microservice.
“What you're doing is you're tapping into the data, making that available and then you can build some services off of it now. Will it be exactly what you want? Maybe; maybe not. But what it'll do is it'll get you into it and it'll get you into it pretty quickly… you can get started pretty quick on it. You can set up some connectors. You start getting a taste of this near-real-time availability of data, and you can say, ‘You know what, let's see if these microservices — these event driven ones — actually help us.’ And you haven't had to spend two years building a platform to do it first,” Bellemare explains.
Asynchronous vs. Synchronous Microservices
He also talked about the distinction between asynchronous and synchronous microservices, as well as why he’s advocating the former over the latter.
“So, synchronous is what I also call a request-response. So a service makes a request and then awaits a response to move on with its work. On the other hand, in an asynchronous event-driven microservice, we're communicating through an event stream. You could still do a pattern where you send an event to a service, and then it sends you a reply back over streams. But you can also do unidirectional, where you're publishing important business facts and that service that's publishing it trusts that they’ll use that data for some intelligent, fair purpose,” he explains.
He then explains how asynchronous microservices provides users “streams of readily usable data” to make their own decisions on, which is why he’s advocating for their use.
Published at DZone with permission of David Brown. See the original article here.
Opinions expressed by DZone contributors are their own.