I'm building a project which intensively uses 3rd paty APIs, for eg:- travel domain APIs, newsfeed API, events API etc.
Whenever the client requests the server for any category API, the server hits the corresponding API and returns the result back to the client (Android app). Hence, the server acts as a middleman which takes the input from the client, forwards it to the respective third-party API and then responds back with the result fetched from the API.
In this way, the client waits for a relatively long period of time. What could the best design possible?
Following are the options that I can think of (If theres any other, please let me know):-
1) I scrap the 3rd party APIs and store their data on my server. So now whenever the client request anything, the request is served solely from my server.
PROS -
a) Speed is increased. b) Removed dependency from the 3rd Party server. (Their server might go down)
CONS-
a) Saving data to our DB, means increased development time, efficiency issues etc. b) Increased server space
2) I let the server act as a middleman and serve the request via fetching the results from the 3rd party APIs.
While using one of the Mashape APIs, I found that there was an application error from their end.
In one of my case, I have an endpoint /movie/{movie_name} which calls Youtube API, Imdb API(omdb), Bookmyshow API. Would fetching data from these 3 endpoints at run-time a better design-style.
What should be the best approach in going forward with this? What should be the best design pattern?
Aucun commentaire:
Enregistrer un commentaire