ept / ddia2-feedback

Reader feedback on the early release of Designing Data-Intensive Applications, second edition
29 stars 0 forks source link

Chapter 2 | Figure 2-3 | Proposal to introduce evolution of IO models and their pattern on Throughput vs Latency #16

Open mpalriwal-Netflix opened 1 day ago

mpalriwal-Netflix commented 1 day ago

BookLink

To enhance the understanding of the relationship between throughput and response time, it would be beneficial to consider the evolution of I/O models: Blocking I/O (BIO), Non-blocking I/O (NIO), and Asynchronous I/O (AIO).

Incorporating these models into the discussion can provide a clearer picture of how different I/O strategies impact system performance under varying loads.

The same is being discussed in one of my InfoQ article https://www.infoq.com/articles/reactive-java-vertx-deep-dive/

Blocking I/O (BIO): the steepest curve. Non-blocking I/O (NIO): the moderately rising curve. Asynchronous I/O (AIO): near the flattest curve. NIO_BIO_AIO

ept commented 1 day ago

I'm unclear about the distinction between non-blocking and asynchronous I/O – in my mind these two are equivalent (the calling thread does not wait for I/O to complete, but rather picks up the response later via an event loop that perhaps dispatches a callback). The article you link to doesn't really explain the distinction either. Could you elaborate?

mpalriwal-Netflix commented 1 day ago

Thank you for your feedback, Martin. I understand the confusion, as non-blocking and asynchronous I/O are often used interchangeably, but there are subtle differences captured here in an IBM recent blog :

Key Differences

I hope this clarifies the distinction. If you have further questions, I'd be happy to elaborate.


mpalriwal-Netflix commented 1 day ago

To add a recent news around this topic, similar to a multi-reactor pattern I've shared here

With intelligent multi-core utilization and asynchronous I/O threading boost throughput to 1.2 million requests per second, tripling the performance of previous versions. By switching from Redis's archaic single-thread event loop threading model to a sophisticated, I/O operations multithreaded approach, Valkey has vastly increased its speed.