序列化一个数组来存储它与在 mysql 中创建一个特定的 table
Serialize an array to store it versus create a specific table in mysql
我想知道哪种解决方案更有效(或者当然知道另一种更好的解决方案)。如果我有一个网站,任何用户都可以为每个 post 发表评论,那么更好的解决方案是什么?
Serialize an array with all comments for that post in a column of database (I don't know if it is possible that two users leaving a comment at the same time can lead to data loss)
或者以下可能更好:
Creating a specific table called comments, where I have an unique id for each post and other unique id for each username
我听说有些人不喜欢使用序列化功能,但我不知道他们使用它是否是个好主意
Table。评论 table 与您的帖子相关并且没有替代品。
创建、更新、删除特定评论和搜索的操作使用序列化到单个字段变得很痛苦。
我想知道哪种解决方案更有效(或者当然知道另一种更好的解决方案)。如果我有一个网站,任何用户都可以为每个 post 发表评论,那么更好的解决方案是什么?
Serialize an array with all comments for that post in a column of database (I don't know if it is possible that two users leaving a comment at the same time can lead to data loss)
或者以下可能更好:
Creating a specific table called comments, where I have an unique id for each post and other unique id for each username
我听说有些人不喜欢使用序列化功能,但我不知道他们使用它是否是个好主意
Table。评论 table 与您的帖子相关并且没有替代品。 创建、更新、删除特定评论和搜索的操作使用序列化到单个字段变得很痛苦。