How to create 1000 subcategories in a scalable way?

AI-generated summary

The discussion revolves around creating 1000 subcategories in a scalable way on a Discourse forum. spocksplanet faces a problem with page load time due to preloading all subcategories as JSON objects. To address this, they plan to implement an autocomplete-like widget, but seek advice on existing solutions and implementation tips.

Other users suggest alternative approaches, such as using the tagging plugin codinghorror, but spocksplanet requires features like user monitoring and security permissions, which the tagging plugin lacks.

After explaining the use case - creating a discussion board for schools with each school as a category - cpradio suggests using multisite instead, where each school would be a separate site with its own categories. spocksplanet expresses concerns about multiple logins, but cpradio clarifies that multisite instances refer to the same database.

cpradio provides resources on configuring multisite and raises a question about user sign-up and multisite instances, seeking neil’s input. spocksplanet considers multisite as a viable solution and explores the possibility of hacking the multisite plugin to mitigate resource overhead.

I’d like to create a lot of subcategories for a handful of top level categories. But I have a problem: Discourse preloads all the subcategories in the body of the page as JSON objects and this is seriously affecting the page load time. It’s not scalable.

I’m planning to implement an autocomplete-like widget to replace the subcategory dropdown. I just wanted to reach out to a) ask if anyone knew of something like this already and b) tips on where to get started for a feature like this.

Sounds like you want the tagging plugin, not actual subcategories.

إعجابَين (2)

Well, I’d also like the users to monitor the discussions from the categories and have some security permissions around the posts, too. The tagging plugin won’t let me do those. The alternative is to just create my own category plugin that replicates all the functionality of categories, which is going to be the last resort.

إعجاب واحد (1)

I am still not following, can you make this a bit more concrete explaining what it is you are doing that requires this immense level of categorization ?

If you want 2000 subs it sounds like you want stock ticker symbols, am I right (because that would be around the right count)?

Let me know because I have additional things you need to consider. If not disregard.

I am creating a discussion board for schools. Each school is a category within the larger system of schools. The notion of category fits really well in this use case. If only the categories weren’t pre-loaded in the page, I could just fly with it.

Actually, I think multi-site would fit better here. Each school would be a site with their own categories.

إعجاب واحد (1)

Doesn’t multisite require multiple logins? I assumed you’d need multiple user accounts across different sites with that approach.

I’d have to run a test, but I think they all refer to the same database, they just separate the categories, topics, posts by site. I’ll see what documentation I can find.

So here is how to configure it

Then there is this topic
https://meta.discourse.org/t/can-multisite-instances-communicate-with-one-another/8984

But it doesn’t quite answer if signing up pushes your user to all sites defined in the multisite.yaml… @neil, can you answer that?

إعجابَين (2)

Thanks! I’m still trying to figure this out, but multisite might be good for my use case. I think you could use postgres schemas to mitigate some of the resource overhead. And you also would need to make some tables shared by all schemas, though. So maybe I should try to hack the multisite plugin rather than creating a new category plugin.