0

Hi i am developing an android application for a project in college , for the application i am using a WAMP server with a MySql DB running on my laptop, i am using PHP files to communicate with the DB from the android app. I am wondering what would be my best option to store images from the application. Would i be better of storing the images in a directory on the server and store location in the DB or would it be better to encode the image directly into the database? thanks

(the application is a online shopping model and the images would be uploaded for each item for sale.)

NC24
  • 1
  • 4
  • 2
    The best option is not storing them in the database in the first place. Amazon S3 or some other object store helps considerably with these sorts of projects, they act as a CDN as a bonus. Store the path to the image, not the image itself. Serving image assets from a database is at least an order of magnitude slower than from disk. – tadman Apr 28 '16 at 09:50

1 Answers1

0

Store the images in a directory and insert the path of the image to database. That's the best option to do. And you can retrieve it by using libraries like Picasso.

shinilms
  • 1,494
  • 3
  • 22
  • 35