I'm posting an image to the server using the DATA URI (client side, using the canvas). I now have two choices: I can save the "image" as a string in a varchar(max) column or I can convert it to byte[] and save it as varbinary(max).
As far as implementation, the effort is the same. I am trying to determine what would be more efficient as far as 1: space in the DB and 2: displaying the image. Has anyone seen any analysis on this or have a good way to measure this?
AN FYI - a 3kb image is about 100K characters in the DB.
Using: ASP.NET 4.5, MVC, SQL Server 2008
To Clarify
I can either store the image in the database using byte[] in a varbinary(MAX) column like is typically the case or I can store the DATA URI from the HTML5 canvas that looks like data:image/png;base64,iVBORw0K... in a varchar(max) column.
Storing the byte[] is typical and needs no further explanation. Storing the DATA URI is just a string and displaying the image would be a matter of:
<img src="data:image/png;base64,iVBORw0K" /> or
<img src="@Model.Uri" />
My question is which one is more performant and space saving and if there's any documentation, white paper or analysis around this specific comparison.