This is not a problem per se. I have small files of about 3-5 MB. I have the option to save them as either a blob in the DB of type bytea
or read the file into a byte array, encode then save the resulting byte string.
Technically, a bytea is a binary string array and is almost, if not similar, to my approach, only that Postgres handles everything. Anyone tried this before? How was your experience?
3
Always use bytea
for binary data. That saves you the effort of encoding to and decoding from a string, and you won’t waste any storage space.