社交网站所需的数据库架构帮助
我正在创建一个像 facebook 这样的社交网站,并被它的数据库模式设计所吸引。根据我在这里发布的之前的问题,我确认我无法为注册的新用户创建新的数据库或表到我的网站。我需要插入新行[这是我唯一的选择(如果我错了请纠正我!)]。但是,这是第一次注册。如果用户在他的个人资料上发布了新内容怎么办..我应该在哪里插入此更新..因为,我无法将它们插入到与每个用户相对应的行中..并且无法创建太多列..解决方案是什么这。?
架构 =>
表名称: User_content
userId 名称 大学城市 Status_Updates 消息
1 a sfd fds fsds sdds 2 f dfg dfd fdf dfd
如果用户 1 更新了一些东西怎么办..我需要做什么。认为这是一个状态更新,该怎么办?
I'm in middle of creating a social networking site something like facebook, and got struck up with database schema design for it.. from previous questions i posted here, i confirmed that i cant create new database or tables for a new user who registers onto my site. I need to insert new row [thats my only option(correct me if i'm wrong!)]. but, this works out for registration for the first time. what if the user posts something new on his profile.. where should i insert this update.. coz, i cant insert them into rows as dey correspond to each user.. and too many columns cannot be created.. what is the solution for this.?
schema =>
TableName : User_content
userId Name College City Status_Updates Messages
1 a sfd fds fsds sdds
2 f dfg dfd fdf dfd
what if user 1 updates something.. what i need to do nw. Think its a status update, how to go about it.?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您开始考虑这个社交网站之前,您梦想如果
开发时您需要了解数据库建模基础知识。此链接将帮助您了解一些简单的概念。 http://www.databaseanswers.org/tutorial4_data_modelling/index.htm
Before you start thinking about this social network site you dream if
Developing you need to understand database modelling fundamentals. This link will help you with some simple concepts. http://www.databaseanswers.org/tutorial4_data_modelling/index.htm
根据您希望允许用户执行的操作以及您需要存储的相关数据来添加表。一些示例表:
I 引用有一种感觉,这是您的第一个主要数据库应用程序,如果是这样,那么您需要在开始创建这样的应用程序之前了解有关数据库设计的更多信息。设计数据库模式时需要考虑很多事情,从一开始就设计好是关键。应用程序的核心将取决于数据的组织和可访问性,因此请确保您花费足够的时间来开发良好的设计。
祝你好运!
Add tables based on what you want to allow your users to do and the related data you need to store as a result. Some example tables:
I have the sense that this is your first major database application, and if so, you need to learn more about database design in general before you take on creating an application like this. There are many things to consider when designing a database schema and designing it well from the start is key. The core of your application will rely on how well your data is organized and accessible, so ensure you spend enough time developing a good design.
Good luck!