0

I am writing an App for android in which the user can upload images. My idea is now resizing the image on client side to the maximal required resolution for xxhdpi. After I send it to the server and on server side I store the xxhdpi version. Now the actual question is if I should either store also copies in lower resolution for xhdpi, hdpi,... or resize the xxhdpi version on request (if a smaller resolution is needed) before sending it to the client. The objective is neither sending nor storing more data than actually needed and having a good response time and acceptable server workload (because of potentially multiple resizing processes).

Mischa
  • 53
  • 6

1 Answers1

0

I think you have sort of answered you're own question. It really depends on the limits of your server. If you have limited storage then re-sizing the image on the server side might be the best bet. If processing power is more of an issue then storing multiple versions would be best. I would assume that storing multiple versions would result in better speeds and would scale much better. I would do some testing in terms of performance. Upload an image and then use a server stress test tool to make a hundred or so simultaneous requests and see how the server handles it.

rykeeboy
  • 573
  • 1
  • 6
  • 19
  • Yeah, kind of, but I am still in the developing process. While so, I do not have no final server, just one I use only for testing issues. I don't have any experience with these kind of problems yet and what I'm looking for is getting an idea of what is used to be more of an issue on server side especially when scaling. My guess is that with more users the amount of requests will increase disproportionately compared to the amount of uploads. – Mischa Feb 07 '16 at 16:54
  • In my opinion I'd go with storing the different versions of the files. Storage is generally cheaper than processing power in my experience. You may also be able to implement a background job to re-size the images upon upload as well if you find that the uploading process is slow later on – rykeeboy Feb 07 '16 at 17:41
  • That is what I thought. Thx a lot – Mischa Feb 10 '16 at 20:08