I'm developing a photo sharing website. Currently, the way I wrote it, a user uploads a photo (jpeg), which is read in as a Base64URL (using FileReader). The backend (Django) uploads this file to Google Cloud Storage (using django-storages). The view renders (serializes) the images as signed urls which are then easily displayed by the client (currently a Vue.js SPA).I'm wondering if it would make more sense to store the images as binary files, and what kinds of questions should I ask to make this determination?
Storing images in base64 vs binary, in cloud
architecture;file handling
With base64, you get a 33.3% overhead because of the 4:3 ratio. This means that for a 3 MB image, you will pay 4 MB of storage, and possibly, depending on the pricing model, 32 Mbps of network footprint every time the image is transferred to and from the server.The benefit of base64 comes in situations where you need to transfer binary data through a channel which doesn't support binary well or at all. This is why, for instance, e-mail attachments were usually encoded in base64. For more information on that, see Why is base64 needed (aka why can't I just email a binary file)?In your case, I see no reason to avoid binary. Therefore, there is no need to use base64.