Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm researching cloud services to host an e-commerce site. And I'm trying to understand some basics on how they are able to scale things.

From what I can gather from AWS, Rackspace, etc documentation:

Setup 1: You can get an instance of a webserver (AWS - EC2, Rackspace - Cloud Server) up. Then you can grow that instance to have more resources or make replicas of that instance to handle more traffic. And it seems like you can install a database local to these instances.

Setup 2: You can have instance(s) of a webserver (AWS - EC2, Rackspace - Cloud Server) up. You can also have instance(s) of a database (AWS - RDS, Rackspace - Cloud Database) up. So the webserver instances can communicate with the database instances through a single access point.

When I use the term instances, I'm just thinking of replicas that can be access through a single access point and data is synchronized across each replica in the background. This could be the wrong mental image, but it's the best I got right now.

I can understand how setup 2 can be scalable. Webserver instances don't change at all since it's just the source code. So all the http requests are distributed to the different webserver instances and is load balanced. And the data queries have a single access point and are then distributed to the different database instances and is load balanced and all the data writes are sync'd between all database instances that is transparent to the application/webserver instance(s).

But for setup 1, where there is a database setup locally within each webserver instance, how is the data able to be synchronized across the other databases local to the other web server instances? Since the instances of each webserver can't talk to each other, how can you spin up multiple instances to scale the app? Is this setup mainly for sites with static content where the data inside the database is not getting changed? So with an e-commerce site where orders are written to the database, this architecture will just not be feasible? Or is there some way to get each webserver instance to update their local database to some master copy?

Sorry for such a simple question. I'm guessing the documentation doesn't say it plainly because it's so simple or I just wasn't able to find the correct document/page.

Update: I stumbled upon a blog and this: Amazon Elastic Block Store (EBS) provides block level storage volumes for use with Amazon EC2 instances. Amazon EBS volumes are off-instance storage that persists independently from the life of an instance. Amazon Elastic Block Store provides highly available, highly reliable storage volumes that can be attached to a running Amazon EC2 instance and exposed as a device within the instance. Amazon EBS is particularly suited for applications that require a database, file system, or access to raw block level storage.

So it seems as though, one should connect an EC2 with an EBS. Now all that's left to be done is have your database software (on the EC2) read/write the database data files on the EBS.

AWS has so many products and they all sound pretty similar. Not sure how Rackspace and the other cloud servers have something similar or not.

I'm still fuzzy if multiple instances of EC2s can read/write to the same EBS. Or if each instance of EC2s have their own EBS and then there's some other mechanism to keep all EBSs in sync.

I guess that would be a separate question...but just in case someone has further insight. Also, the e-commerce platform would be Spree/Rails with PostGreSQL/MySQL database...in case someone has further insight...

Thanks!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I wouldn't call this a simple question! The answers to your many questions certainly aren't simple. Load sharing and replication between databases (the two are different) is a complex subject and probably couldn't be answered in a few paragraphs.

However, let's see I can shed some light. Yes, multiple instances in setup 1 will work for mainly static content. Yes, this isn't feasible for an e-commerce site. Yes, there are ways of getting local databases to update a master copy.

If I were you I'd choose your e-commerce platform and your database, and then do research on that to see what options their are for scaling it up.

share|improve this answer
    
Thanks for taking your time and shedding some light. I've updated my question with a bit more details but for the most part, you've answered most of my questions. I'll ask any follow up questions in another thread, since I think that's the right thing to do..??? Thanks again! –  A L Jul 20 '12 at 1:33
    
Your questions about EBS should really go in a separate question as they are different to the original question about scaling. There are lots of resources about scaling rails, so you shouldn't be short of things to read. –  paulmorriss Jul 20 '12 at 10:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.