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.

A parte le considerazioni sull’interfaccia utente, sono curioso di sapere cosa succede quando si arriva alla fascia delle 1000+ categorie. Le risposte diventerebbero solo leggermente più lente in media, o ci sono conseguenze catastrofiche? Si tratta di un problema risolvibile utilizzando hardware più potente?

Come l’autore del post originale, sto lavorando a un progetto che potrebbe facilmente avere migliaia di categorie. Utilizza pesantemente le autorizzazioni basate sui gruppi e un singolo utente potrebbe essere in grado di vedere solo alcune (ecco perché non posso usare i tag). Quindi non sono tanto preoccupato che l’interfaccia risulti schiacciante, ma vorrei sapere qual è il collo di bottiglia a quel livello più elevato.

Onestamente, probabilmente non succede nulla di grave, a meno che tu non sia un amministratore e abbia accesso a oltre 1000 categorie. In quel caso, invieremmo ogni singolo file JSON delle categorie nella tua prima pagina, e la pagina delle categorie diventerebbe lenta sia lato server che lato client.

In relazione a questo:
Se ho da centinaia a migliaia di categorie, esiste un’opzione per limitare il numero di risultati della ricerca?
Il mio problema: a causa dell’elevato numero di categorie, cliccando sul menu a tendina durante la creazione di un nuovo argomento o cercando le categorie per iscrivervisi, si verifica un lungo ritardo (decine di secondi).

So che esiste un’opzione per limitare il numero di risultati in questi scenari per i tag. Abbiamo o possiamo avere la stessa possibilità per le categorie?

Ciao @Tayyab_Anwar,

Ho appena controllato il database per te e non ci sono impostazioni relative alla limitazione delle categorie (per le ricerche) nel DB.

Ci sono alcune limitazioni disponibili nell’interfaccia utente (come sai):

Quindi, sembra che tu debba creare un plugin per aggiungere funzionalità extra per limitare i risultati di ricerca in base alle categorie e ai criteri correlati.

Spero che questo ti sia d’aiuto.

Puoi condividere alcuni dati sulle risorse necessarie per l’hosting?
Quanta RAM e CPU utilizzi normalmente?

Inoltre, com’è l’esperienza utente, quanto velocemente si carica: ci sono colli di bottiglia in alcune aree?

Chiedo perché voglio garantire la sicurezza delle conversazioni tra pazienti e medici:

Ho un sito con oltre 500 categorie (se ricordo bene). Credo che stesse funzionando bene su un droplet ottimizzato per la CPU da 80 dollari al mese, con circa 250.000 visualizzazioni di pagina al mese.

Puoi condividere le tue ultime impressioni sull’uso di così tante categorie?

  • Quante categorie hai attualmente?
  • Tutte le utenti hanno accesso a così tante categorie o l’accesso è limitato e solo gli amministratori possono vedere tutte le categorie?
  • Hai modificato il codice di Discourse o aggiunto altre personalizzazioni?

Grazie in anticipo.

Sei curioso di sapere come funziona la creazione di nuovi argomenti con così tante categorie?

Il pulsante “Nuovo argomento” nelle pagine principali (Categorie, Ultimi, Nuovi) richiede la selezione di una categoria, a meno che non si consentano post senza categoria. Selezionare una categoria dall’elenco a discesa sembra poco pratico con così tante opzioni nella lista. Come gestisci questo aspetto?

Ne ho oltre 300 (con molte sottocategorie), ma solo l’amministratore può vederne così tante.
Puoi cercare all’interno del menu a discesa, ma devi già conoscere il nome della categoria in cui vuoi pubblicare.
Il vero “problema” per me è dover scorrere fino a una categoria molto in basso nella homepage (facilmente risolvibile utilizzando la funzione di ricerca).

Sono interessato anche a questo. La mia community è composta da operatori radioamatoriali, e ci sono migliaia di piccoli club locali. Vorrei offrire a ciascun club locale il proprio gruppo privato per discutere potenzialmente questioni del club.

Probabilmente passerebbe molto tempo prima che raggiunga dei limiti. Immagino che probabilmente raggiungerei un massimo di circa 500 gruppi a piena capacità, ognuno con la propria categoria.

Questi gruppi sarebbero visibili solo agli utenti che sono stati aggiunti al club tramite API.

Quindi (per lo più) tutte le categorie sono private e disponibili solo ai membri del gruppo? Non sono sicuro, ma penso che questo risolva molti dei problemi di prestazioni e se pensi di rimanere intorno ai 500 potresti anche avercela fatta, anche se mi sbaglio. Penso che circa 200 sia il massimo raccomandato, ma ho un sito con 200 o 300. E avrai un avviso, quindi potresti dividerli in più istanze se i tuoi numeri diventano troppo grandi.