client-MVC vs server-MVC

Justin picture Justin · May 8, 2013 · Viewed 14.9k times · Source

I am looking to get some input from other users on the benefits of server-side MVC. With the power of many javascript libraries. What good purpose does server-side MVC server anymore?

You can easily use client-side MVC with templating and a REST API to make a much more resposive application with less overhead of reloading a whole page for minor changes.

Answer

Kingz picture Kingz · Nov 21, 2013

The way I see this, the server side MVC remains relevant if you consider the V as your client side MVC wrapped in a black box. The thing is that this is all about collaboration and scalability. The server side MVC continues to fuel the REST APIs (for instance) with the notion that you are technically outsourcing the viewing technology to a separate framework running in your browser.

Since browser is increasingly seen as application development platform, you can export huge amounts of data from your "backend platform" to the client (browser) and then treat the data as a local "database" in your browser allowing fast response time.

Combining these 2 MVC frameworks allows for:

  1. Sparse traffic between server and client thereby decreasing latency
  2. Increasing responsiveness of your web apps by localizing access to more relevant data set
  3. Distributing the load from a single, server side controller to hundreds of browsers

The architecture at work here is very similar to CDNs - content delivery networks! Really it is about localizing data, and bringing it nearer to processing centers.

Having said this, you may continue to make exclusive use of one over another, if you understand the architectural needs of your product. Right tool for the right job.