question

AmruthavarshiniM-3381 avatar image
0 Votes"
AmruthavarshiniM-3381 asked KalyanChanumolu-MSFT commented

What is the difference between storing documents in azure blob as files and storing as base64?

Hello all,

I want to know the difference between storing documents in blob as file and storing it in base64 format.

Can you please please provide me the link to any refrence documents.

I know that base64 takes less space than actual files. I want to understand it in detail.

Thank you..

azure-storage-accountsazure-blob-storage
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

To follow-up, Please let us know if you have further query on this.
Please don’t forget to Accept the answer

0 Votes 0 ·
learn2skills avatar image
1 Vote"
learn2skills answered AmruthavarshiniM-3381 commented

Hi @AmruthavarshiniM-3381

base64 encoding: A binary-to-text encoding scheme whereby an arbitrary sequence of bytes is converted to a sequence of printable ASCII characters, as described in RFC4648.

binary large object (BLOB): A discrete packet of data that is stored in a database and is treated as a sequence of uninterpreted bytes.

BLOBs and Base64 Encoding
BLOBs are supported and stored in the XM_TYPE_STRING hash data dictionary format. The reason is that BLOBs are treated in the same manner as strings because they have already been encoded by using base64 encoding before storage into a dictionary file.

BLOBs stored in Spreadsheet Data Model files MUST be encoded by using base64 encoding prior to any other compression and storage. For information about the Spreadsheet Data Model file format, see section 2.1.

If BLOBs are being stored in an XM_TYPE_STRING hash data dictionary, the flag value 0x100 MUST be set in the DictionaryFlags element in the metadata for the dictionary (see section 2.5.2.22.1).

Because they are strings (with only 64 character symbols used), BLOBs can also be compressed by using Huffman compression. So if compression is used on the string store, both the strings and the BLOBs will be compressed by using Huffman compression if they fall within all of the Huffman compression constraints.

For more information about XM_TYPE_STRING hash data dictionary metadata, including the dictionary flags that need to be set, see section 2.5.2.22. For more information about the Huffman compression that is used, see section 2.7.4.
https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xldm/58c62f7a-f995-4c68-9ed1-bb0af2ba330b

Refer- https://stackoverflow.com/questions/39582878/successfully-saving-base64-image-to-azure-blob-storage-but-blob-image-always-bro/39590768



If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for your answer.

I wanted know about performance if the file is converted into base64. Can i encode large files and any limitations in file types. I have different files types., like pdf, word, png, excel, mp4.

And conversation to base64 to is more secure compare to blob? Will add any extra layer of security?

0 Votes 0 ·
KalyanChanumolu-MSFT avatar image
1 Vote"
KalyanChanumolu-MSFT answered KalyanChanumolu-MSFT commented

@AmruthavarshiniM-3381 Thank you for reaching out.
Technically speaking, you can store your documents in both formats. It all boils down to your use case.

Base64 encoded data is usually used for data transfer because you can stream and encode/decode in real time. Hence not a very popular format for data storage.
When you save your documents/images in a Base64 encoded format, you lose the advantages of serving them from a CDN, caching the files in the browser etc.

However, if you don't have such a requirement and your image signatures are very small (like gravatars or profile pics), storing them as base64 in a database could be more convenient.


If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.
And if you have further questions or issues, please let us know.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for your answer.

What is the maximum size of file that can be converted into base64 and uploaded to containers?

0 Votes 0 ·

It will depend on the data store where you plan to hold the converted data.
For example, If you are using Azure SQL database and store the base64 encoded data in a column with VARCHAR(max) datatype, you can store up to 2GB

1 Vote 1 ·