2
2
2slide2014-01-25 19:37:46
MySQL
2slide, 2014-01-25 19:37:46

What is the best way to design a MySql database for multiple TB?

Plans to create a social network. For a certain circle of people.
LAMP (apache mysql php) will be used.
According to estimates, the database will be filled with 100gb per month.
What is the best way to design a database.
1. One base or several, one for articles and another for comments ..?
2. How will MySql behave with such volumes? (all pages of the site will be cached and made friends through ajax).
3. If you create several databases, for example, for comments, then how to search for the desired database for output? (create a linking database with indexes where the address of the database server will be stored, and then connect and display the necessary records. Maybe so?
I would be grateful for your help.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
SkyTaurus, 2014-01-25
@SkyTaurus

Here Dmitry Borodin CEO TopFace describes how to do the architecture spb-borodin.livejournal.com/596.html

S
Sergey, 2014-01-25
@edinorog

Social media is evil. You don't need to multiply them. =)

V
Vlad Zhivotnev, 2014-01-26
@inkvizitor68sl

> How will MySql handle such volumes?
Fuck it will behave in a couple of months (well, or in 4 months if you have 256 gov of memory).
On the other hand, you will not have 100 GB per month there. And if it does, then stop storing pictures and other nonsense in the database.
> If you create several databases, for example, for comments, then how to search for the desired database for output?
if comment_id < 1000000 and commend_id > 0 then use mysql1
if comment_id < 2000000 and comment id > 1000000 then use mysql2
More or less like this. In general, this is called sharding, how to organize it is up to you. Usually they make a metabase in which they store ranges of id-shniks and correspondences with a specific server. In addition, the load on servers with old comments will be less over time and they can be "resharded" - i.e., for example, merge 3 old databases into 1 and edit id-nicknames in the metabase. And put 2 free servers under the record for new comments.
> One base or several, one for articles and another for comments..?
A dead-end path if the amount of data becomes more than a certain threshold.
There will be a lot of articles - mysql will be bent with articles, there will be a lot of comments - ....
In any case, you need to divide by the type of stored data and shard.

N
NewTypes, 2014-01-25
@NewTypes

Someone somewhere is definitely lying. How can half a million users generate 100GB in a month? Can you write the service "on the Internet by passport" by order of state structures? Where for each bunch - a mandatory log.
Do you need mysql?

E
Egor Kazantsev, 2014-01-26
@saintbyte

Well, well, VKontakte data weighs about 1TB and VKontakte is for everyone. So don't fantasize about a few TB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question