Web-development – How to consider when deciding if I should use a web service backend instead of traditional MVC

programming practicesweb-development

We're trying to decide what architecture to use for an upcoming web application that will eventually have a mobile portion as well. The core of the project is a social networking web application, and the mobile portion will most likely have a limited subset of the web functionality.

The two options we are looking at is either a complete web service back end, or using a traditional MVC framework for the web application and then developing web services on the side for the mobile application later.

Some arguments for web-service-only route is that it would be "simpler", as we would just have to create 1 web service as opposed to creating both a web service for the mobile portion, and additional database functions/calls for the web application. Using this method, the web application will fetch data from the web services using javascript, which would then generate the html page (sounds kind of like what a traditional MVC framework does, but this way would require everything to be done in javascript).

I'm not feeling good about the idea of using web services only because it doesn't make sense to me, but I am having trouble clarifying my issues with it.

So what should I consider when trying to determine if we should use a complete web-service backend for our project instead of traditional MVC with web services only available when needed for the mobile portion of the app?

I'm looking for a comprehensive answer to this question, not many answers each containing one piece of the answer.

Best Answer

When implemented properly you may be able to have both worlds. When you go the web service route you may be sending the json version of the models you would be using to render your MVC views with otherwise.

For the web version you would need to build your html somewhere. I think you can do this mostly server side or do it using some form of javascript client side templating. The data/model either requires is going to be the same.

If the web service route means SOAP I would disagree also.

Why not make the web application mobile capable? You may end up not needing a native mobile app at all...