# AJAX and master/slave architecture

**URL:** <https://www.ruby-forum.com/t/ajax-and-master-slave-architecture/134061>\
**Category:** Rails\
**Created:** [April 7, 2008, 4:01pm UTC](https://www.ruby-forum.com/t/ajax-and-master-slave-architecture/134061 "2008-04-07T16:01:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 7, 2008, 4:01pm UTC](https://www.ruby-forum.com/t/ajax-and-master-slave-architecture/134061/1 "2008-04-07T16:01:20Z")

</div>

Hi \*,  
I’m scaling a pretty huge application written in RoR.  
I’ve decided to have n read-only slave databases, and a single master  
for write operations.

The problem I’m facing is that when I write using Ajax calls the  
master database doesn’t replicate the data on slaves fast enough, so  
it doesn’t render the correct data (even worse - it memcaches the  
wrong data …).

Someone has suggestions ? How are master/slave architectures normally  
handled by huge players in the Rails community ? I’m thinking about  
stuff like a timer to stop the read and give the master the time to  
replicate, but it seems too ugly for working 😛

TIA,  
ngw
