Many database rows vs one comma separated values row

后端 未结 4 1548
萌比男神i
萌比男神i 2021-01-04 13:02

I\'m creating a table for allowing website users to become friends. I\'m trying to determine which is the best table design to store and return a user\'s friends. The goal i

4条回答
  •  庸人自扰
    2021-01-04 13:41

    Breaking from 1st normal form is usually not desirable because

    1. Easy to Orpahned ids
    2. Easy to insert invalid data types
    3. Updates can require full table scans
    4. Increases concurrency issues
    5. No way to create the key (user_id, friend_id)

提交回复
热议问题