Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

589
Visualizações
Where does MongoDB store index data?

I want to create a separate disk to store MongoDB Database. But I realized that, databases also have indexes. So I might need to have disk size more than the size of records.

The question is where does mongo db stores it's index data. In config file we only mention path of logs and db folder.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The question is where does mongo db stores it's index data. In config file we only mention path of logs and db folder.

The index data is stored along with the collection data in the data directory of the MongoDB Server installation. You can also specify the data directory using the --dbpath storage option when you start the mongod.

The files are stored with names like the following, for example:

collection-2-3986418375741882655.wt 
index-1-221874391618151955.wt

The first one is a collection data file and the second one is an index data file. For each collection and index, one file for each is created respectively. So, if there are 3 collections and 5 indexes there will be 8 files (the data directory has other files too).

There is also a --directoryperdb option, which when specified:

Uses a separate directory to store data for each database. The directories are under the --dbpath directory, and each subdirectory name corresponds to the database name.


[EDIT Update]: Indexes can be stored in separate directory

MongoDB Configuration File Options - storage.wiredTiger.engineConfig.directoryForIndexes

When storage.wiredTiger.engineConfig.directoryForIndexes is true, mongod stores indexes and collections in separate subdirectories under the data (i.e. storage.dbPath) directory. Specifically, mongod stores the indexes in a subdirectory named index and the collection data in a subdirectory named collection.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda