English 中文(简体)
I designed an architecture for web app running on single computer
原标题:

I am planning to build a web app running on a single computer and exploit the hardware resources as efficient as possible. The logic of app will not be complex. The following is my design:

OS: Linux (CentOS 5)

Web Server: Nginx

Web script: PHP

Database: Tokyo cabinet + Tokyo Tyrant

Index: Sphinx

I am not going to use RDBMS such as MySQL, cause I think a key-value store (Tokyo cabinet) with a indexer (Sphinx) will meet all the needs to deploy a normal web app, also with better performance than MySQL.

My question is: is this design to be the an efficient architecture for a single computer? Or how to improve it?

(I know this question might to be subjective but I really need your help)

Thank you very much~

EDIT:

The computer I am going to host my app on, is a normal PC, like 8GB~16GB memory, 500G~1TB Hard disk, etc. I think it won t need to consider the "scalability". Every first step of a web app is started from one machine and it will always the beginning.

最佳回答

Choice of DB

I think that the choice of type of database you make depends less on how many computers the system is hosted on. I think this should be more a function of the quality of data that you want/need to preserve.

For example, if you need to store the shipping addresses for a customer, you will need to account for that in your storage structure. A name value pair may seem an easy enough structure to begin with, but if you foresee any of the following, you should consider moving to a standard database system

  • keeping track of changes
  • reporting activity / reports
  • concurrent users

Performance

This is dependent on your code, images, content, caching, etc just as much as it is on your database.

问题回答

well, one way to see is to load test it: http://grinder.sourceforge.net/

I ve never worked with Tokyo cabinet, but if it s functionally sufficient, then it will probably be significantly faster then a DB.

In the long run though, any savings you realize by tuning your app to work on one box will be quickly lost when you start to scale beyond that box. trying to add a lot of caching, and hacks to get the app to be faster will only go so far. More importantly you should try to think about how easily you can decouple the various layers.





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签