I’m developing a system that will have around 2k users and they will be communicating with an internal live chatting system.

Now I’m wondering if it’s a good choice to store messages as custom post type? Or it’s better to use custom table for them?

2 Answers
2

As far as I can see, the main problem you might have to deal with is having to store a fairly large amount of chat messages.

So to avoid making WP core functionalities querying post and postmeta from large amount of rows generated by your single functionality, it seems obvious to me you’d better create a custom table.

I believe this would also offer to you the possibility to optimize your table’s structure for your specific usage which would result in faster queries.

At this time, WP postmeta queries get very slow generally speaking, when they have to deal with a large amount of rows.
Look at the problem WooCommerce actually has when dealing with over 100k products which they store as post and postmeta. They’re on the way of fixing this by migrating all the products inside custom tables…

Leave a Reply

Your email address will not be published. Required fields are marked *