The following sections are excerpts only:
If we are to design the topic table and Reply table, the usual practice is as follows.
This allows you to extract topics directly using the paging algorithm when you get a list of topics, and you also need to jion links to topics,posts when you view a post.
The defects of this design are:
1. Topics table stores content contents, its volume will be very large, the large volume table paging, performance is very slow.
2. Join operation when displaying posts content, loss performance
The discuz approach is to design the following.
The content of the topics into the posts, while topics theme posts also as replies placed into the posts inside, this solves the above we put forward two questions. This is a typical example of violating the database design paradigm in exchange for better performance.
The above describes the Discuz link PHP discuz theme table and reply table design, including the discuz links, I hope that the PHP tutorial interested in a friend helpful.