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 @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.
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.
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 considerations aside, I’m curious what happens when you get up into the 1000+ categories range. Would responses just take a little bit longer on average, or are there catastrophic consequences? Is this something that can be solved by throwing better hardware at the problem?
Like the OP, I’m working on a project that could easily have 1000s of categories. It uses group based permissions heavily and an individual user may only be able to see a handful (this is why I can’t use tags). So I’m not worried as much about the UI being overwhelming, but would like to know what the bottleneck is at that higher range.
Honestly probably nothing terrible, unless you are admin and have access to 1000+ categories. At that point we would ship you every single category json in your first page, the categories page would get slow both server side and client side.
Relating to this:
If I have 100s to 1000s of categories, is there an option for me to limit the number of search results?
My problem: Due to a large number of categories, clicking on the dropdown when creating a new topic, or searching for categories when subscribing to them, has a long delay (10s of seconds).
I know we have an option to restrict the number of results in such scenarios to tags. Do we have/can we have the same for categories?
I have a site with over 500 categories (if I recall correctly). I think it was doing ok on an $80/month cpu optimized droplet with about 250k page views per month.
Interested to know how posting new topics works with so many categories?
The New Topic button on the homepages (Categories, Latest, New) requires you to select a category, unless you allow uncategorised posts. Selecting a category in the drop down seems impractical with so many in the list. How do you deal with that aspect?
I have 300+ (with a lot of sub cat though), but the admin is the only one to see that much.
You can search within the drop down, but you have to know beforehand the name of the category you want to post in.
The main “issue” for me would be to scroll to a far down category on the homepage (easily fixed by using the search feature)
أنا مهتم بهذا أيضًا. مجتمعي هو مشغلو الراديو الهواة، وهناك الآلاف من الأندية المحلية الصغيرة. أود أن أقدم لكل نادٍ محلي مجموعته الخاصة لمناقشة شؤون النادي المحتملة.
من المحتمل أن يستغرق الأمر وقتًا طويلاً قبل أن أصل إلى أي حدود. أتخيل أنني سأصل على الأرجح إلى 500 مجموعة كحد أقصى بكامل طاقتها، ولكل منها فئتها الخاصة.
سيتم عرض هذه المجموعات فقط للمستخدمين الذين تمت إضافتهم إلى النادي عبر واجهة برمجة التطبيقات (API).
إذًا (في الغالب) جميع الفئات خاصة ومتاحة فقط لأعضاء المجموعة؟ لست متأكدًا، لكن أعتقد أن هذا يحل الكثير من مشاكل الأداء وإذا كنت تعتقد أنك ستبقى عند حوالي 500 فقد تكون على صواب حتى لو كنت مخطئًا. أعتقد أن حوالي 200 هو الحد الأقصى الموصى به، لكن لدي موقع به 200 أو 300. وسيكون لديك تحذير حتى تتمكن من فصلها إلى مثيلات متعددة إذا زادت أرقامك كثيرًا.