When posting a post, a website usually needs to operate on multiple data tables. For example, to post a post, you need to insert the post table, and then insert the post tag post_tag relational table, insert the post_user post follow table, update the number of posts in the tag table, and update the number of posts in the user table... when posting a post, a website usually needs to operate on multiple data tables. For example, to post a post, you need to insert the post table, and then insert the post tag post_tag relational table, insert the post_user post follow table, update the number of posts in the tag table, and update the number of posts and points in the user table. Are these operations performed on multiple data tables completed at one time, or are other methods used? It takes a long time to complete the task at one time. A message is also sent when a reply or comment is posted. When displaying a post, you must update the page views of the post. I don't know what the role of beanstalkd is. I have seen this in the official php phalcon framework sample forum. I don't know if it is useful for solving these problems?
Reply content:
When posting a post, a website usually needs to operate on multiple data tables. For example, to post a post, you need to insert the post table, and then insert the post tag post_tag relational table, insert the post_user post follow table, update the number of posts in the tag table, and update the number of posts and points in the user table. Are these operations performed on multiple data tables completed at one time, or are other methods used? It takes a long time to complete the task at one time. A message is also sent when a reply or comment is posted. When displaying a post, you must update the page views of the post. I don't know what the role of beanstalkd is. I have seen this in the official php phalcon framework sample forum. I don't know if it is useful for solving these problems?
The website performance lies in the database, but for many websites, there is not much data written at the same time.
You can perform the following Optimization Based on your situation:
1. Data Association Optimization
The association between post and tag can be simply saved to the IDs of the two,
Post_tags, 101xxx, 103xxx
2. asynchronous processing of points and notifications
3. Use the cache to process frequently read/write data
The browser views can be written to the cache first, and then written to the database once per 50 browser views, for example, based on the actual situation.
Generally, it is based on the transaction integrity of the operation. If the operation is complete, the background is completed at one time. If not, you can complete the operation in multiple ways, as described in multiple methods on the first floor!