简体   繁体   English

社交网站所需的数据库架构帮助

[英]Database Schema help needed for a social networking site

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. 我正在创建一个类似facebook之类的社交网站,并为此感到惊讶,因为我在这里发布了以前的问题,我确认我无法为注册新用户创建新数据库或表。到我的网站上。 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.? 如果用户在其个人资料上发布了新内容,该怎么办。.我应该在哪里插入此更新..因为我不能将它们插入到行中,因为dey对应于每个用户..无法创建太多列..解决方案是什么这个。?

schema => 模式=>

TableName : User_content TableName:User_content

userId Name College City Status_Updates Messages userId名称大学城市Status_Updates消息

1 a sfd fds fsds sdds 2 f dfg dfd fdf dfd 1 a sfd fds fsds sdds 2 f dfg dfd fdf dfd

what if user 1 updates something.. what i need to do nw. 如果用户1更新了什么,我该怎么办? Think its a status update, how to go about it.? 认为它是状态更新,如何处理?

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 http://www.databaseanswers.org/tutorial4_data_modelling/index.htm

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: 一些示例表:

  • 'user_account': User account information (e-mail address, password) - referenced by user ID 'user_account':用户帐户信息(电子邮件地址,密码)-由用户ID引用
  • 'user_profile': Basic user profile information - referenced by user ID 'user_profile':基本的用户个人资料信息-由用户ID引用
  • 'user_status': User status message - referenced by user ID 'user_status':用户状态消息-由用户ID引用

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! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM