0

I want to create a database containing information about which user downloaded which file. Since I have more than 4000 files and number of users is increasing constanly, how can I store so many columns?

Shadow
  • 33,525
  • 10
  • 51
  • 64
rysroma
  • 13
  • 5
  • Learn about normalisation. You would have a record which has the file ID(or name) and the user ID. – Nigel Ren Jun 25 '21 at 16:29
  • 1
    as @NigelRen mentioned, create a table of all users, a table for all files and then have a "user_files" table that links a users id to a file id. data foot print is pretty small – DevWithZachary Jun 25 '21 at 16:33
  • Its not about normalisation. Even if I normalise I would have to use an array for multiple ID per user or make 4000+ columns for each ID. – rysroma Jun 25 '21 at 16:46
  • It is about normalisation as it offers standard pattern for many to many relationships – Shadow Jun 25 '21 at 19:04

1 Answers1

0

I would suggest using "InnoDB, NoSQL with Memcached API". It works really well with both MySQL 5.6 and 5.7. Here is the documentation with the 5.6 version... https://dev.mysql.com/doc/refman/5.6/en/innodb-memcached.html