In my thesis I need to test different architectures. A request to a REST web service developed using Apache CXF and Spring MVC with MySQL as back end serving references(a field in database) to images,audio and video files stored in file system. In the response message, what is the best method to send the content to the client(another application using the service which I developed).
URI: http://www.filmservices.com/film/{id}
A client here is not the end user.
Main concern is performance.
Based on my thesis work I have some points to make here.
If performance is the main concern, obviously you should choose to store the images in file system and send the links content in the file system.It also depends on the size of the application.If it's a small application storing the images and multimedia content in db is not an issue.
I have observed that XML should be chosen as a payload if the multimedia content is encoded and sent.JSON is a bad option if you are to send encoded byte[] in the payload.
If you are sending multimedia content encoding the byte[] is mandatory. So, applying compression after encoding is better and the size of the payload reduces to an extent.