1

Which is the best approach when developing a dynamic web app with multiple views and dynamic content. regarding server load and responce times:

  1. use a server side mvc (such as Sailsjs or ASP.NET MVC) to render and then display views or
  2. use an api to get data from the server and a client side MVC (such as angular) to render the views

Which approach imposes less load on the server?

0

Disclaimer: There are so many other factors in play that your decision on which approach to use should probably not be made solely on this evaluation. Consider team skill sets, long-term maintainability, features needed versus features provided by various frameworks, which client platforms/devices you need to support, and so on. However, from a purely academic standpoint...

  • Server-side MVC: Server handles data access + building HTML

  • Client-side MVC: Server handles data access + serializing DTOs

So at first glance, it seems to be a simple matter of which is more resource-intensive, building HTML or serializing DTOs? If building HTML is less taxing than serializing DTOs, then go with server-side MVC. If not, then go with client-side MVC.

But one other factor to keep in mind is the raw number of HTTP requests hitting your server. With server-side MVC, this is likely to be relatively low (typically 1 request per "page"). But with client-side MVC, depending on how you set up your web services API, you could have any number of HTTP requests hitting your server for each "page" in the app. An extremely chatty approach could cause far more server resource utilization from HTTP request processing overhead than from the actual work of either building HTML or serializing DTOs.

  • As far aw team skills as concerned, I was thinking something like a node-based MVC for the backend and AngularJs for the front end. Both being javascript I think that most of the people in my team would welcome the change cause they would be able to maintain both front and back end. – gkaimakas Oct 13 '14 at 16:32
  • Funny, that's pretty much the same approach I'm thinking of using for my next project: A Node-based REST API (possibly using Sails.js), consumed by an AngularJS front end. I think the future looks very bright for both Node and AngularJS. – Troy Gizzi Oct 13 '14 at 16:54
  • Sails is great! Currently my team uses ASP MVC for web apps but I find it quite slow (!) and I've been trying to get them to use Sailsjs and Angular and all the awesome tools that exist (Bower, Grunt etc) – gkaimakas Oct 13 '14 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.