What are the advantages and disadvantages of SPA (Single-Page Application)?

Asked

Viewed 2,132 times

11

As far as I can tell, the spa (Single-Page Application) are basically pages that do not suffer constant Reload (so the name, in free translation, "Single Page Application"), that is, change their content dynamically by user interaction, unlike a conventional website, where each page with different content is loaded individually.

Researching on the subject, I have seen information that large sites such as Youtube, Gmail and Facebook use this feature. I have also noticed that almost everything is dealt with on the client side.

So I would like to know the advantages and disadvantages of using a SPA, in terms of security, SEO, maintenance, performance and what you can add will be of great use in terms of information.

  • 1

    If it is not reloaded all the time, the static files are loaded only once each. However, having only one page is more complicated, but not impossible, to treat SEO

1 answer

18

Perks

  • One of the biggest advantages, which encompasses the others, is the rendering being on the client side.
  • There is better overall user experience, of course, since everything well done, mainly the latency until the final rendering is extremely reduced.
  • There is reduced traffic to the server and this is obviously very good.
  • Especially parts that are always equal just don’t traffic anymore.
  • Remove server load that has a lot to do and little slack and seek to save on it by passing the heavy work to the client who always has a lot of slack, helping even reduce chances of attacks being successful.
  • In times of portviews Very variable and even changing halfway render on the client side is very important. Imagine every change having to go to the server to bring up every page again.
  • As everything is there monolithically it is easier to control the state between the various moments of the application, when it involves HTTP we have no status and we have to simulate a way to control it.
  • If done properly, you can keep running some parts without connection.
  • Not by the SPA itself, but the fact that the application as a whole has been designed for its use makes it easier to use the same application for other customers.

Disadvantages

  • In general it is more difficult to do right, almost everything we see is full of problems.
  • Especially it is difficult to encode Spas, difficult to test, monitor, analyze, reformulate, understand state passages, detect errors, catch security issues, etc.
  • Opens more security holes.
  • You have no control over what happens in the customer, and need more care with what comes from there, although this care should be absolute always.
  • It is much more difficult to maintain some states, history, position and other controls that complicate precisely by maintaining status or because the client does not know how to deal since he was prepared more to deal with several pages transacted, in short, navigation can be worsened.
  • It can be quite complicated to maintain good SEO, so SPA work best in applications, preferably closed to users logged, and not to content websites that need to be found. Although some think that today this is no problem, it is easy to fall into situations that content is not indexed, especially when one wants to make fun of the content and needs human interaction to appear. It is possible to solve all situations, but with a lot of work, a lot of difficulty to know if you attended everything and worsening the user experience. In general it doesn’t pay, and almost no one knows how to do it right, so it’s best to consider that SEO will always be harmed.
  • It needs to have mechanisms when it falls into content that is not the site’s point of entry, and that is not so simple, and almost always overlooked.
  • Most web programmers do not understand the medium and fail to produce usability suitable for something so complex, and that it needs to take care of, and that is not easy.
  • If you have a version change on the server you need to have a mechanism for the client to know this and make the transition properly. It is not simple to do without losses, and almost nobody does, probably nor is aware of the need for this.
  • Any change of version on browser or use other than normal can cause more problems. It’s not that it’s free if you choose to render on the server, but the more you use modern features, the more you abuse Javascript, the more you complicate the code there, the less you have control over the exact rendering. Remembering that there are people who do not enable JS or even use a browser capable of executing it. Maintenance can become a freak show, and everything for yesterday, a lot of the work is putting out fires that you didn’t create. Of course, many do not, because they have no control mechanisms if the client is working and create pages that few people use, so everything goes unnoticed. That is why more and more sites do not work. Do you contact to let us know that it does not work? Only if it is fundamental for you. He usually goes his whole life without working.
  • The browser is a very heavy and bad platform. A page quickly takes up more features that all Windows XP uses with multiple running applications. And people complained that the XP was heavy, now everything is beautiful, will understand people’s heads... If I abandon the use of web (I can keep the sites simple without SPA) I need a computer with half or up to 1/4 of the capacity. The application does not scale well.
  • Javascript is not a language created for large applications and therefore does not scale well. At the very least Typescript should be used. Actually TS has several of the problems of JS and so avoiding the use of these languages can bring more quality to the whole (although this also has its negative implications). Development does not scale well.
  • Most people who work with web aren’t real programmers and don’t know how to make complex applications. They turned out okay with a language of script on the server to deliver simple pages rendered there and eventually some script in the client to make a firula, but to make a complete application on top of a single document is much more complicated and we see horror show out there. It seems that people feel bad about not doing something simple, they want to do like Facebook thinking they are Facebook, without understanding how much the leading social network invests in talent to make it work.
  • When the SPA is used in place of a desktop or mobile application it may be harming the user experience in various ways.
  • The initial load can be significantly higher, which can amaze the internet user. Not only load, there are cases that experience is worse by latency even, or incredibly increases access to the server. It is full of page that responds more slowly with SPA. It is always a problem of who does not know how to do, but a problem that occurs enough.
  • It is common for spas to be less accessible for people with special needs.
  • People want to make fun, abuse, seems irresistible to put unnecessary wrinkles.

As a curiosity I see many people saying that SPA is more responsive, and the term is used correctly. The problem is that people also use "responsive" for measurement differences from viewport. This term has never been adequate and at that moment we see that they have two problems, besides having no meaning, it is ambiguous with another characteristic in the same context. This is responsive: respond quickly; forget the other use, we need another term for screen suitability.

  • Please avoid long discussions in the comments; your talk was moved to the chat and you can proceed by clicking on the link

Browser other questions tagged

You are not signed in. Login or sign up in order to post.