Let's take a look at the source code of excellent online programs, analyze the advantages and disadvantages, and quickly improve our level. The following is an excerpt:
If we design the topic table and reply table, the common practice is as follows.
In this way, you can directly use the paging algorithm to extract Topics when obtaining the topic list. when viewing a post, you also need to link Topics and Posts to jion.
This design defect is:
1. the Content stored in the Topics table will be very large in size and paging the large-volume table will lead to slow performance.
2. when the Posts content is displayed, the join operation is performed, resulting in consumption performance.
Discuz is designed as follows.
Split the Content in the Topics into Posts, and place the Topics topic Posts as replies in Posts. This solves the two problems we raised above. This is a typical example of violating the database design paradigm in exchange for better performance.
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