SlideShare a Scribd company logo
Fat client 2009: JavaScript Maciej Książek (www.drclick.pl)  for Krakow Ruby Users Group ruby.org.pl June 2009
Last decade of webapplications Thin client  Fat server
Last decade - summary Websites were more documents  then applications JavaScript used only for simple interface checks The only storage is the server or cookie (max 4 kb) JavaScript is extremely slow, incompatible for different browsers Network bandwidth very low User machines not so powerful
Is it natural ?  Previously the client was doing more then showing single document Server was used mostly as a storage and business logic Over the years good architectures established with optimally shared load of work between C/S NO!  What was before?  (before www era)
What’s wrong  with “standard”  web application web application
1. Response times  Relatively high Network operation will always be slower then local operation
2. Distribution of work Servers are doing all the job Clients are very often almost idle Processor power of all users compared to even farm of few servers is extremely higher
3. Sessions Client’s state is handled by Server ! WTF ? Example of webstore transaction Would this term exist at all ?
4. Interface on server HTML, Javascript  -should be Client’s job! It is  NOT natural  ! More  complicated  then it should be ! Interface is produced on server side !
5. JavaScript itself Slow, OK very slow Single threaded No access to any storage directly
6. No offline support No  way to  work offline  Even browser has cached content
What’s next ? Still  server  does  interface  job  (server responses with HTML or even JavaScript ) Every  state change  involves  server  AJAX  (typical approach) just step forward
Web application 2010  Business logic  Storage and data exchange  Mostly returning data  (as JSON, yml, xml etc)  Security  Serving client application  (templates + Javascript Sources)  Server jobs:
Web application 2010  Interface logic  (also keeps templates, static files cached ) Operate on data locally  (local storage, session storage, SQLite) Exchange data with server   (only when expected by business logic and when online) "Session" Client jobs:
What happened lately,  so it is  all possible  ? ?
New browsers  came out this year:  Firefox 3.5(RC for now) Safari 4.0 Internet Explorer 8 Chrome Opera 10 (beta now)
New faster  JavaScript engines : V8  - Google Chrome  TraceMonkey  - Firefox 3.5  SquirrelFish  - Safari 4.0 JIT  -  just in time compilation, compiling JS code into native machine code (byte code interpreter eliminated) Much faster then their predecessors !
HTML5  closer and closer LocalStorage and sessionStorage  Databse Storage  Canvas Worker threads  Geolocation  Important features:
HTML5  closer and closer Better audio video support Post message  (communication between frames)  Requests across domains Offline support  (FF3 and IE8 or via Gears in all but Opera) Cross document messaging  http://www.whatwg.org/specs/web-apps/current-work/# crossDocumentMessages and more....(client side validation, drag&drop, nativeJSON support)
HTML5  closer and closer specification is not final new browsers support most of the features
Database storage Client side database accessed from JavaScript. db = openDatabase("dbUsers", "1.0", "UsersDatabase", 300000);db.transaction(function(tx) { tx.executeSql("CREATE TABLE users (id REAL, name STRING, email STRING)"); });db.transaction(function(tx) { tx.executeSql("SELECT * FROM users”, [], \ function(tx, result) { alert(result.rows.item(0)['email']); }); }); Already implemented in Safari 4 and for all browser but opera through Gears project W3C specification:  http://www.w3.org/TR/offline-webapps/#sql
Database storage No ORM by default. • ActiveRecordJS  - AR implementation by Aptana • JazzRecord  - a lso AR imp lementation • JStORM    • jBati  - insp ired b y iBatis Ready solutions:  http://www.w3.org/TR/webstorage/#sql
local & session storage sessionStorage['friendIds'] = [1,2,3];// reload page  alert(sessionStorage['friendIds']); sessionStorage - really easy API  // examples : localStorage.loginKey = "randomStringKey123";alert(localStorage.loginKey); // => "randomStringKey123" if (!localStorage.getItem('firstVisit'))  localStorage.setItem('firstVisit', Date()); localStorage.key(1); // => ‘firstVisit’localStorage.clear(); More info:  http://www.w3.org/TR/webstorage/ localStorage
local & session storage only flat structure and only strings with native JSON support can be easy extended currently supported by Safari 4, FireFox 3.5, IE8
Offline Caching  -  manifest file Manifest file   Allows to specify what request responses browser should cache and use while offline (or online too). CACHE MANIFEST# v1 http://www.LunarLogicPolska.com/index.html http://www.LunarLogicPolska.com/logo.png / logohttp://www.LunarLogicPolska.com/user _profile_template.html /user_template.html
Offline Caching  -  check status document.body.addEventListener("offline", function () {  alert("We are offline");}, false);// Similar event for online event “offline” window.navigator property window.navigator.onLine  // returns false if definitely offline or true when possibly online
Offline caching  online Offline caching  can be used also  online  ! The prize is  performance
Geolocation function showMap(position) {  // Show a map centered at  // (position.coords.latitude, position.coords.longitude).}// One-shot position request.navigator.geolocation.getCurrentPosition(showMap); Browsers : FF3.5, Safari for  iPhone, Opera (now separate build), IE8 (experimental support), or in most by Gears  source and more examples:  http://www.w3.org/TR/2008/WD-geolocation-API-20081222/#introduction Returns users position (few ways to detect it)
Canvas http://www.whatwg.org/specs/web-apps/current-work/#the-canvas https://developer.mozilla.org/en/drawing_graphics_with_canvas Allows to “draw” with JavaScript  More info:
Other tools JAXER - Ajax server (APTANA) REST clients in JS : Jester and ActiveJAX JavaScript accessible databases: Preserve’s JavascriptDB, DBSlayer
Example workflow Browser DB sessionStorage offline Cache browser manifest file JS ORM JS REST (JSON) Templates, static files SQL JS DB SQL {key: val} Server
Example workflow Browser DB sessionStorage offline Cache browser manifest file JS ORM JS REST (JSON) Templates, static files SQL JS Preserve JavaScriptDB DB SQL {key: val} Server
Example - practice Homepage:-  template and static files cached by manifest file -  signed in user's data get with JSON format and saved in local storage  Start page - static files already taken from cache (manifest) - get template of start page  - page data loaded in JSON format and saved in local storage Friend's profile -  static files taken from cache - get template for profile page   -  get JSON formated data about the user second friend's profile  - static files - from cache  - template from cache  -  just get data about the user
Impact on  Ruby  community Most of us code mostly in  Rails  = web applications Good sign  for Ruby ? when server used rarely = language performance matters less better scalability
Impact on  Ruby  community Flexible, quickly reacting community: big chances to take lead in new areas New frameworks server-side support still needed  generate “standard” HTML for SEO  Rails.... Merb... Sinatra.. - simple, flexible background for them
Questions Maciej Książek (   www.drclick.pl  )  for Krakow Ruby Users Group www.ruby.org.pl ruby.org.pl June 2009
Ad

More Related Content

What's hot (20)

Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
Zoran Jeremic
 
Your browser, my storage
Your browser, my storageYour browser, my storage
Your browser, my storage
Francesco Fullone
 
Exciting JavaScript - Part II
Exciting JavaScript - Part IIExciting JavaScript - Part II
Exciting JavaScript - Part II
Eugene Lazutkin
 
Architecture Best Practices
Architecture Best PracticesArchitecture Best Practices
Architecture Best Practices
AWS Germany
 
JavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User ExperienceJavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User Experience
reeder29
 
Break out of The Box - Part 2
Break out of The Box - Part 2Break out of The Box - Part 2
Break out of The Box - Part 2
Karl-Henry Martinsson
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
Jef Claes
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB API
Pankaj Bajaj
 
Plone.restapi - a bridge to the modern web
Plone.restapi - a bridge to the modern webPlone.restapi - a bridge to the modern web
Plone.restapi - a bridge to the modern web
Timo Stollenwerk
 
AD102 - Break out of the Box
AD102 - Break out of the BoxAD102 - Break out of the Box
AD102 - Break out of the Box
Karl-Henry Martinsson
 
IBM Connect 2016 - Break out of the Box
IBM Connect 2016 - Break out of the BoxIBM Connect 2016 - Break out of the Box
IBM Connect 2016 - Break out of the Box
Karl-Henry Martinsson
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)
Jef Claes
 
Flash And Dom
Flash And DomFlash And Dom
Flash And Dom
Mike Wilcox
 
J web socket
J web socketJ web socket
J web socket
Hiroshi Ochi
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
Lorna Mitchell
 
Searching for the framework of my dreams in node.js ecosystem by Mykyta Semen...
Searching for the framework of my dreams in node.js ecosystem by Mykyta Semen...Searching for the framework of my dreams in node.js ecosystem by Mykyta Semen...
Searching for the framework of my dreams in node.js ecosystem by Mykyta Semen...
Binary Studio
 
Building Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using WebsocketsBuilding Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using Websockets
Naresh Chintalcheru
 
PHP and Web Services
PHP and Web ServicesPHP and Web Services
PHP and Web Services
Bruno Pedro
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
JeongHun Byeon
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
Zoran Jeremic
 
Exciting JavaScript - Part II
Exciting JavaScript - Part IIExciting JavaScript - Part II
Exciting JavaScript - Part II
Eugene Lazutkin
 
Architecture Best Practices
Architecture Best PracticesArchitecture Best Practices
Architecture Best Practices
AWS Germany
 
JavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User ExperienceJavaScript Service Worker Design Patterns for Better User Experience
JavaScript Service Worker Design Patterns for Better User Experience
reeder29
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
Jef Claes
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB API
Pankaj Bajaj
 
Plone.restapi - a bridge to the modern web
Plone.restapi - a bridge to the modern webPlone.restapi - a bridge to the modern web
Plone.restapi - a bridge to the modern web
Timo Stollenwerk
 
IBM Connect 2016 - Break out of the Box
IBM Connect 2016 - Break out of the BoxIBM Connect 2016 - Break out of the Box
IBM Connect 2016 - Break out of the Box
Karl-Henry Martinsson
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)
Jef Claes
 
Searching for the framework of my dreams in node.js ecosystem by Mykyta Semen...
Searching for the framework of my dreams in node.js ecosystem by Mykyta Semen...Searching for the framework of my dreams in node.js ecosystem by Mykyta Semen...
Searching for the framework of my dreams in node.js ecosystem by Mykyta Semen...
Binary Studio
 
Building Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using WebsocketsBuilding Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using Websockets
Naresh Chintalcheru
 
PHP and Web Services
PHP and Web ServicesPHP and Web Services
PHP and Web Services
Bruno Pedro
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
JeongHun Byeon
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 

Similar to Krug Fat Client (20)

Jsp Comparison
 Jsp Comparison Jsp Comparison
Jsp Comparison
Venky Sadasivam
 
Os Henrikson
Os HenriksonOs Henrikson
Os Henrikson
oscon2007
 
HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)
Kevin Gill
 
Local storage
Local storageLocal storage
Local storage
Adam Crabtree
 
your browser, my storage
your browser, my storageyour browser, my storage
your browser, my storage
Francesco Fullone
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8
David Chou
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
Jonathan Abrams
 
Html5
Html5Html5
Html5
Zahin Omar Alwa
 
Mobile Web
Mobile WebMobile Web
Mobile Web
Ankit Maheshwari
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
yoavrubin
 
HTML5
HTML5HTML5
HTML5
Maurice De Beijer [MVP]
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
Commit University
 
Web assembly with PWA
Web assembly with PWA Web assembly with PWA
Web assembly with PWA
Shashank Sharma
 
Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2
jamram82
 
spring Boot Tutorial Part 1(JPA&Hibernate)
spring Boot Tutorial Part 1(JPA&Hibernate)spring Boot Tutorial Part 1(JPA&Hibernate)
spring Boot Tutorial Part 1(JPA&Hibernate)
abdelr7man3mad2004
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
Murthy Chintalapati
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
Wesley Hales
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbone
zonathen
 
Ajax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE EnvironmentAjax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE Environment
starchaser
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
Mahmoud Tolba
 
Os Henrikson
Os HenriksonOs Henrikson
Os Henrikson
oscon2007
 
HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)
Kevin Gill
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8
David Chou
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
Jonathan Abrams
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
yoavrubin
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
Commit University
 
Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2
jamram82
 
