Client Side mvc versus Server side pros and cons

Some technologies will work better for some situations than others. Client side mvc is more suitable for some use cases than others. 
So it depends on many factors. e.g. If a "desktop-like" ui experience is critical, then think client side mvc. If your team has little javascript experience or mvc experience or you have significant SEO requirements then client side mvc may not be a good fit. 
The following are my opinions and are not conclusive. Recommend you also research the web.

Client side mvc
Pro: User experience: traditional web apps typically submit a request and get back a full page each time; client side mvc apps handle more processing on the client and also typically make data requests to the client which should be faster to turnaround. Use gmail? Then you're using a single page app. gmail and others such apps provide a desktop-like experience in the browser. No page refreshes. We'll see more and more of these kinds of apps.
Pro: Code organization: mvc is an established pattern and brings organization to complicated client side code, which is becoming more and more complicated (how many lines javascript in gmail which downloads over 400kb of optimized javascript!)
Pro: Server load; less and smaller (data) requests to server; more work done on clients browser
Pro: fun! not to be underestimated but as a developer, to me its fun and enjoyable to develop client side mvc (especially if you have the right tooling and build scripts e.g. see yoeman.io project)
Con: SEO: client side mvc uses hashbang in url for older browsers (< IE9) to navigate pages then that is not seen by SEO crawlers. Not an issue for all apps, but is an issue for some e.g. not an issue for apps which require user input to get to next step (e.g. step by step wizards) since they cannot be crawled anyway.
Con: Rendering: with client side mvc this is both a pro and a con frankly. A benefit is rendering views on the client but a challenge can be reusing the same rendering (if needed) on the server.
Con: like any technology there's a learning curve (but then again, learning curves are a given in the technology business)

Server side mvc
Pro: SEO: Does not have SEO issues since uses normal urls (no hashbang)
Pro: Well known and understood
Pro: Rendering and routing on the server; frankly depending on how you view it this is also a con!
Con: Full page loads; can be mitigated some but still not same as whats possible with client side mvc
Con: Client side code organization; most apps have a lot of logic and javascript on the client these days. Server side mvc does not help organize code on client side. So developers are left to their own devices, sometimes good sometimes bad. Client side mvc brings consistent organization and patterns to the client.

Comments

Popular posts from this blog

deep dive into Material UI TextField built by mui

angular js protractor e2e cheatsheet

react-router v6.4+ loaders, actions, forms and more