MySQL different HD handling?

Started by
2 comments, last by markr 18 years, 8 months ago
Hey everyone, I have my database system currently running off of my one and only server that's running my website. I just realized that with all these users taking up space on the HD, I would have to support multipule HDs (I've already done this) for storage purposes. However, once the first HD runs out of space the MySQL runs out of space to save into. What should I do? Thanks in advance.
Advertisement
1) get a bigger HD and migrate your DB over.

2) what we did at my old company was to parallelize the database because we were running out of possible giant servers we could buy. You basically split all your data onto n databases. Our site had it's data driven primarily based on userID. So we took half the users and put them and their data on one DB and put the other half onto another. Going forward we would load balance users across available DBs as they registered. At any point we could just hot-plug in a new DB and the load balancer would fill up the new DB. This new architecture required that we have one central database that contained maybe 2 tables and acted as a traffic controller. Those tables simply told the requester on which database any given user lived so the session could continue.

I don't know your data-set so it's hard to say what bumps you'll run into. We had to create some "ghost" objects on the parallelized DBs that linked across DBs for things like a friends list and such (in the case where friends were on different DBs).

(it's early, haven't had coffee yet. sorry if point #2 didn't come out clearly)

-me
...and in addition, I find it useful to keep track of active users and get rid of old ones. A user hasn't logged in for a year? Send them a warning about their account being in danger. No reply within a week? delete it. Something like this can be somewhat automated, depending on the database. I don't think MySQL has triggers or I don't know about them.
You should probably ensure that no partition ever becomes full; but if one does, you ideally want the one where you place your web logs to become full first.

The one which people dump their junk in should become full next,

Then the partition that your MySQL data etc is stored on should become full last.

To achieve this, you'll have to ensure that your

- Web access logs
- User file storage area
- MySQL database storage area

are all on different partitions.

It might be handy if the OS files / logs are also on a different partition (or you could share it with MySQL).

By "users" do you mean users of your web application, or people who are creating their own web applications? Do the users have their own storage area?

No, MySQL does not have triggers*, nor can you use a trigger to trigger or something not happening anyway. Plus even if you could, you probably wouldn't want to.

Mark

* In any version which has been released in a production-ready state.

This topic is closed to new replies.

Advertisement