views:

148

answers:

4

As we're about to start planning an application that will handle media files (mp3, flv, pdf, images), I'm thinking about how to handle the file storage. The files will change and versions should be tracked to a degree, so integrating SVN in the app comes to mind.

Now I wonder, is it too much? I'm quite sure we'll only use a fraction of the power SVN brings, so perhaps just pointing to the filesystem using a database will be just as good.

On the other hand, these custom archive solutions always gets very ad hoc, and I would like a reliable solution this time. Too much hassle? What do you think?

+2  A: 

The problem I can think with SVN is that it will be grow quite steadily with large binary media (very little, if any, "diff" usage), and it is very hard to purge history with SVN. As long as you know what you are doing, it should be OK...

Marc Gravell
+2  A: 

Subversion is really quite simple, especially on the Windows platform with TortoiseSVN. Using it to archive your media files in a simple scenario is probably not a bad idea on first glance.

Where you might run into a problem is that all of these file types are binary, and thus they cannot be diffed. Because of that your repository will grow quite large and you will not be able to compare changes between two versions easily.

I think in a simple scenario this probably won't matter much to you anyway so knock yourself out!

Jeffrey Cameron
+1 to Subversion. It's just works, and is easier to grasp than distributed VCSes.
Joonas Pulakka
Subversion's way of generating deltas (what you call diffing here) also works on binary files. Of course that's only useful if the format doesn't cause all binary data to change for even the slightest change.
Wim Coenen
+1  A: 

there are a couple of things to take into consideration.

When storing mp3, flv and pdf files subversion might not be the optimal solution. Subversion's change tracking works best on text files, storing only changes in files. Binary files are supported but subversion does not work as efficiently as with normal files. Conflict resolution does not really work for example.

Do you store additional information in a database? If you store information about the files in a database you might get into trouble when transactions in subversions roll back or when transactions in the database roll back. Keeping the database and subversion in sync might cause trouble. I would try to shoot for a solution where all my data was stored in one place. If you can store everything in subversion that might be the way to go, if you have to use an additional database it might be simplest to use the database to store file versions too.

Mendelt
I know what you mean, so I should perhaps rephrase my question to "How to handle version control of binary files?" Any suggestions?
ciscoheat
Maybe you can give some additional information. What alternatives are you considering? Do you also use a database? How much data do you expect to store? Is the data going to be updated by one user or many? Do you need to back up the data? etc.
Mendelt
Sure I can, thanks for your help. I'm new to stackoverflow, so should I ask a brand new question, continue this comment thread, or use "Answer your question"?
ciscoheat
Asking the same question over again with some changes is usually a bad idea. People will vote down and close duplicate questions. Don't be afraid to add information to the current question.
Mendelt
+1  A: 

Even though you won't be able to diff the files, it still is nice having the ability to revert to a previous state with relative ease in case something bad happened.

Kyle Walsh