dimanche 12 février 2017

What takes up the most space in the database

Vote count: 0

I'm Building a website that also contains a forum. The part I'm missing to build is the "post view counter", but I'm not sure what way I should go.

I've 2 ways i was thinking about using in my head, but what would be best and would there be a difference in the Space each option use in the database

Method 1:

PostId | UserId's (seperated by , and max 200 users per row)
-----------------------------------
   1   | 1, 2, 4, 5, 9, 10, 220
   2   | 1, 2, 4, 5, 9, 10, 220

Method 2:

PostId | UserId
-----------------------------------
   1   | 1
   1   | 2
   1   | 4
   1   | 5
   1   | 9
   1   | 10
   1   | 220

Does these 2 methods take equal size in the database? or would there be a option that would be way better to store the data about WHO has viewed what post?

asked 20 secs ago

Let's block ads! (Why?)



What takes up the most space in the database

Aucun commentaire:

Enregistrer un commentaire