I've been tearing my hair out trying to figure out how to code a messaging system capable of the following:
- Multiple recipients, where the recipients can not see other recipients, but only the sender. In the sent messages, the sender sees messages sent to multiple recipients in one thread, rather than in a billion separate threads.
- Relatively lightweight queries (we have relatively 20,000 users - about 10% of which regularly send messages to 200-300 people at once).
Our current system is incredibly inefficient, and the queries are killing our servers with excessive joins. I'm looking for conceptual advice on crafting a scalable threaded messaging system in PHP and MySQL - what sort of database structure is best, how to store recipients, best practices for queries. Can anyone help?!
Thanks!