spring Boot Tutorial Part 1(JPA&Hibernate)
spring Boot Tutorial Part 1(JPA&Hibernate)spring Boot Tutorial Part 1(JPA&Hibernate)
spring Boot Tutorial Part 1(JPA&Hibernate)
abdelr7man3mad2004
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
Wesley Hales
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbone
zonathen
 
Ajax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE EnvironmentAjax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE Environment
starchaser
 
Ad

Recently uploaded (20)

UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Ad

Krug Fat Client

  • 1. Fat client 2009: JavaScript Maciej Książek (www.drclick.pl) for Krakow Ruby Users Group ruby.org.pl June 2009
  • 2. Last decade of webapplications Thin client Fat server
  • 3. Last decade - summary Websites were more documents then applications JavaScript used only for simple interface checks The only storage is the server or cookie (max 4 kb) JavaScript is extremely slow, incompatible for different browsers Network bandwidth very low User machines not so powerful
  • 4. Is it natural ? Previously the client was doing more then showing single document Server was used mostly as a storage and business logic Over the years good architectures established with optimally shared load of work between C/S NO! What was before? (before www era)
  • 5. What’s wrong with “standard” web application web application
  • 6. 1. Response times Relatively high Network operation will always be slower then local operation
  • 7. 2. Distribution of work Servers are doing all the job Clients are very often almost idle Processor power of all users compared to even farm of few servers is extremely higher
  • 8. 3. Sessions Client’s state is handled by Server ! WTF ? Example of webstore transaction Would this term exist at all ?
  • 9. 4. Interface on server HTML, Javascript -should be Client’s job! It is NOT natural ! More complicated then it should be ! Interface is produced on server side !
  • 10. 5. JavaScript itself Slow, OK very slow Single threaded No access to any storage directly
  • 11. 6. No offline support No way to work offline Even browser has cached content
  • 12. What’s next ? Still server does interface job (server responses with HTML or even JavaScript ) Every state change involves server AJAX (typical approach) just step forward
  • 13. Web application 2010 Business logic Storage and data exchange Mostly returning data (as JSON, yml, xml etc) Security Serving client application (templates + Javascript Sources) Server jobs:
  • 14. Web application 2010 Interface logic (also keeps templates, static files cached ) Operate on data locally (local storage, session storage, SQLite) Exchange data with server (only when expected by business logic and when online) "Session" Client jobs:
  • 15. What happened lately, so it is all possible ? ?
  • 16. New browsers came out this year: Firefox 3.5(RC for now) Safari 4.0 Internet Explorer 8 Chrome Opera 10 (beta now)
  • 17. New faster JavaScript engines : V8 - Google Chrome TraceMonkey - Firefox 3.5 SquirrelFish - Safari 4.0 JIT - just in time compilation, compiling JS code into native machine code (byte code interpreter eliminated) Much faster then their predecessors !
  • 18. HTML5 closer and closer LocalStorage and sessionStorage Databse Storage Canvas Worker threads Geolocation Important features:
  • 19. HTML5 closer and closer Better audio video support Post message (communication between frames) Requests across domains Offline support (FF3 and IE8 or via Gears in all but Opera) Cross document messaging http://www.whatwg.org/specs/web-apps/current-work/# crossDocumentMessages and more....(client side validation, drag&drop, nativeJSON support)
  • 20. HTML5 closer and closer specification is not final new browsers support most of the features
  • 21. Database storage Client side database accessed from JavaScript. db = openDatabase("dbUsers", "1.0", "UsersDatabase", 300000);db.transaction(function(tx) { tx.executeSql("CREATE TABLE users (id REAL, name STRING, email STRING)"); });db.transaction(function(tx) { tx.executeSql("SELECT * FROM users”, [], \ function(tx, result) { alert(result.rows.item(0)['email']); }); }); Already implemented in Safari 4 and for all browser but opera through Gears project W3C specification: http://www.w3.org/TR/offline-webapps/#sql
  • 22. Database storage No ORM by default. • ActiveRecordJS - AR implementation by Aptana • JazzRecord - a lso AR imp lementation • JStORM   • jBati - insp ired b y iBatis Ready solutions: http://www.w3.org/TR/webstorage/#sql
  • 23. local & session storage sessionStorage['friendIds'] = [1,2,3];// reload page alert(sessionStorage['friendIds']); sessionStorage - really easy API // examples : localStorage.loginKey = "randomStringKey123";alert(localStorage.loginKey); // => "randomStringKey123" if (!localStorage.getItem('firstVisit')) localStorage.setItem('firstVisit', Date()); localStorage.key(1); // => ‘firstVisit’localStorage.clear(); More info: http://www.w3.org/TR/webstorage/ localStorage
  • 24. local & session storage only flat structure and only strings with native JSON support can be easy extended currently supported by Safari 4, FireFox 3.5, IE8
  • 25. Offline Caching - manifest file Manifest file Allows to specify what request responses browser should cache and use while offline (or online too). CACHE MANIFEST# v1 http://www.LunarLogicPolska.com/index.html http://www.LunarLogicPolska.com/logo.png / logohttp://www.LunarLogicPolska.com/user _profile_template.html /user_template.html
  • 26. Offline Caching - check status document.body.addEventListener("offline", function () { alert("We are offline");}, false);// Similar event for online event “offline” window.navigator property window.navigator.onLine // returns false if definitely offline or true when possibly online
  • 27. Offline caching online Offline caching can be used also online ! The prize is performance
  • 28. Geolocation function showMap(position) { // Show a map centered at // (position.coords.latitude, position.coords.longitude).}// One-shot position request.navigator.geolocation.getCurrentPosition(showMap); Browsers : FF3.5, Safari for iPhone, Opera (now separate build), IE8 (experimental support), or in most by Gears source and more examples: http://www.w3.org/TR/2008/WD-geolocation-API-20081222/#introduction Returns users position (few ways to detect it)
  • 30. Other tools JAXER - Ajax server (APTANA) REST clients in JS : Jester and ActiveJAX JavaScript accessible databases: Preserve’s JavascriptDB, DBSlayer
  • 31. Example workflow Browser DB sessionStorage offline Cache browser manifest file JS ORM JS REST (JSON) Templates, static files SQL JS DB SQL {key: val} Server
  • 32. Example workflow Browser DB sessionStorage offline Cache browser manifest file JS ORM JS REST (JSON) Templates, static files SQL JS Preserve JavaScriptDB DB SQL {key: val} Server
  • 33. Example - practice Homepage:- template and static files cached by manifest file - signed in user's data get with JSON format and saved in local storage Start page - static files already taken from cache (manifest) - get template of start page - page data loaded in JSON format and saved in local storage Friend's profile - static files taken from cache - get template for profile page - get JSON formated data about the user second friend's profile - static files - from cache - template from cache - just get data about the user
  • 34. Impact on Ruby community Most of us code mostly in Rails = web applications Good sign for Ruby ? when server used rarely = language performance matters less better scalability
  • 35. Impact on Ruby community Flexible, quickly reacting community: big chances to take lead in new areas New frameworks server-side support still needed generate “standard” HTML for SEO Rails.... Merb... Sinatra.. - simple, flexible background for them
  • 36. Questions Maciej Książek ( www.drclick.pl ) for Krakow Ruby Users Group www.ruby.org.pl ruby.org.pl June 2009