title: Designing concurrent HTTP URL connections
body: <p>We are designing a client server system.
  N numbers of clients can connect to the server to send multiple messages. The server inserts the message in the database and post the messages to an external server and returns a unique id to the client for the client to track the message.</p>
  
  <p>To avoid bottlenecks and IO wait time would like split this service into two task</p>
  
  <ol>
  <li>Record details in the Database</li>
  <li><p>Batch process which will send 20 http post using </p>
  
  <pre><code>Task sendMessage =new Task[20]
  ExecutorService threadExecutor = Executors.newFixedThreadPool( 20 );
  //get the list of message not send from database send them and update the database
  for(int i=0;i&lt;10;i++) {
      threadExecutor.execute( task[i] );//send message via HTTP post
  }  
  </code></pre></li>
  </ol>
  
  <p>Is this a good design. Is It good to run point 2 separately to improve performance.
  Also In above case each thread will connect to the database and update it would that cause locks or dirty writes?</p>