Why is it not advisable to have the database and web server on the same machine?

前端 未结 18 1707
夕颜
夕颜 2020-12-07 06:44

Listening to Scott Hanselman\'s interview with the Stack Overflow team (part 1 and 2), he was adamant that the SQL server and application server should be on separate machin

18条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 07:38

    Arguing that there is a real performance gain to be had by running a database server on a web server is a flawed argument.

    Since Database servers take query strings and return result sets, the data actually flowing from data server to web server is relatively small, but the horsepower required to process the query and generate the result set is relatively large. Optimizing performance around the data transfer time therefore is optimizing around the wrong thing.

    Regarding security, there are advantages to having the data server on a different box than the web server. Having such a setup is not the be all and end all of security, but it is a step in the right direction.

    Regarding scalability, it is easy and relatively cheap to add web servers and put them into cluster to handle increased traffic. It is not so easy and cheap to add data servers and cluster them. Also, web servers and data servers have different hardware needs, so multiple boxes help out with scalability.

    If you are starting small and have only one box, then a good way would go would be to use virtual machines. Running the web server and data server in different VMs on one host gives you all the gains of separate boxes at the cost of one large box price.

提交回复
热议问题