I am working on a web application for ranking some products based on some factors.
The user send a search query to 5 restful webservices which by their turn send a response in a JSON format and sometimes in an XML format (responses are not structured the same way, since webservices are different) . I choosed to reformat everything to a special json structure so I can use it .
My current problem is that I don't know which way should I implement this app, which is basically a REST client interfering with other web services .
The Server Approach :
The first way I had in mind is to use a Server side implementation (using python and flask) to send an HTTP request and recieve a response, "ReEncode" everything into a structured json format and send it back to the client which will render it .
Here are the steps of things should work using this approach :
- Client send a request to my server containing the search query
- My server will reformat the request to create an HTTP request for each web services
- The server send the request to these RESTful services and get back an HTTP response from each server .
- The server decode those responses to a special data structure I made, then it applies all the ranking and processing logic to it .
- The server re-encode everything to json format and send it back to the clients .
- The client browser reparse and render the json response !
The Client Side Approach:
The seconde way to create this app is to do all the HTTP communication,data processing,parsing and rendering on a Client side, sure nothing here is really client side, since the app will have to communicate with webservices.
The steps for this approach are as following :
- Client type the search keywords (the search Query)
- Browser clients create an http request (using the the search Query and API keys) and send it directly to the web services .
- Client browser decode the response (json/xml formatted) and creates native objects that I need to use .
- Process the decoded data (ranking,filtering...)
- Re encode everything to a structured json format
- Render everything .
This approach will use only JS and some frameworks .
The Question : Which way is more efficient and quick to set up?
Thing to consider :
- I have a limited knowledge of python and js.
- This is a part time project .
- I need to finish it in less than a month .
- That's my first web application (but not my first programming project, I've made softwares and games before )