My project (C#) deals with many files about 1 MB ~ 2 GB in size. SQL server 2008 database is used. In long-term I need to do some operations over them like total sum of their size and …
At first glance I was planned to store their size in byte (in C# code long, in database BigInt) because of file size nature and its precise. I was thinking maybe its a better idea to use a double and consider file size in MB because most of them are 1~2000 MB and make more sense while talking about files of this project. Is there any advantage/disadvantage over these two kind of designs both in code (performance issues when there are many mathematics operations) and database (batch operations over many files) ?
You should use
long/BigInt, for a few reasons: