Is it right to save the base64 database in the database?

I am developing an Android application where a user can send an image to my web service.

Currently, on my WebService, I get a Base64 string and save it in a table in my database.

My question is: Is this a good practice? Because, as far as I know, a Base64 string is a heavy string. My concern is for db performance, for example when this table gets more than 10000 ... 100000 records.
Or should I avoid this behavior?
For example: Isntead, in order to save the Base64 string in the database, I was able to restore the image and save only the URL in my db.

Ps: SqlServer database


Thanks for helping the guys

+4
source share
2 answers

To answer your question, I think this is not a good practice.

It depends a lot on how you will use these images, which you are likely to upload. Then remember ( base64 encoding makes file sizes about 33% larger than their original binary representations ). The best way is to record the image and then save its location in the database.

Check this post as it may help.

+4
source

, base64- URL- . .

+1

Source: https://habr.com/ru/post/1607815/


All Articles