dadosjusbr / storage

APIs de armazenamento do dadosjusbr
MIT License
4 stars 1 forks source link

Monitoramento: arquivos com hash diferentes. #5

Open marcosbmf opened 4 years ago

marcosbmf commented 4 years ago

Contexto: pretendemos criar um serviço que irá automatizar a coleta dos dados e realizar um monitoramento. Nesse sentido, iremos fazer coletas regulares dos mesmos dados com o fim de verificar sua integridade.

Problema: A coleta dos dados do órgão X para determinado mês já havia sido realizada. Caso no monitoramento encontremos dados diferentes dos que já haviamos coletado anteriormente, como proceder?

marcosbmf commented 4 years ago

Talvez a cloud do lsd suporte Containers com controle de versão. Ou poderiamos emular esse comportamento: Criação de dois containers, um atual e um de histórico. Sempre que um dado arquivo mudar, o atual é jogado para o histórico e o arquivo novo é atribuido para o container oficial.

https://godoc.org/github.com/ncw/swift

Object Versioning ¶ As defined by http://docs.openstack.org/api/openstack-object-storage/1.0/content/Object_Versioning-e1e3230.html#d6e983 one can create a container which allows for version control of files. The suggested method is to create a version container for holding all non-current files, and a current container for holding the latest version that the file points to. The container and objects inside it can be used in the standard manner, however, pushing a file multiple times will result in it being copied to the version container and the new file put in it's place. If the current file is deleted, the previous file in the version container will replace it. This means that if a file is updated 5 times, it must be deleted 5 times to be completely removed from the system.

A biblioteca que estamos utilizando já implementa essa funcionalidade, falta saber se está disponível na cloud do lsd.