1

Hi I was wondering the best way to setup my current application. Here is the general rundown.

I have a phone application that uploads and downloads photos from a vps that will store the files statically on it.

The phone application does a webrequest to a script which queries a local database for a photo filepath which then gets returned which then after the phone makes another request back to the same server for photo.

This server is also used to house the website.

I was wondering what is the best way of splitting off the functionality. From what I understand I should get another server which just houses the database and have scripts on the vps which query the database server. Should I store the photos on the database server as well or should that be on the server that houses the database?

Also would I be needing a ec2 server or would a general vps like thrust work for something like this?

  • 2
    It depends what you want to achieve. To improve performance? To ensure scalability? For security reasons? Because the new VP read about it in Information Week? – Thilo Jul 17 '11 at 21:13
  • It's to ensure scalability. I am about to do a trial run which will involve roughly 600 phones and I just want to ensure it doesn't crash. –  Jul 17 '11 at 21:25
  • 1
    To ensure scalability you should make them separate processes, and keep an eye out for storage, but there's no reason you have to have several servers from day 1, except maybe to prevent a SPOF. – Wrikken Jul 17 '11 at 21:57

1 Answers1

0

Yes, general web scalability practices use separate web, database and file servers. However, don't just blindly do it now without knowing where your performance and scalability bottlenecks are.

You need to benchmark and profile your app before you start making changes. Make it work, then make it fast.

Also, you can probably handle a reasonable load on one server with appropriate caching and tuning of each layer (web, database, file system).

Ryan Doherty
  • 116
  • 2
  • Thank you for the response. What is a good method to test performance / bottle necks with php? I've only used apache bench to see what the server can handle and it seems alright. Are there any standard methods to test these things? –  Jul 18 '11 at 02:48
  • Use xdebug and webgrind (http://xdebug.org/, http://code.google.com/p/webgrind/) for PHP profiling. They will show you exactly where your code spends most of its time. – Ryan Doherty Jul 18 '11 at 05:44