title: How does I/O work in Akka?
body: <p>How does the actor model (in Akka) work when you need to perform I/O (ie. a database operation)?</p>
  
  <p>It is my understanding that a blocking operation will throw an exception (and essentially ruin all concurrency due to the evented nature of Netty, which Akka uses). Hence I would have to use a <code>Future</code> or something similar - however I don't understand the concurrency model.</p>
  
  <ol>
  <li>Can 1 actor be processing multiple message simultaneously?</li>
  <li>If an actor makes a blocking call in a <code>future</code> (ie. <code>future.get()</code>) does that block only the current actor's execution; or will it prevent execution on all actors until the blocking call has completed?</li>
  <li>If it blocks all execution, how does using a future assist concurrency (ie. wouldn't invoking blocking calls in a future still amount to creating an actor and executing the blocking call)?</li>
  <li>What is the best way to deal with a multi-staged process (ie. read from the database; call a blocking webservice; read from the database; write to the database) where each step is dependent on the last?</li>
  </ol>
  
  <p>The basic context is this: </p>
  
  <ul>
  <li>I'm using a Websocket server which will maintain thousands of sessions. </li>
  <li>Each session has some state (ie. authentication details, etc);</li>
  <li>The Javascript client will send a JSON-RPC message to the server, which will pass it to the appropriate session actor, which will execute it and return a result.</li>
  <li>Execution of the RPC call will involve some I/O and blocking calls.</li>
  <li>There will be a large number of concurrent requests (each user will be making a significant amount of requests over the WebSocket connection and there will be a lot of users).</li>
  </ul>
  
  <p>Is there a better way to achieve this?</p>