liveBook · Manning

Blocking

As explained in Akka in Action, Second Edition

Blocking I/O is input or output whose calling execution path waits until the operation completes or fails.

Blocking I/O makes the calling execution path wait until an input or output operation completes or fails. Database calls are essentially RPCs, and standard drivers such as JDBC commonly use blocking I/O. Combining these waits with application threads, memory locks, RPC behavior, and database locks creates an interwoven programming model whose performance and failure behavior are difficult to predict. section 1.4.1 section 1.3

Blocking I/O becomes a practical scaling concern when:

  • Controllers can freely combine database operations such as finding conversations and inserting messages, producing unpredictable access flows. section 1.4.1
  • Synchronous RPC and blocking I/O are used to scale across a network, while the contrasting approach uses asynchronous messaging and nonblocking I/O. section 1.3
  • Thread locks and database locks must be coordinated separately because they protect different resources. section 1.4.1

Database-backed team chat

A team-chat controller might combine calls such as findConversations and insertMessage. Because these database operations behave like blocking RPCs, different controllers can create many access flows, increasing the risk of deadlocks and other performance problems as the application scales. section 1.4.1

Figure 1.6 DAO interactions
CH01_F06_Abraham2

Trace how DAO calls can be combined into different database access flows, making the coordination costs of blocking operations visible. section 1.4.1

How Akka in Action, Second Edition covers it

How deep it goes
Explains blocking I/O through database drivers, RPCs, lock interactions, and access-flow risks, but stops short of implementation internals.
Examples
Uses JDBC, DAO calls, and a team-chat message flow to illustrate blocking database access.
What you can do after
Evaluate how synchronous database calls and RPCs can create coordination, deadlock, and scaling risks.
How it connects
Connects blocking I/O with threads, RPC, database locks, shared mutable state, asynchronous messaging, and nonblocking I/O.

Also explained in

Compare how 9 books explain blocking →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Akka in Action, Second Edition. The section links point to the parts of the book it draws on.