What's the maximum number of categories we can have?

I’m considering using Discourse as the backend for my website and app, but I haven’t seen any documentation on its scaling limits.

What’s the maximum number of categories we can have? Is it 1000? 10,000? 100,000?

I plan to heavily use the API and create a custom frontend for both web and mobile. Part of this is programmatically creating a new Category whenever a user wants to. So it’s more of a backend systems question than the UI.

For example, will the /categories.json endpoint scale? It doesn’t seem paginated.

Thanks!

500 to 1000 is safe

If you need more consider tags

Additionally you can have a very large number of groups

Thanks @sam! Follow up question – what would the approximate limits be for:

  • the number of tags
  • the number of topics in a category

For example, can I have a few million unique tags, as well as a few million topics within a single category?

The tags, topic_tags, and topics tables don’t appear to be sharded, which should work for a few million rows, but I haven’t looked into the queries themselves, nor any UI that could potentially break.

Is there a table somewhere showing this kind of information?

The default post size is 32000 characters, for example, but what is the absolute max, what is the practical max?

Hi! Just wondering if you found the answer to this? Specifically I’m also wondering about the max number of tags.

Determining a “maximum” depends on what you consider to be the limiting factor.

I don’t see a problem with PostgreSQL
PostgreSQL: About

Maximum Table Size 32 TB

Even with optimal indexing, query speeds will at some point take “too long”. What that is will vary from person to person.

Then there’s Ruby, Ember, bandwidth and browser limits. Feel free to research, but I wouldn’t worry about those.

I think that long before any software limits are reached “sane” limits will have already been passed. And what that would be will vary from person to person and how they interact with the information.

tl;dr You will break your users long before you break any code.

I have 2500 categorys and my demand up to 3000 category, can i continue?

Personally I never subscribe to a site that has 2500 categories.
Virtually you can create all the categories you want but your site will only be confusing and not navigable.

Note that an official answer has already been given to your question and also an alternative to using categories.

The problem of categories in the first place is the problem of transparency and navigation for users. Working previously on the catalogue dmoz.org and making categories for Russian directories, we are faced with the fact that with a large number of categories, problems arise in users. A large number of categories, it’s like there are no more categories. They become unnecessary, impossible to use. Nobody understands the structure of the site, including those who did it. I think that’s the problem.

Navigation should be navigation, and if it loses its functions, it is sad.

抛开用户界面(UI)方面的考量,我很好奇当分类数量达到1000+时会出现什么情况。响应时间是否只是平均略微变长,还是会引发灾难性的后果?这个问题能否通过升级硬件来解决?

和原作者(OP)一样,我正在开发一个项目,其中可能轻松包含数千个分类。该项目重度依赖基于组的权限管理,单个用户通常只能看到少数几个分类(这也是我无法使用标签的原因)。因此,我并不太担心用户界面会显得过于繁杂,但我希望了解在如此高的分类数量下,性能瓶颈究竟在哪里。

说实话,可能不会有什么严重问题,除非你是管理员并且能访问 1000 多个类别。到那时,我们会在你的第一页中推送所有类别的 JSON 数据,导致类别页面在服务器端和客户端都会变慢。

关于此:
如果我有数百到数千个分类,是否有选项可以限制搜索结果的数量?
我的问题:由于分类数量庞大,在创建新主题时点击下拉菜单,或在订阅时搜索分类,会出现较长的延迟(数十秒)。

我知道在类似场景下,我们可以通过标签选项来限制结果数量。分类是否也有此选项,或能否实现相同的功能?

你好 @Tayyab_Anwar

我刚刚为你检查了数据库,数据库中没有与限制分类(用于搜索)相关的设置。

UI 中确实存在一些可用的限制功能(如你所知):

因此,看来你需要创建一个插件,以添加额外功能,从而根据分类及相关条件限制搜索结果。

希望这能帮到你。

能否分享一些关于托管所需资源的数字?
您通常使用多少内存和 CPU?

另外,用户体验如何?加载速度有多快?是否存在某些方面的瓶颈?

我之所以询问,是因为我想确保患者与医护人员之间的对话安全:

我有一个网站,包含超过 500 个分类(如果我记得没错的话)。我认为在每月 80 美元的 CPU 优化型 Droplet 上运行得还不错,每月约有 25 万次页面浏览量。

您能否分享一下使用这么多分类的最新感受?

  • 您目前有多少个分类?
  • 是所有用户都有这么多分类,还是访问受限,只有管理员才能访问所有分类?
  • 您是否修改了 Discourse 代码或添加了一些其他调整?

提前感谢您的回复。

想知道在这么多分类的情况下如何发布新话题吗?

主页(分类、最新、新帖)上的“新话题”按钮要求你选择一个分类,除非你允许未分类的帖子。在下拉菜单中选择分类时,如果列表中有太多选项,似乎不太方便。你如何应对这个问题?

我有300多个分类(其中包含大量子分类),但只有管理员能看到这么多。
您可以在下拉菜单中搜索,但需要事先知道要发布内容的分类名称。
对我来说,主要的“问题”是在首页滚动到位置靠后的分类(通过使用搜索功能可以轻松解决)。

我也对这个感兴趣。我的社区是业余无线电操作员,有数千个本地小型俱乐部。我想为每个本地俱乐部提供自己的私人小组来讨论俱乐部事务。

在达到任何限制之前,可能还需要很长时间。我估计在满负荷运行时,我可能会达到大约 500 个小组的上限,每个小组都有自己的类别。

这些小组将仅显示给通过 API 添加到俱乐部的用户。

所以(大部分)所有类别都是私有的,并且仅对组成员可用?我不确定,但我想这可以解决许多性能问题,如果您认为您将保持在 500 左右,即使我错了,您也可能没问题。我认为大约 200 是推荐的最大值,但我有一个包含 200 或 300 个站点的站点。如果您的人数过多,您将收到警告,因此您可以将它们拆分到多个实例中。