System architecture approach

When building web applications, we can distinguish between two approaches—multi-page application and single-page application.

In multi-page application, most of the business logic is implemented in the backend system, with some enhancement done in JavaScript. For example, the Ruby on Rails application, where most of the main logic is done by the backend MVC architecture and when a user navigates to another page, an ordinary http request is sent.

In single-page application, most of the business logic is implemented on the frontend side. For example, the JavaScriptMVC application, where most of the main logic is done by frontend MVC architecture. When a user navigates to another page, the frontend router dispatches all requests and makes calls to the back end API written; for example, in Sinatra.

JavaScriptMVC single-page application

JavaScriptMVC is designed for single-page application use cases. It's good to know about the advantages and disadvantages of the single-page application approach compared to that of the multi-page application.

Advantages

  • Most of the states are maintained in the client, so we don't need to keep the session states on the server side
  • Most of the requests are done through XRH calls, so there is no need to load a new page each time, which could cause high memory footprint (especially in the old fashion, non event-based servers such as Apache)
  • Most of the business logic is on the client side, so we can save many calls to the server

Downsides

  • Load balance and Content Delivery Network (CDN) can be tricky since RPC is used to move data back and forth between the server and client.
  • Search Engine Optimization (SEO) can be tricky due to on-demand JavaScript built pages.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.38.92