How is the database designed for the message board in the QQ space?

Source: Internet
Author: User
How is the database designed for the message board in the QQ space? I don't know the database design of the QQ space? Can any friend receive an unlimited number of replies?



Reply to discussion (solution)

Reply ID reply_id,
Post ID note_id,
Parent ID parent_id of the reply ID

Not afraid of buildings in the building, as long as the ownership is marked clear

The adjacent list and the pre-order traversal can all be modified.

Reply ID reply_id,
Post ID note_id,
Parent ID parent_id of the reply ID

Not afraid of buildings in the building, as long as the ownership is marked clear

Can I list the most basic tables or give me a link?

The adjacent list and the pre-order traversal can all be modified.

Isn't the adjacent table in the data structure? Can you help me design the table?

Id, whether posted or replied, each post must be uniquely identified.
Id of the pid to be replied

The link is complete. just traverse the number.

Extension:
Mid Post id, which can narrow the search range

Pre-order: pre-order traversal, also known as left and right values, records the start and end IDs of a post.
Median sorting: it is derived from the "one-foot-length" of Zhuangzi, which takes half a day and is inexhaustible. However, because a computer can only represent a limited number, it cannot be "unlimited"

Id, whether posted or replied, each post must be uniquely identified.
Id of the pid to be replied

The link is complete. just traverse the number.

Extension:
Mid Post id, which can narrow the search range

Pre-order: pre-order traversal, also known as left and right values, records the start and end IDs of a post.
Median sorting: it is derived from the "one-foot-length" of Zhuangzi, which takes half a day and is inexhaustible. However, because a computer can only represent a limited number, it cannot be "unlimited"



It is equivalent to a news publishing system, but the user and the user can reply freely, just like the QQ space !!
Can you help me? My design is as follows:
There are three tables in total:
User table: tb_user;
Id // increment
User_name // User name
User_paw // password

Article table: tb_news:
Id // increment
User_id // The Author's id
Title // title
Content // content

Reply table: tb_message
Id // increment
Parent_id // I do not understand deeply
User_id // message holder id
News_id // The id of the message in which the message is sent

I don't know if such a design can work. I wrote something myself, so I can only share messages with each other.

Look at answers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.