开发者

Local install or remote install of a MySQL database? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

Could someone explain the advantages and disadvantages of installing a MySQL database on a 开发者_如何学JAVAlocal machine compared to a remote machine (on a server)?

Thanks. L.


The main disadvantage of putting both application and database on the same machine is that they are then competing for the same resources (CPU, memory, disk). For many small applications, this is unlikely to be an issue. The main advantage is that you only need one machine and can balance resources between the application and database to suit. And connecting the two is slightly easier.

The main disadvantage of putting it on another server is that now you need another machine. But the main advantage is that you now have a lot more resources available and can configure MySQL to use most of the machine's resources. (The default settings are extremely conservative, suiting a shared install.) This also means the application cannot inadvertantly impact the database and vice-versa.

The relative importance of these differences is affected by the usage model. A local development environment can often get away with a local database. Usually you consider moving it to another box when multiple developers start needing to use it, but then, too, there's nothing wrong with every developer having their own, too. A production environment will probably want a separate server, but it depends on the application. A standalone, dedicated terminal will probably not need a seperate database. An internal website for fifteen employees might not, either. A public facing website for an ordering system almost certainly will.


Well, it depends on what you are going to use the MySQL database for.
Basically the MySQL Server is communicating over TCP/IP even on a local machine (unless you enable the PIPE option).

If the Server needs to be reached 24/7, yes a dedicated server machine would be the solution.

If it is for your own pleasure well, no harm in installing it locally. Only if you have a huge amount of data you would probably want a dedicated Server.

By installing it locally, you can block access to MySQL from your LAN through your Firewall. A server solution needs to open up the firewall to access MySQL.

I had one locally for years when I developed, but now when I have a dedicated web server I put the SQL server there as well.


  • your computer is used as a client, so you don't make connections with other servers (just your provider), thus is it more time efficient on a server

  • the support is better on a web hosting environment, so is the security

  • installing, managing a database server can get complicated, so the web hosting company offers you Mysql out of the box (no complicated configurations/installations)

  • you might want to shut down your computer once in a while, so the mysql server stops

  • your hardware and os is optimized for client work, not for a server, so it's not cost efficient

  • it slows down your computer

    The only advantage is if you also host your http server (or application server) on your computer, then you don't have to pay the web hosting fee. But it gets complicated, you can mess up easily and the electricity cost you more then a shared hosting (I did the math).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