The application that I work on needs to have a web interface (ASP.NET MVC) and mobile interfaces (Android/IPhone native). The features for mobile applications and web application might not overlap (some features are similar, some are different)
At the moment, I'm thinking of 2 ways to structure the applications like below:
For the top approach, just need one web server that server both web and mobile clients. Mobile will communicate with server through Json (serialized by ASP.NET MVC). The service layer is just a plain class library to be referenced by web layer
- Pros
- Faster, since there's no cross-machine communication between web and service layer
- Simpler
- Cons
- Security? Any security concern here?
- Less flexible when scaling (can only scale both web and service layer as one unit).
For the bottom approach, need one web server and one application server (for WCF/Web API). Mobile will communicate directly with application server through Json
- Pros
- Can secure web and application servers separately, extra layer of protection on application layer. But the application server is exposed to mobile anyway right?
- Can scale web and application servers independently
- Cons
- Slower
- More complicated due to WCF/Web API in the middle
It's the first time I do the application for both web and mobile like this. Which approach is commonly used in this scenario? User tends to favor bottom approach, but I think in this case it might be overkill to follow bottom approach