How to create 1000 subcategories in a scalable way?

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.


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 Like

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 Like

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

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?


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.