Can I create each table for each user on my website on a social network?

I am creating a social networking site with features similar to Facebook. I want to start by designing a schema for my database. I decided to create each table for each user who registers on our site .. Am I right?

If a million users register on my site, a million tables will be created. How to continue optimization? Please suggest me methods to overcome this, and some links or books to learn about such concepts will be helpful.

Thanks at Advance.

+4
source share
4 answers

This is not how you want to do it.

, , (, 'users'), . .

, - :

 TABLE users
   - username AS VARCHAR(255)
   - password AS VARCHAR(255) (use a hashed password, of course)
   - ...

, , , , users .

+7

. , ( , ). , , , , .

, .

+2

, , ( ), ( ).

  • . ( )
  • , , , , . - , - , - , - .. .
  • ( ) - , () . , : NAME, SURNAME, AGE .. , .
  • ( ) . "" . , - , {NAME:"John", SURNAME:"Smith", AGE:"32"}.

, . , USER. , : , , , .., : NAME, SURNAME, AGE, ADDRESS .. . , .

0

@ Nathan Usman asks, but wouldn’t this be a very complicated scheme if we wanted to record this user's daily transactions, like likes, messages he added or purchases he made in the past, or the number of friends he has? how many sub-tables do we need to do in this case, is it effective?

0
source

Source: https://habr.com/ru/post/1789355/


All Articles