Web hosting - My SQL question

Hi fCC family,

I have my first freelance job and I’m trying to decide on the best web host for them. One of the topics I have the least understanding of is MySQL, I know it’s an open source database system and I often see it in tandem with Wordpress… My questions are…

  1. Is a shared My SQL Database secure and safe to use?
  2. Are there any particular reasons why you might want a private one?
  3. Are there any reasons why you may need more than one My SQL database?

This deal is from the cloud hosting company OVHCloud. Has anyone used them before and have any feedback on them?



If my understanding of what they mean by “shared” is that the database process runs on the same machine as other database processes. This is where the “database process” is the actual daemon, or program that manages the actual data, and is what your code connects to.

The advantage of this is you can run multiple database instances for multiple people on the same machine. However the main downside is everyone is “sharing” that machine, so if one person is doing a lot of work, and thus using the CPU or RAM, yours might “collide” with the work and slow everyone down.

The cost benefits usually are pretty good, as the hosting provider can more easily share their infastructure. I suggest to review the requirements, if they are simple and wont require dedicated infrastructure, the cost savings are probably worth it.

A private one means you get your own “machine” on the hosting providers infrastructure that can use all the RAM and CPU cycles it wants, and it wont matter what other people are doing as you essentially have all the “machine” to yourself. However, this also means paying for that whole machine all the time. Hence why this is more costly.

You’d want to go this route if the unreliability of a shared instance could impact your app. If things are slow with a shared instance due to the other people “sharing” the system with you use it often, or your requirements require faster database processing, then paying for a dedicated one will make things vastly more reliable.

Essentially if you have 1 database that means that database must hold/process/provide for everyone. If your requirements are something very database heavy having a single instance wont work well.

For example, some large applications that are global scale have multiple instances of databases that work together. An application like Discord needs to save billions of messages essentially forever, as such it uses multiple database instances behind the scenes.

This might not be as important to you depending on the requirements. If you have simple requirements for a Wordpress app, you should be fine with a single instance. I’d still look into back-ups incase something goes wrong, but having 1 instance should be ok.

1 Like

Thank you so much for your reply here @bradtaniguchi . I’m so grateful for your detailed explanations. I have a couple of questions off the back of your answer if you don’t mind helping me to clarify what you have written.

From what you have written, I understand that my MySQL database will be contained on a parent database that holds other peoples MySQL databases is that correct?

I’m not clear on if MySQL x1 (200MB) is one instance or if it is one parent database that can hold multiple instances.

Last question following on from the second…

Could I use MySQL (shared): 1 x 200MB to run multiple projects with different data and logic or do I need a different MySQL for each project. It sounds from what you’ve said as if I can use one database to direct multiple small projects?

Thanks again! :smiley:

Your MySQL database will be one MySQL database running on what is essentially a computer in a server-room somewhere your hosting provider manages for you.

There is no “parent database”, a database is like any other program. The same way your computer currently is running multiple programs, you can think of your hosting provider as the same thing, except optimize for specific programs.

I’m not too sure, as it has been a few years since I’ve worked with MySQL. Its possible you can have multiple application using the same MySQL instance and not interact with the same data/tables, but I’d look more into how the hosting provide provides you access to your database.

(I’m about to use the term “database” to describe a database you’d create within a MySQL instance, which can be confusing, just bear with me.)

My assumption is they give you full access where you can create multiple databases within your single MySQL instance. This would be similar to having multiple “profiles” within your web browser, where the underlying system is the same, but the data/bookmarks your accessing is different depending on which profile you open it with. Regardless of which profile your using, the browser/MySQL instance is still the same program instance, and thus your “sharing the application with yourself”.

However this assumes they give you full access and control to a MySQL server instance, including admin rights to create your own databases within a MySQL instance. They might not actually do that and are actually the ones giving you the “nested” database access, if this is the case, you’d have to get wonky to use the same database for multiple apps.

So overall you can think of it as different layers:

  1. The actual “computer” everything is running on can be shared
  2. The actual MySQL instance can be shared
  3. You could technically share the same database within MySQL, but this would get confusing and potentially ugly.

Ultimately there are a lot of possibilities of how things are setup, as there isn’t just “one way things are done”. Even something as simple as “the computer is shared” might not be real, as it could be some Virtual Machine running within the cloud in some datacenter somewhere.

Hopefully that clears some things up :slight_smile:

1 Like

This has been really helpful @bradtaniguchi So helpful that I’m going to bookmark this for reference. Thank you! :slight_smile:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.