0chain / 0chain/blobber

File listing Optimization Proposal

Aberta
#691 0 comentários 1 reação 0 responsáveis Ver no GitHub
discussion post-mainnet
Linguagem predominante
Go
Estrelas
20
Forks
26
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Retrieving file listings, and in particular `list-all` will increasingly become more resource hungry as the number of files and directories in an allocation grow

Separate to having a folders-only option, here is an idea how file listings could be done more efficiently for large numbers of files, (compared with apparent current method that client requests lists from all blobbers and seeks sufficient consensus majority to consider a correct listing):-

* instead of each blobber sending entire files listing, they create internal list with file paths and content hash only (consistent between blobbers)
* This list is sorted
* A hash of this list is generated (consistent between blobbers)
* This list (referenced by it's hash) is saved (temporarily)
* The hash is what is returned to client initially
* The client only has to compare majority (consensus) of hashes to ensure file listing correctness.
* Client only has to actually retrieve file listing from random one of matching blobbers
* This can be done with pagination, solving consistency issue when time elapses between pages
* In fact pagination requests can be split by Blobbers so blobber1 page 1, blobber2 page 2 etc.
* Cached list can be retained at least for a short while for pagination requests but actually remains valid until write operation performed on allocation. So perhaps flagged as stale as soon as a CRUD operation performed then stale listing removed after say 1 minute.
* This could form a secondary method of file listing at a certain threshold, perhaps for any more than say, 1,000 files or wherever pagination would be decided.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Examine a lógica de listagem de arquivos na base de código do blobber, provavelmente em um manipulador ou serviço relacionado a operações de arquivos de alocação. Compreenda o mecanismo de consenso atual para listagens. A proposta envolve criar uma lista hash e ordenada de caminhos de arquivo e hashes de conteúdo, armazená-la em cache e implementar paginação. Comece encontrando onde list-all está atualmente implementado e examine as estruturas de dados usadas para metadados de arquivo.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Domínio
backend, performance
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.