I see many implementations, such as Facebook, karma forum, mark, as read on forum posts and other simple parameters and options available to several users on this element.
I know that I can implement this in mysql by creating a table in which links indicate message identifiers in order to match user identifiers, for example, a similar system.
My problem is that on a page with a lot of posts, I have to look for all the posts. I use prepared statements to make it faster for me.
Is there another way to implement these systems, if not, are there optimizations such as database types or other settings that can make this faster?
In principle, there is a powerful, fast implementation of the interaction of many, many databases.
* EDIT ***
I am using opera mini, so I have problems with ajax and js for comments
Now I have a table with two columns. One for the user id and one for the post post. Both are indexed and used in external key constraints. I am going to make a complex primary key on two.
My main problem is karma. I allow users to vote on each post. The problem is that for each message I need to get the total number of votes, determine whether the user voted to allow or not to vote.
My site allows many users to host their own sites, so I need to seriously optimize this.
- .
NOTE **
memcached.