title: Are read replicas in Amazon affected by updates in master?
body: <p><strong>This is my problem:</strong></p>
  
  <p><em>Sometimes one long lasting query (>60 secs, and I have a lot of those) which is always a SELECT makes my whole application stops working properly up until the query is solved.</em></p>
  
  <p><em>The first long lasting query starts making the others slow and then all the system is freezed.</em> </p>
  
  <hr>
  
  <p>My app is a Rails 3.2 application with ruby 2.3.</p>
  
  <p>I use Makara as adapter for read replicas.</p>
  
  <p>I have the following architecture:</p>
  
  <ul>
  <li>5 medium.t2 EC2 instances that performs SELECTS</li>
  <li>1 medium.t2 EC2 instance that performs INSERTS</li>
  <li>1 MariaDB server + 2 read replicas. InnoDB Engine.</li>
  </ul>
  
  <p>I have four resources:</p>
  
  <ul>
  <li>1 api to update the database, INSERT</li>
  <li>1 index with conditions, SELECT</li>
  <li>1 count action with conditions, SELECT</li>
  <li>1 autocomplete, SELECT</li>
  </ul>
  
  <p>My server stack uses Apache + Passenger.</p>
  
  <p><strong>This is my guess:</strong></p>
  
  <p><em>The read replica is trying to update a table that is actually being used by a select operation, consequently he is unable to apply the sync until the app finishes, making both read replicas different from the master.</em></p>
  
  <p><strong>Best part:</strong></p>
  
  <p><em>We only deal with 400 rpm and the half of them are to update results in the database.</em></p>