social-mediagoblin
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Social-mediagoblin] Tahoe-LAFS as a document-oriented database


From: Zooko O'Whielacronx
Subject: Re: [Social-mediagoblin] Tahoe-LAFS as a document-oriented database
Date: Sat, 9 Apr 2011 16:23:19 -0600

Thanks for the API sketch.

On Sat, Apr 9, 2011 at 9:20 AM, Christopher Allan Webber
<address@hidden> wrote:
>
>  storage_handler.get_unique_filename(['dir1', 'dir2', 'filename.jpg'])
>  # Possibly returns either:
>  #  - 'filename.jpg'                     # if no such file yet exists
>  #  - '%s-filename.jpg' % uuid.uuid4()   # if another file of this name exists

But if two people call this simultaneously then they might both get
'filename.jpg' returned to them. Then what?

> This API is inspired by Django's filesystem API:
> http://docs.djangoproject.com/en/dev/topics/files/

Oh, look there is already an implementation of Django's filesystem API
on Tahoe-LAFS:

https://github.com/thraxil/django-tahoestorage/blob/master/tahoestorage/storage.py

>> 1. On what do you rely for the guarantee that the file is uncorrupted?
>> There are basically two use cases: you store a file yourself and get
>> it back later, or you share a file with someone else. In the former
>> you want to be sure that you get back the same file you put in. In the
>> latter the recipient wants to be sure that they get the same file the
>> sharer sent.
>
> So case 1, I guess we can store sha1 hashes in the database and check
> against them if necessary?

Sounds good. (I would use sha-256 instead of sha1.)

> So, in case 2, I'm really not sure what kind of problem you're
> anticipating.  Maybe more examples would be helpful.  Are you talking
> about like, a cryptographic integrity check to make sure yes, this is
> the right file, no fooling, nobody's going to goatse.cx me?

If I send you a file, I would not like it if anyone else can cause you
to see a different file than the one I sent.

Regards,

Zooko



reply via email to

[Prev in Thread] Current Thread [Next in Thread]