Thursday, June 28, 2007

Maximum size of the file under source control - should you care?

In this forum thread I came across very interesting piece of information that I feel might be interesting to the community at large.

Probably anyone using source control application asked that question at some stage - what happens if I check in 500Mb disk image file? For some source control systems (f.e. VSS) the answer is relatively simple - you'd end up increasing your DB size by approximately 500 Mb every time you check in new revision of the file.
However, for TFS only deltas between the revisions will be saved, so your database will not become bloated if you store several versions of that huge binary file. Or so I thought - because it turned out that deltas mechanism is used only for the files that are smaller than 16 Mb. May be that's just me, but that number eluded me in the original documentation on MSDN and I was under the impression that if someone maintains several revisions of huge binary file it is not a big deal.

But in reality, that can well create a problem. In v 1.0 of TFS there is no permanent destroy, so if one created twenty revisions of CD image that will immediately affect your database size, and there is no way back!

The reason for this (conveniently explained by Richard Berg in the forum thread) is understandable - indeed, calculating deltas for large files can adversely affect server performance, and therefore it is disabled. But I am not sure that I like the way it is not specified in official documentation and not configurable on server.

Obvious way of making sure that your database is not affected by those binary files is not to store them in TFS at all (and create maximum file size check in policy to enforce the file sizes). Or if you do store them, store only one revision and use branches if you need to reference this file. While both approaches take some additional effort for policies enforcement and user education, at least now you can make sure you can explain that sudden increase in database size. Look for new revisions of those large files :)

1 comment:

Anonymous said...

This setting is configurable. In the version control service's web.config, set "deltaMaxFileSize" to the desired size (in bytes).

I'm not sure if it's documented and/or supported.