1

I am architecting a web application which will need to communicate with multiple (two or three) existing RESTful APIs. Each API provides different data and functionality. The web application will essentially glue the APIs together into one user interface.

Based on this scenario, I have a few questions:

  1. Is this common?
  2. Is this bad practice or bad architecture? If so, what are some alternatives?
  3. (diagram #1 below) I’d like to use JavaScript + AJAX to interact with these APIs. Would I make AJAX requests to the different domains, addressing them with different, absolute URLs? e.g., http://api1.domain.com/something, http://api.domain.com/something_else
  4. (diagram #2 below) Instead of (3), should I simply have my backend controllers interact with these APIs, and then have my frontend (JavaScript) interact with my application’s controllers? Essentially this would be a facade.

I am delving into SOA, so forgive me if I sound ignorant. And FWIW, I’m planning to use Ruby on Rails.

Diagram #1:

enter image description here

Diagram #2:

enter image description here

1 Answer 1

2

Generally a restful api is a frontend to the core of the application, I wouldnt mind different restful apis if required. Some restful apis like jersey are very easy to use in any standard Java EE web container serving common cases. Other restful(-ish) apis like play, lift etc are good for serving comet requests asynchronously thus yielding high performance out of single workstation.

As far as different domains are concerned this could be abstracted behind one single domain which has your proxy server doing load balancing, https wrapping etc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.