SlideShare a Scribd company logo
Single Page Applications (SPA)
Agenda
 What is Single Page Application
 Difference from traditional web application
 Why SPA?
 SPA Frameworks
 Challenges
Definition
• A single-page application (SPA), is a web application or web site that fits on a single web
page with the goal of providing a more fluid user experience akin to a desktop application.
• In a SPA, either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single
page load or the appropriate resources are dynamically loaded and added to the page as
necessary, usually in response to user actions.
• The page does not reload at any point in the process, nor does control transfer to another
page.
• Interaction with the single page application often involves dynamic communication with
the web server behind the scenes.
Characteristics
 Chunking – the web page is constructed by loading chunks of HTML fragments and JSON data instead of receiving full
HTML from a web server on every request. (Backbone.js, jQuery, Upshot.js)
 Controllers – mess of JavaScript code that handles tangled DOM and data manipulations, application logic and AJAX calls
is replaced by controllers that separate views and models using MVC or MVVM patterns.
(Backbone.js, Knockout.js, JavascriptMVC)
 Templating – coding of UI and DOM manipulations are replaced by declarative binding of data to HTML templates.
(Knockout.js, Mustache, jQuery Templates, Underscore.js)
 Routing – selection of views and navigation (without page reloads) that preserves page state, elements and data
(Histrory.js, Crossroads.js, Backbone.js, pjax, HTML5 History API)
 Real-time communication – two-way communication of a client application and web server replaces one-way requests
from a browser (HTML 5 Web Sockets, Socket.io, SignalR)
 Local storage – capabilities of storing data on a browser for performance and offline access replace cookies and intensive
data loads from web server (HTML 5 Local storage).
Difference from traditional web application
 Traditional web page
 Request sent to server
 HTML Response from server
 Browser unloads previously loaded DOM
 Browser creates DOM for the response
 Browser renders DOM
 SPA
 Does not reload the page
 Load Resources (Html, CSS, JavaScript) on
initial page load or as required generally in
response to user action
Why to use SPA
 Performance is certainly better with client-side rendering if you do it right, but
this is not the most compelling reason to build a SPA. (Network speeds are
improving, after all.) With SPA we don't need to use extra queries to the
server to download pages.
 No page flickering since no page reload
 Faster UI, more interactive
 Less data transfer between clients and servers
 Caching is lot easier as static data is explicitly separated
 Faster Development
When to use SPA
 Native/Desktop like application experience is desired.
 Highly responsive site is desired. Real time communication
 Supports tons of rich UI components in multiple states on same page very efficiently.
Top Challenges in SPA
 Analytics
 Analytics code that run on every page load fails to work in case of SPA, as there is no page reload
 Browser constraints
 Back button behavior is not easy to maintain, manual coding efforts needs to be made to maintain the
browser state
 Bookmark handling, (every time we open the previously saved bookmark, the expected view needs to
be rendered)
 Security Concerns
 Single Page Apps are a little extra vulnerable to both Cross-Site Scripting (XSS) attacks and Cross-Site
Request Forgery (CSRF) attacks. We have to be little extra cautious while building SPA, to defuse such
attacks though server side apps are also vulnerable.

More Related Content

PDF
Learning Single page Application chapter 1
PPTX
Single page applications
PPTX
Iseltech17 - Single Page Applications
PPTX
Single Page Application Development with backbone.js and Simple.Web
PDF
Introduction To Single Page Application
PPTX
Single Page Application
PPTX
Rise of the responsive single page application
PPTX
Single page application
Learning Single page Application chapter 1
Single page applications
Iseltech17 - Single Page Applications
Single Page Application Development with backbone.js and Simple.Web
Introduction To Single Page Application
Single Page Application
Rise of the responsive single page application
Single page application

What's hot (20)

