Author(s: Gul Ershad Introduction Event-driven architecture is an incredibly popular distributed, asynchronous pattern that can be used to create highly-scalable applications. It uses events to interact between decoupled services. This architecture is very popular for modern microservices applications. An example of event-driven architecture is a shopping cart on an ecommerce site. You can add items to your cart or change the price of an item, check out, pay, ship, and notify of delivery. This architecture allows the application to respond to changes coming from multiple sources at high processing times without affecting the application. Figure 1: Event-driven architecture An event-driven architecture has various benefits. This allows for the creation of multiple events and ensures consistency. It also makes it possible for an application to keep materialized views. To dive deep into the sub-patterns and topology behind event-driven architectural design, it is essential to first understand how event-driven architecture works. It is built on two major topologies. Mediator Broker Mediator Topology: The role of the central mediator in mediator topology. This is used to coordinate various events through one central mediator. This is useful for large events with multiple events. Figure 2: Example of a Mediator Topology: How to Design a GPS Program in a Vehicle. GPS data can be used as a starting point when designing a GPS system for your vehicle. These data are designed to help you achieve your safety and business goals. This involves several steps: Off-Road vehicle tracking – Any vehicle capable of driving on or off gravel and paved surfaces is considered an off-road vehicle. The vehicle’s GPS data will provide information about the vehicle, and the appropriate channel will be activated to further analyze this data. GPS can provide travel time estimates from one place to another. This data can then be used to determine the business impacts of time. Logistics companies can use this information to navigate to their destination. To increase safety and productivity of their drivers, logistics companies use telematics systems. The concept could be used for route optimization, fuel efficiency and driver safety. It can also be used to establish the steps that lead to the desired fitness goals. This can be done in serial or parallel. Four components make up the mediator topology. This component identifies type and data to be sent to specific Channels. Figure 3: The Mediator There are many tools available to manage mediator topology. Example- jBPM, Mule ESB, Apache Camel, Spring Integration, etc. The Queue Event Queue provides the ability to transport the event to its mediator. This is an enterprise messaging queue system. You can use several messaging systems, such as RabbitMQ and Kafka. Figure 4: Event Queue Channel. The event mediator uses the event channel to send specific events to event processors related to each stage of the primary event. This can either be a message topic, or a message queue. Figure 5: Event Channel Processor This component/service application contains logic that allows for business processes to be executed upon receiving events. These components are now microservice-based. You can also use it as a channel consumer. Broker Topology The message flow in Broker topology is distributed to all event processors upon receipt of an event. Because it’s not central, this is different than a mediator. It can be used in various chain processing. Design Online Food Ordering System: This is an example of how to order food online. When a user orders food from an app, website or other online platform, it creates an event that sends a message to various events in order to finish the order process. This is an example of a chain that contains many different flow: The user selects a restaurant to order food. Payment is made for the food ordered. Notification to restaurant. Delivery partner gets notification. Restaurant hands over food to delivery partner. Delivery partner then delivers the food to the customer. Figure 6: Topology of the Broker for Food Ordering System. In this architecture design chaining can be used to achieve business functionality. To make the system more flexible and accurate, a queueing mechanism was also added. When an application is in the process of evolving, or looking to expand functionality or capabilities, this type of topology is very common. Event-driven architecture has become very popular because of its high scale and distributed, asynchronous behavior. This architecture is great for microservices and offers a decoupled system. Software Engineering originally appeared in on Medium. People are responding and highlighting this story. Published via
Home Innovation Deep dive into Event-Driven architecture
THE FOREFRONT OF TECHNOLOGY
We monitors and writes about new technologies in areas such as technology, innovation, digitization, space, Earth, IT and AI.







