Where to put my database

I'm currently busy implementing a website, database and software that will populate this database. The website is hosted by an external hosting company, the software runs on a local network server. The website should read the information in the database, the local software will put its results (this data) into the database.

Question: where will I put the database? What is the best place for safety and performance. And also what are the possibilities: if I put the database with my site on a web server, can I access my local download software? If I placed the database locally, can I access it from my site?

I am a programmer and I know about software and database implementation, but I know little about infrastructure, so please someone give me some tips.

Thanks in advance, Jethro

+4
source share
4 answers

That's a good question.

In terms of performance, I would optimize for reading done by the web server. There will be a proportionate amount of requests sent by the web server, and if the database is slow, the page will load slowly.

From a security point of view, connecting to remote databases can be dangerous. However, if you take the right precautions, for example, using an SSL key pair for authentication. Also, make sure that all user accounts in the database can only be used from your IP address that you trust.

There is another precaution when placing the database. There are a number of attacks that hackers can use when your web server and database are on the same machine. The best example is the outfile attack described in Hackproofing Mysql . If the database cannot be hosted on its own machine, you can use chroot or virtual machine.

+1
source

Both places? By setting up a unidirectional replication scheme, you can ensure that you always have a local copy of the data, but will not interfere with the performance of the remote site.

Replication can be managed either by your database or by your application.

0
source

For stability and performance, you should deploy the database closest to the production system, which in this case is your website. The backend software should hit the hosted server over TCP if you have decent security and bandwidth between them. This means that he prefers to have what is called point-to-point . An alternative is to create vpn over the Internet, which can be slow and unreliable.

Change By โ€œproduction,โ€ I mean client and mission critical, which may be wrong for your business. Who is the audience of the two systems? Which one is more important to be stable?

Using point-to-point or vpn, you can pretend to be pushing a computer through a local area network. However, the speed will depend on how much you spend per month.

0
source

You ask about stability and performance, but, as always, it is a matter of compromise, so you need to decide what is more important in these terms - a website or software.

I assume that the website (thinking why you upload information to the database anyway) and from this point of view put the database near you on the website (with the hosting company, most of which provides this service).

This will allow your website to access data faster and therefore increase the stability of your system (less chance of timeouts)

The price you pay, of course, is with the software, which should now connect remotely to the database.

Another consideration is the amount of data - if, for example, you expect the software to actively use the database and the website to be economical, you might consider changing the approach.

The latter - regarding remote access to the database - you can, of course, just connect to the database โ€œnormallyโ€, but I would probably think about packing it in a web service, which will allow you

  • To have more flexibility regarding the location and implementation of the database
  • Using widespread protocols such as WS- *, you can achieve higher security without the need for infrastructure such as VPN

Again - depending on what part of the database access will be remotely, you must choose which side to set as a service. this, of course, is potentially less suitable for large data downloads.

0
source

All Articles