PPTX
Making Single Page Applications (SPA) faster
PPTX
Single page App
PPTX
Single page application and Framework
PPTX
Building WordPress sites with AngularJS and the RESTful plugin JSON API
PPTX
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
PDF
Single page applications
PPTX
Getting SEO performance in Angular Meteor with ngmeta
PPT
single page application
PPSX
Web technologies practical guide
PPTX
Using MAMP for Web Development
PDF
Using WordPress as a Headless CMS
PDF
Server rendering-talk
PPTX
Javascript & Jquery
PDF
node.js in action
PPT
PPTX
Basic web page designing
PPTX
Modern Applications With Asp.net Core 5 and Vue JS 3
PPT
Basic web designing 2
PPTX
A Gentle Introduction to Blazor
PDF
Building JavaScript Apps for Force.com with EmberJS
Making Single Page Applications (SPA) faster
Single page App
Single page application and Framework
Building WordPress sites with AngularJS and the RESTful plugin JSON API
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Single page applications
Getting SEO performance in Angular Meteor with ngmeta
single page application
Web technologies practical guide
Using MAMP for Web Development
Using WordPress as a Headless CMS
Server rendering-talk
Javascript & Jquery
node.js in action
Basic web page designing
Modern Applications With Asp.net Core 5 and Vue JS 3
Basic web designing 2
A Gentle Introduction to Blazor
Building JavaScript Apps for Force.com with EmberJS
Ad

Viewers also liked (14)

PPTX
Cloud & PHP
PPT
NJ Future Forum 2012 Net-Plus LeJava
DOC
PPT
Evaluacion
PPT
International Trade hs
PDF
Scoping Study of Land Tenure and Land Governance Issues in Latin A...
PPTX
Producto comunicativo foro i e learning
PPT
Leed nd and local governments 031213_Includes Aurora and Arvada
PDF
Storytelling in Transylvania: Make Your Voice Heard
PDF
Γ1 Πρόσκληση σε αποκριάτικο πάρτυ
PPT
PROPAGANDA REIGIOSA
PPTX
Pasqua unitat didàctica
Cloud & PHP
NJ Future Forum 2012 Net-Plus LeJava
Evaluacion
International Trade hs
Scoping Study of Land Tenure and Land Governance Issues in Latin A...
Producto comunicativo foro i e learning
Leed nd and local governments 031213_Includes Aurora and Arvada
Storytelling in Transylvania: Make Your Voice Heard
Γ1 Πρόσκληση σε αποκριάτικο πάρτυ
PROPAGANDA REIGIOSA
Pasqua unitat didàctica
Ad

Similar to Single page applications (20)

PDF
Single Page Application (SPA): A Comprehensive Guide for Beginners
PPT
Lessons from the Trenches: Engineering Great AJAX Experiences
PPT
Lessons
PPT
Ajax Ppt 1
PDF
Components of a Generic Web Application Architecture
PDF
Web Usability
PPTX
Angular jS Introduction by Google
 
PPTX
My Presentation On Ajax
PPTX
Benefits of developing single page web applications using angular js
PPTX
Overview of AJAX
PPT
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
PPT
Performance anti patterns in ajax applications
PDF
Modern Web Applications
DOCX
Single Page Application
PPTX
Web assembly with PWA
PPTX
Seminar report based on Mern stack web technology
PPT
Advantages and disadvantages of an ajax based client application
PPT
jQuery Ajax
PDF
Ajax & Reverse Ajax Presenation
Single Page Application (SPA): A Comprehensive Guide for Beginners
Lessons from the Trenches: Engineering Great AJAX Experiences
Lessons
Ajax Ppt 1
Components of a Generic Web Application Architecture
Web Usability
Angular jS Introduction by Google
 
