Image in Java web service -
i developing server part in java restful web service (using apache tomcat), planning deploy on cloud web service. want web service provide images client (mobile devices or browsers), user can upload or replace images dynamically later.
question 1: should store images @ server ? options-- 1].save images in database (as blob) 2].local file system of server.
question 2: how process client request options-- 1].i can retrieve locally , give image response. 2].i can give public url of image response, , client can download url.
can suggest me option should opt optimize server side processing , storage cost, w.r.t security.
answer 1: while subject debate, usual answer is: local file system. can add entry in database location of file , metadata actual binary blob should on file system.
answer 2: if pass along public url, supposes have public http server can access , provide images requested. if case consider opting because http servers can optimize out of box (e.g. caching) plus can offer reuse (e.g. embed image elsewhere using public url).
Comments
Post a Comment