Florian G. wrote:
On Nov 6, 2009, at 6:14 PM, Marnen Laibow-Koser wrote:
do the version control for user uploaded files.( Also i guess, if i
use
svn it will reduce the storage space also )
Subversion would be a very poor solution here. You will have better
luck with a decentralized version control system such as Git (and the
Grit library, perhaps). Acts_as_versioned may also be worth looking
at.
Can you please elaborate why a decentralized approach is required here?
I didn’t know about SVN’s autoversioned WebDAV, so I was thinking that
SVN would require both a repository and a working copy in different
places, whereas Git’s decentralized model can keep it all together.
It is a purely centralized model and SVN actually does a decent job at
versioning binary files. Actually, in that case, even CVS has a
sufficient
model, because I expect there is no interdependence between the files.
[1]
Actually, I think it’s a purely decentralized model, for the reasons
above.
So how is GIT superior to SVN in that case?
Is it even possible for git to return a specific version of a file
without
having to check it out somewhere on the file system and then deliver it
to the client?[2]
Possibly. I’m not sure how .git is organized.
[…].
For example, neither the revision scheme of GIT or Subversion fits to
“per-file-tracking”. Both cannot (easily) answer the question about the
“natural” revision of the file. (independent of other files)
It seems to me that they can.
Also, they are not build for heavy concurrent(!) writing.
Aren’t they?
Use a file system for binary file storage (that’s what they are there
for).
If you need a versioning scheme (which would probably be per file):
use file
system storage with a versioning scheme baked into the directory
structure.
Isn’t that sort of what versioned WebDAV does?
If you need metadata for the files: use a database-backed approach with
file system storage.
Isn’t that what Git and SVN both do?
If you choose the correct file system, backing up is as easy as git
would
make it and a lot of backup-solutions are already around.
True. But this is not straight backup.
CouchDB might also be an idea to use for that.[3]
That’s clever.
Don’t abuse source control systems just because they usually carry
“version”
in their names!
Don’t restrict the use of version-control systems because some people
call them source control.
Seriously, I doubt that either Git or SVN is really the right tool for
the job here. But I’m not certain.
Regards,
Florian
P.S.: And don’t reply with “git” if someone says “svn” without giving it
a long thought. Both are bad in that case.
That was not what I did.
[1] Not that I recommend it, though. But you could even argue that CVS
model
fits better.
[2] This is in no way a criticism, it just doesn’t fit git’s model.
[3] They don’t provide versioning for that use-case out of the box,
but it is
really easy to implement.
Best,
Marnen Laibow-Koser
http://www.marnen.org
[email protected]