in reply to
Flock to Rename Directory
I agree with everyone else that you want to use a database here.
Additionally the biggest problem with your scheme is that your directories appear to have no unique index, so accessing a record to modify it will take a long time.
As far as I can tell, when you need to update the directory name, you need to scan the entire list of 15,000 items, split the names until you find the one you are looking for, check if there's a lock on the then rename that directory. This is CONSIDERABLY slower then accessing a database table with a unique index. I think that's O(n) vs O(1) complexity where n is the total number of records. In your case up to 15,000 times slower. Plus the database solution is a lot more portable and easier to extend.