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 の考慮事項 aside とは別に、カテゴリ数が 1000 を超える範囲に達した際に何が起こるのか気になります。レスポンスが平均的に少し遅くなるだけでしょうか、それとも壊滅的な結果を招くのでしょうか。これはより高性能なハードウェアを導入することで解決できる問題でしょうか?

OP と同様、私も数千のカテゴリが存在し得るプロジェクトに取り組んでいます。このプロジェクトではグループベースの権限を多用しており、個々のユーザーが見られるのはごく少数のカテゴリに限られます(これがタグを使用できない理由です)。そのため、UI が圧倒されることについてはそれほど心配していませんが、その高レベルの範囲におけるボトルネックが何かを知りたいと考えています。

正直なところ、ひどいことにはならないでしょう。ただし、1000 以上のカテゴリにアクセスできる管理者である場合は別です。その場合、最初のページですべてのカテゴリの JSON を送信することになり、カテゴリページはサーバー側でもクライアント側でも遅くなります。

これに関連して:
カテゴリが数百から数千ある場合、検索結果の数を制限するオプションはありますか?
私の問題:カテゴリの数が多いため、新しいトピックを作成する際的下拉リストをクリックしたり、カテゴリ購読時にカテゴリを検索したりすると、遅延(10 秒以上)が発生します。

そのようなシナリオでタグの結果数を制限するオプションがあることは承知しています。カテゴリについても同様の設定が可能でしょうか?

@Tayyab_Anwar さん、こんにちは

データベースを確認しましたが、(検索に関する)カテゴリの制限に関連する設定は存在しませんでした。

UI 側ではいくつかの制限機能があります(ご存知の通り):

したがって、カテゴリや関連する条件に基づいて検索結果を制限する追加機能を実装するには、プラグインを作成する必要があるようです。

参考になれば幸いです。

ホスティングに必要なリソースに関する数値を教えていただけますか?
通常、どの程度の RAM や CPU を使用していますか?

また、ユーザーエクスペリエンスはどのようでしょうか?読み込み速度は速いですか?特定の箇所にボトルネックはありますか?

私が尋ねている理由は、患者と医療従事者間の会話を安全に確保したいと考えているからです:

サイトには500以上のカテゴリがあります(記憶が正しければ)。月間約25万ページの表示がありましたが、月額80ドルのCPU最適化ドロプレットで問題なく動作していました。

多数のカテゴリを使用する際の最新の感想をお聞かせいただけますか?

  • 現在、いくつカテゴリがありますか?
  • 全ユーザーがこれほど多くのカテゴリにアクセスできるのか、それともアクセスが制限されており、すべてのカテゴリにアクセスできるのは管理者だけなのか。
  • Discourse のコードを変更したか、または他の調整を加えたか。

事前にありがとうございます。

多数のカテゴリがある中で、新しいトピックを投稿する方法が気になります。

ホーム画面(カテゴリ、最新、新規)にある「新規トピック」ボタンでは、カテゴリ未分類の投稿を許可しない限り、カテゴリを選択する必要があります。リストに多数あるカテゴリからドロップダウンで選ぶのは現実的ではないように思えます。この点について、どのように対処していますか?

300以上(サブカテゴリが多数あります)ありますが、それだけ多く表示されるのは管理者のみです。
ドロップダウン内で検索できますが、投稿先のカテゴリ名を事前に知っておく必要があります。
私にとっての主な「課題」は、ホームページで奥の方にあるカテゴリまでスクロールすることですが(検索機能を使えば簡単に解決できます)。

私もこれに興味があります。私のコミュニティはアマチュア無線オペレーターで、何千もの小さなローカルクラブがあります。各ローカルクラブに、クラブの事項について話し合うための独自のプライベートグループを提供したいと思います。

おそらく、制限に達するまでにはかなりの時間がかかるでしょう。満員になった場合、おそらく最大で約500のグループに達し、それぞれに独自のカテゴリがあると思います。

これらのグループは、API経由でクラブに追加されたユーザーにのみ表示されます。

したがって、(ほとんど)すべてのカテゴリがプライベートであり、グループのメンバーのみが利用できるということですか?よくわかりませんが、これでパフォーマンスの問題の多くが解決されると思います。もし500人程度で維持できると考えているなら、たとえ私の考えが間違っていても大丈夫かもしれません。推奨される最大数は200人だと思いますが、私は200人または300人のサイトを持っています。そして警告が表示されるので、数字が大きくなりすぎた場合は、複数のインスタンスに分割することができます。