For late-night people. Re: “Create BaceFook and TouYube”

Using your brains, and the knowledge acquired from the Databases chapter from your books — 

Think of an interactive/dynamic website you use often (rate.ee, Facebook, Gmail), and try to imagine the data model that’s used behind the scenes.

This is the basis of all things internet. Don’t be lazy.

••••••••••••

Example – Youtube.
(The following is a simplified version of things. And only an educated guess)

Videos

Comments

  • belongs to video
  • has author
  • has text, and time of creation

Users

  • identified by username
  • has email address, password, etc

Regarding the video view count — could be stored as a number (and has +1 added every time somebody presses play)
But this would allow bots to repeatedly load a video, and have the view count be very high, without the video actually being popular.
So YouTube must store every video view — for example:

  • video key (dQw4w9WgXcQ)
  • ip address
  • time

Now we can ignore repeated views from the same ip address, and it’s much harder to cheat the system.