My Presentation On Ajax
Benefits of developing single page web applications using angular js
Overview of AJAX
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
Performance anti patterns in ajax applications
Modern Web Applications
Single Page Application
Web assembly with PWA
Seminar report based on Mern stack web technology
Advantages and disadvantages of an ajax based client application
jQuery Ajax
Ajax & Reverse Ajax Presenation

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
KodekX | Application Modernization Development
PDF
cuic standard and advanced reporting.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
A Presentation on Artificial Intelligence
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Chapter 3 Spatial Domain Image Processing.pdf
KodekX | Application Modernization Development
cuic standard and advanced reporting.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Modernizing your data center with Dell and AMD
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Unlocking AI with Model Context Protocol (MCP)
A Presentation on Artificial Intelligence
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Single page applications

  • 2. Agenda  What is Single Page Application  Difference from traditional web application  Why SPA?  SPA Frameworks  Challenges
  • 3. Definition • A single-page application (SPA), is a web application or web site that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application. • In a SPA, either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single page load or the appropriate resources are dynamically loaded and added to the page as necessary, usually in response to user actions. • The page does not reload at any point in the process, nor does control transfer to another page. • Interaction with the single page application often involves dynamic communication with the web server behind the scenes.
  • 4. Characteristics  Chunking – the web page is constructed by loading chunks of HTML fragments and JSON data instead of receiving full HTML from a web server on every request. (Backbone.js, jQuery, Upshot.js)  Controllers – mess of JavaScript code that handles tangled DOM and data manipulations, application logic and AJAX calls is replaced by controllers that separate views and models using MVC or MVVM patterns. (Backbone.js, Knockout.js, JavascriptMVC)  Templating – coding of UI and DOM manipulations are replaced by declarative binding of data to HTML templates. (Knockout.js, Mustache, jQuery Templates, Underscore.js)  Routing – selection of views and navigation (without page reloads) that preserves page state, elements and data (Histrory.js, Crossroads.js, Backbone.js, pjax, HTML5 History API)  Real-time communication – two-way communication of a client application and web server replaces one-way requests from a browser (HTML 5 Web Sockets, Socket.io, SignalR)  Local storage – capabilities of storing data on a browser for performance and offline access replace cookies and intensive data loads from web server (HTML 5 Local storage).
  • 5. Difference from traditional web application  Traditional web page  Request sent to server  HTML Response from server  Browser unloads previously loaded DOM  Browser creates DOM for the response  Browser renders DOM  SPA  Does not reload the page  Load Resources (Html, CSS, JavaScript) on initial page load or as required generally in response to user action
  • 6. Why to use SPA  Performance is certainly better with client-side rendering if you do it right, but this is not the most compelling reason to build a SPA. (Network speeds are improving, after all.) With SPA we don't need to use extra queries to the server to download pages.  No page flickering since no page reload  Faster UI, more interactive  Less data transfer between clients and servers  Caching is lot easier as static data is explicitly separated  Faster Development
  • 7. When to use SPA  Native/Desktop like application experience is desired.  Highly responsive site is desired. Real time communication  Supports tons of rich UI components in multiple states on same page very efficiently.
  • 8. Top Challenges in SPA  Analytics  Analytics code that run on every page load fails to work in case of SPA, as there is no page reload  Browser constraints  Back button behavior is not easy to maintain, manual coding efforts needs to be made to maintain the browser state  Bookmark handling, (every time we open the previously saved bookmark, the expected view needs to be rendered)  Security Concerns  Single Page Apps are a little extra vulnerable to both Cross-Site Scripting (XSS) attacks and Cross-Site Request Forgery (CSRF) attacks. We have to be little extra cautious while building SPA, to defuse such attacks though server side apps are also vulnerable.

Editor's Notes

  • #7: Desktop feel – no flickering / white pages – no complete reload, Only parts of the application are repainted Faster, More interactive – user feel connected – generally I would go visit some other tab / some other app while a page is loading .. But these apps doesn’t give enough time They keep you busy. Less data transfer : previously <HTML>data<HTML> Caching – a big plus and credit goes to clear saperation of data and templates. Cached by browser During app use most SPA technologies would cache templates in memory Offloading – intelligent solution to buden browser with some processing Faster development – generally SPA framewok is used which lets you quite easily play with the UI. No more worry about updating the DOM with result, all you care is updating the model View upation happens automatically