Locking and Synchronization

Last post 06-18-2008 6:05 AM by lezotten. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-17-2008 5:38 AM

    Locking and Synchronization

     Hi all,

     I'm wondering if Nirvanix has any mechanism for locking part of a file system in order to synchronize access between multiple clients?  I didn't see any mention of locking in the API docs, but it seems like it could be possible if certain guarantees can be made for how some operations behave when multiple clients attempt to perform them simultaneously.

    For example, folder creation could be used to build a locking mechanism if there is the guarantee that if multiple clients attempt to create the same folder at the same time, then only one of those clients will be notified that they have succeeded.  Renaming files or folders is another operation that might be used this way.

      Do any guarantees like this exist in the Nirvanix API?  Are there any plans to add such guarantees in the future (or even better, an explicit locking API)?

     BTW, I'm mainly interested in this because I would like to use Nirvanix as a storage backend for a version control system (Bazaar in particular).  However, without synchronization it seems that there is no way to prevent a repository from getting corrupted if multiple users commit changes simultaneously.

     Thanks in advance,

    Nathan.

  • 06-17-2008 1:47 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 576

    Re: Locking and Synchronization

    We do not have a locking concept but rather first in first out.  Once the first person has created a folder or renamed a file the others will get an error such as path does not exist or folder already exists.  To handle this you should look for a response code that is non-zero and get the error message that is returned with the xml.  All of our operations will handle multiple clients attempting to perform operations at once but you may also want to look at creating child accounts so each user in your system will have a unique file space under your application.

    If you wish to create a locking system there are several ways to do this within the existing system.  The master account can store account details for its children using the SetAccountNotes call to store an xml file that could hold locking information.  Also, you can use metadata to put a flag on a folder or specific files that could be used as a lock.

    Regards,
         Barry R.

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 06-18-2008 6:05 AM In reply to

    Re: Locking and Synchronization

    Thanks for the info Barry, it looks like you guys already have what I need in place.  I'll probably try using folder creation for locking initially, since this is what Bazaar already uses for locking on local file systems.  If you think that something else might be faster or more efficient, please let me know.

    Thanks again,

    Nathan.

Page 1 of 1 (3 items)