# Separate App an DB servers , Scabality and rails

**URL:** <https://www.ruby-forum.com/t/separate-app-an-db-servers-scabality-and-rails/173288>\
**Category:** Rails\
**Created:** [August 6, 2009, 10:17am UTC](https://www.ruby-forum.com/t/separate-app-an-db-servers-scabality-and-rails/173288 "2009-08-06T10:17:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lecielbleu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b487fb/32.png) [@lecielbleu](https://www.ruby-forum.com/u/lecielbleu)\
**Post date:** [August 6, 2009, 10:17am UTC](https://www.ruby-forum.com/t/separate-app-an-db-servers-scabality-and-rails/173288/1 "2009-08-06T10:17:17Z")

</div>

Hi , what will be if my site traffic became huge , can i separate db  
server and add 3 or more app server using rails framework. i think  
designing my site using rails and put it in EC2 servers. what do you  
think about this system? Will be work or not?

---

<div class="post-metadata">

**Author:** ![lecielbleu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b487fb/32.png) [@lecielbleu](https://www.ruby-forum.com/u/lecielbleu)\
**Post date:** [August 6, 2009, 12:05pm UTC](https://www.ruby-forum.com/t/separate-app-an-db-servers-scabality-and-rails/173288/2 "2009-08-06T12:05:00Z")

</div>

What you should consider first is to use cache. First and foremost, try  
memcached. Just store the results from database find, then you never  
touch  
the database except for writing and then for the first time reading  
after  
the write.  
Also, you can use varnish cache, similar to a proxy server in front.  
Requires minimal knowledge, but you can easily go from 40 requests per  
sec  
to over 2000 on a shared host.  
For example, I work for a company with the largest and most visited  
website  
in Scandinavia (top 3 at least), and we only have 1 or 2 servers for  
almost  
all and then 2 varnish servers. Not the full truth but pretty close.  
We  
get over 1.5 unique visitors per day with many more millions page views,  
and  
have plenty left, all due to varnish cache.

For all normal web sites, you can get really far with just memcached.

Trausti
