The following is a schematic overview of the situation:
WEBSERVER <----> MIDDLEWARE SERVER <----> Database
- Webserver: IIS / ASP.net 4.0 (WebForms & MVC)
- Middleware server: WCF Services
- Database server: Oracle
The webserver is physically seperated from the Oracle database.
What we'd like to do is use ASP.Net Web API on the frontend of the webapplications to integrate quick binding of data in a new Single Page Application using JQuery / KnockoutJS. Therefore we would need a JSON API from the data in the database to access using JQuery.
We would like to use PetaPoco for talking to the database.
However, the WEB API project has to run on the middleware server to get it's data from the database. But ofcourse then we can never access the WEB API using JQuery on the front end.
I'm thinking about setting up a WEB API on the Webserver, which connects to the middleware server using a different technique maybe plain old WCF like we do now. However this seems like so much of an overkill.
Does somebody have some insights in how to improve this architecture? I'm sure somebody has set up a SPA application using WEB API in a similar environment.