{"id":6677,"date":"2024-02-02T09:00:00","date_gmt":"2024-02-02T08:00:00","guid":{"rendered":"https:\/\/blog.besharp.it\/?p=6677"},"modified":"2024-02-05T16:57:13","modified_gmt":"2024-02-05T15:57:13","slug":"a-deep-dive-into-decoupled-cloud-architectures-with-event-buses","status":"publish","type":"post","link":"https:\/\/blog.besharp.it\/a-deep-dive-into-decoupled-cloud-architectures-with-event-buses\/","title":{"rendered":"A Deep Dive into Decoupled Cloud Architectures with Event Buses"},"content":{"rendered":"\n
For companies trying to stay ahead in the constantly evolving cloud computing world, scalability, resilience, and flexibility are essential requirements for their systems. Organizations are transitioning from monolithic architectures to distributed systems to benefit from their power.<\/p>\n\n\n\n
In this process of breaking down into pieces your monolith application to shift to a distributed system, decoupling strategies, and patterns become crucial to achieving this goal in the right way. <\/p>\n\n\n\n
Decoupling<\/strong> is a strategic change that divides components within a system, making them operate independently while promoting interoperability.<\/p>\n\n\n\n This article was inspired by the last AWS re:Invent session: “Advanced Integration Patterns & trade-offs for loosely coupled systems.<\/p>\n\n\n\n In this article, we will explore decoupled cloud architectures, focusing on the function of event buses in this process. Event buses act as a foundation for coordination and communication of applications throughout a distributed system.<\/p>\n\n\n\n This article will explain the complexities of modern cloud architecture to veteran technicians and business leaders who wish to grasp the foundations. It will also highlight the concrete benefits of adopting a decoupled approach.<\/p>\n\n\n\n Fragmenting your monolith application into several microservices may seem very challenging initially, but it comes with several benefits that can be summarized with \u201ccomponents independence\u201d. To name just a few of those benefits:<\/p>\n\n\n\n This independence is crucial in the dynamic and elastic cloud environment where agility, coupled with the scalability provided by AWS services, really helps to rapidly develop and improve the application, thus all the aforementioned benefits.<\/p>\n\n\n\n A common design pattern is \u201cLoosely coupled components<\/strong>\u201d: components should be designed to operate independently from each other, interacting with minimal or no dependency. In this sense, components have minimal knowledge of each other, they just know how to exchange information between them via well-defined interfaces or contracts, which standardize the communication: message structures, data formats, and so on\u2026<\/p>\n\n\n\n As hinted before, coupling can be found in many different aspects, to name just a few: from technology coupling, where applications share the same programming language or technology, to communication and conversation coupling: is the communication synchronous or asynchronous? How do we communicate: full results, pagination, caching? What about retries?<\/p>\n\n\n\n Given the scope of this article, which focuses on the communication between systems, we will concentrate on related decoupling strategies.<\/p>\n\n\n\n Speaking about communication between systems, event buses are the perfect solution to achieve decoupling. <\/p>\n\n\n\n In cloud architectures, systems communicate and integrate with each other using events. Event buses can act as an interconnection system between event producers and consumers, orchestrating event flow between the parties. <\/p>\n\n\n\n The key feature here is that, as the bus lies in the middle between producers and consumers, you can connect multiple systems in a many-to-many relationship almost effortlessly: producers will push their events to a bus, and all the consumers interested in a specific event, will receive and process it. <\/p>\n\n\n\n As an example, think about an e-commerce site that needs to process an order under many different aspects: payment processing, inventory management, and order shipment.<\/p>\n\n\n\n Same fashion for consumers that can be interested in the same event type, produced by multiple systems. An example of this can be a common notification system for the whole architecture.<\/p>\n\n\n\n In this sense, you can see the usage of event buses similar to a Pub\/Sub system.<\/p>\n\n\n\n <\/p>\n\n\nFrom a monolithic application to a plethora of microservices: Decoupling in the Cloud Context<\/h2>\n\n\n\n
\n
Loosely coupled components<\/h2>\n\n\n\n
Event Buses: the backbone of cloud distributed architectures<\/h2>\n\n\n\n