8

I am currently researching the benefits and disadvantages of SPA (Single-Page Applications) vs MPA (Multi-Page Applications). Having established that MPA is more suitable for my project, I proceeded to discuss Server-Side Rendering vs Client-Side Rendering. But as I was doing that, I noticed that a lot of benefits, arguments, etc. overlap with arguments in SPA vs MPA. My conclusion was that pure client-side rendering is not possible with an MPA and therefore I have to proceed with server-side rendering combined with client-side (to update small pieces of information). Is my conclusion right?

Because I feel like I'm repeating myself when I talk about rendering after talking about SPA vs MPA. Right now, the concepts of SPA vs MPA and Client-side vs Server-side are blurred into one for me.

4
  • 1
    I didn't downvote, but I can take a guess why. There isn't (in my opinion) a clear, answerable question here with a reasonable scope. The only question I can find in there is "am I right?". Well, the answer to that is either "yes" or "no", neither of which are a good fit for StackExchange (questions that result in a little bit longer and more detailed answers tend to be preferred). But given the last paragraph, it looks like you might be trying to get an explanation as to how SPA/MPA is different from client/server rendering which is a very broad question (also discouraged). Just a guess.
    – Becuzz
    Aug 14, 2018 at 17:36
  • @Becuzz Thank you for your feedback, I guess you are right, it is very broad. I guess I just needed a clarification whether I'm not repeating myself when talking about rendering after SPA and MPA. I'll try to edit the question, if it's possible :) Thanks again :)
    – Suleyman
    Aug 14, 2018 at 18:09
  • 1
    SPA applications can take advantage to use the same API(backend) of other platforms applications, such as mobile application. Aug 14, 2018 at 20:33
  • @LeonanCarvalho thanks for the clarification :) I'll have to take that into account when deciding between the two.
    – Suleyman
    Aug 14, 2018 at 20:36

1 Answer 1

7

SPAs and MPAs

The core difference between a SPA and a MPA is that with a single-page application, all the requests happen within the lifecycle of a single HTML page. You might be able to see different views, even see different "pages" of the application, but all the rendering takes place within a single HTML web page. This has the advantage of keeping the state of the "application" all in one scope. Think of an application like messenger.com, where there are still a lot of moving parts but you never have to actually leave a page.

An MPA, by contrast, will have the user visiting multiple distinct HTML pages. All scripts will be re-executed when the new HTML page loads and any state must be persisted in the session or in local storage. This is more like stackoverflow.com's model.


Client-Side and Server-Side

You can have pure client-side apps which do all rendering and logic with Javascript, and which only reach out to the backend for API operations. You can also have pure server-side apps (most common with PHP, I'd say) where all the HTML and content is pre-rendered on the server before being downloaded by the web browser.

Client-side rendering and server-side rendering are commonly mixed, though. For example, stackoverflow.com renders the web page with the questions and answers on it on the server-side and sends it to you. Client-side rendering is then used for the upvote/downvote AJAX, adding new comments, and for previewing answers to questions in the browser.


I hope this is helpful. You're correct that the concepts are similar and can even be mixed with each other.

0

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.