Source URL: https://blog.gurock.com/event-driven-application-architectures/ Author: Shanu Mandot # Testing Event-Driven Application Architectures: An Asynchronous Approach [Readwise URL](https://readwise.io/bookreview/9097906) | [Source URL](https://blog.gurock.com/event-driven-application-architectures/) --- ![](https://readwise-assets.s3.amazonaws.com/static/images/article0.00998d930354.png) --- Passing messages between components using a common message broker such as Kafka or RabbitMQ makes it possible for components to operate independently at scale. It's not unusual for systems that support an event-driven architecture to process more than 20,000 messages a second. ^179278299 **References:** https://instapaper.com/read/1411961728/16379292 --- Event-driven application architectures make it so that various components in a very large distributed system can communicate and interoperate asynchronously. ^179278300 **References:** https://instapaper.com/read/1411961728/16379293 --- > Basically, an event-driven application architecture is one in which services (aka functions) within an application input data and output data via messages that are stored in a message queue. This differs from a synchronous architecture, in which data is passed straight to a service by making a direct call. > \ > The canonical example of a synchronous interaction is the standard request-response communication to and from a web server. A caller makes a request to a web server and then waits to receive a response. The caller is "locked" in the interaction until a response is returned. The response might take a millisecond, or it might take a few seconds, but the caller can do nothing until the interaction completes. ^179278301 **References:** https://instapaper.com/read/1411961728/16379298 --- The benefit of an event-driven application architecture is that there is no blocking between processes. The client doesn't have to wait around for a response. ^179278302 **References:** https://instapaper.com/read/1411961728/16379301 --- Effective logging is critical in any application architecture, but when it comes to event-driven application architecture, it's essential. ^179278303 **References:** https://instapaper.com/read/1411961728/16379304 --- > n an event-driven application architecture, messages are coming and going at near-instantaneous velocities. And, in many cases, the order is not guaranteed. For example, messages A, B and C could fire in sequence to a message queue, and yet the processor could emit the processed message in the order B, C and A, for example, as shown below in figure 3. > \ > \ > \ > Figure 3: Message order is not necessarily guaranteed in an event-driven application architecture > Thus, the only way to really figure out what's going on in terms of application behavior is to make sure that all information relevant to application performance is being logged, with timestamping being the no-brainer requirement. ^179278304 **References:** https://instapaper.com/read/1411961728/16379328 --- > Distributed Tracing Is Essential > Given the asynchronous nature of an event-driven application architecture, it's really hard to get a clear idea of the logical execution path of a given workflow. ^179278305 **References:** https://instapaper.com/read/1411961728/16379373 --- Distributed tracing is designed to monitor the complete activity path of a transaction throughout the entire system. ^179278306 **References:** https://instapaper.com/read/1411961728/16379378 --- There are now a number of distributed tracing products and projects that support distributed tracing in an asynchronous environment, such as Wavefront and Jaeger. ^179278307 **References:** https://instapaper.com/read/1411961728/16379381 --- The biggest difference between testing synchronous applications and those that are based in event-driven architectures is having to accommodate the asynchronous nature of the interactions. ^179278308 **References:** https://instapaper.com/read/1411961728/16379383 --- ## Citation ``` [^mandot]: Mandot, S. (2021). _Testing event-driven application architectures: An asynchronous approach_. Test Rail. Retrieved from https://blog.gurock.com/event-driven-application-architectures/ . [[Testing Event-Driven Application Architectures - An Asynchronous Approach|My highlights]].