I’m building a site that is a rental real estate community, with the core functionality orienting around city-specific discussion. There will be user data that specifies cities they’re knowledgeable about and what their relationship is with those cities (currently live there, used to live there, etc) and users will also subscribe to cities they want to invest in but are not knowledgable about. The cities will all be categories, with a custom field to mark their geocoded data so that users can browse cities on a map.
Where I’m a bit torn is how I should structure this from a DB efficiency standpoint. When you’re on a city page, I’ll be showing a feed that shows the “member experts” of that city. If I have to query all users and map through their custom fields and “expert cities” custom field hash every time I render a category page, I feel like that would be pretty dang slow, especially as the amount of users and cities grows.
If I were to build this in my own rails app, this would be easily solved with some join tables and model hasmanythrough relationships or something. What I’m wondering here is what the recommended approach is for a plugin that needs a join table. It seems that custom migrations and tables are discouraged and that it’s generally better to either use custom fields or PluginStore – I haven’t been able to find any real documentation on the PluginStore stuff but am currently in the process of digging.
Just thought it’d be wise for me to ask about the “official Discourse-recommended” approach before I go too deep in any direction.