SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
Web Storage
                           Sebastiano Armeli-Battana
                               seba.armeli@gmail.com
                                     @sebarmeli




Sunday, 20 February 2011
Remote Data Storage




Sunday, 20 February 2011
Why Web Storage?

                 • Performance
                 • Speed
                 • Reduced load on the servers
                 • Offline applications
                 • Transaction - HTTP stateless

Sunday, 20 February 2011
History of Client-side Storage

                    • HTTP Cookie

                    • userData Behaviour in IE 5.5
                    • Local Shared Objects in Adobe Flash
                    • Google Gears

Sunday, 20 February 2011
HTML
                                    Web Storage

                      • by WHATWG / W3C
                      • HTML5? Actually not...
                      • 2 Storage Areas :
                       • localStorage
                       • sessionStorage
                       • globalStorage
Sunday, 20 February 2011
Storage API
         interface Storage {
           readonly attribute unsigned long length;

                DOMString key(in unsigned long index);

                getter any getItem(in DOMString key);

           setter creator void setItem(in DOMString
         key, in any value);

                deleter void removeItem(in DOMString key);

                void clear();
         };
Sunday, 20 February 2011
localStorage
                     • localStorage.setItem(“key1”, “value1”);
                           localStorage.setItem(“key2”, “value2”);
                     • localStorage.getItem(“key1”); // “value1”
                     • localStorage.length; //2
                     • localStorage.removeItem(“key1”);
                     • localStorage.length; // 1
                     • localStorage.clear();
                     • localStorage.length; // 0
Sunday, 20 February 2011
sessionStorage
               • sessionStorage.setItem(“key1”, “value1”);
                      sessionStorage.setItem(“key2”, “value2”);
               • sessionStorage.getItem(“key1”); // “value1”
               • sessionStorage.length; //2
               • sessionStorage.removeItem(“key1”);
               • sessionStorage.length; // 1
               • sessionStorage.clear();
               • localStorage.length; // 0
Sunday, 20 February 2011
Storing Objects
                    • Key/value pairs
                    • Value is a STRING!

                    • Stringify / Parse JS Objects
                     • JSON.stringify(myObject);
                     • JSON.parse(myString);
Sunday, 20 February 2011
Storage Event
                    • “storage” event
                    • Triggered when Storage Areas change
                    • Binded on Window
                    • Attributes:
                           •   key,
                           •   oldValue
                           •   newValue
                           •   url




Sunday, 20 February 2011
Support
                    • IE 8+
                    • FF 3.5+
                    • Safari 4+
                    • Chrome 7+
                    • Opera 10.6+
                    • iOS Safari 4.0+ / Android 2.2+
Sunday, 20 February 2011
JS Utilities
                    • YUI2 Storage

                    • Dojo Storage

                    • PersistJS

Sunday, 20 February 2011
Advantages (over Cookies)

                    • Saving Bandwith

                    • Size

                    • Sessions not leaking

                    • Network sniffing
Sunday, 20 February 2011
Limitations

                • 5 Mb (or 10Mb)
                • “QUOTA_EXCEEDED_ERR”
                • “SECURITY_ERR”
                • Storage per origin
                • Cross directory attacks -> DO not USE it!
                • DNS Spoofing -> SSL
Sunday, 20 February 2011
The future of Web Storage

                    • Store data that rarely change

                    •      Mobile Sites


                    • Offline apps

                    • More Storage?       Index Database API
Sunday, 20 February 2011
Thank you.



Sunday, 20 February 2011

Más contenido relacionado

Destacado

Il contributo della ricerca in didattica all'insegnamento della fisica
Il contributo della ricerca in didattica all'insegnamento della fisicaIl contributo della ricerca in didattica all'insegnamento della fisica
Il contributo della ricerca in didattica all'insegnamento della fisica
Francesco Marchi
 

Destacado (7)

Il web tra fruizione critica e partecipazione
Il web tra fruizione critica e partecipazioneIl web tra fruizione critica e partecipazione
Il web tra fruizione critica e partecipazione
 
Rete, social network e sicurezza; quando gli alunni vanno in rete, uso consap...
Rete, social network e sicurezza; quando gli alunni vanno in rete, uso consap...Rete, social network e sicurezza; quando gli alunni vanno in rete, uso consap...
Rete, social network e sicurezza; quando gli alunni vanno in rete, uso consap...
 
Google Drive in pillole
Google Drive in pilloleGoogle Drive in pillole
Google Drive in pillole
 
[Google apps for Work] Migliora la capacità produttiva con Google Drive.
[Google apps for Work] Migliora la capacità produttiva con Google Drive. [Google apps for Work] Migliora la capacità produttiva con Google Drive.
[Google apps for Work] Migliora la capacità produttiva con Google Drive.
 
Tutorial Google Drive
Tutorial Google DriveTutorial Google Drive
Tutorial Google Drive
 
Il contributo della ricerca in didattica all'insegnamento della fisica
Il contributo della ricerca in didattica all'insegnamento della fisicaIl contributo della ricerca in didattica all'insegnamento della fisica
Il contributo della ricerca in didattica all'insegnamento della fisica
 
E-Learning, podcasting e Wikipedia per una didattica costruttivistica in rete
E-Learning, podcasting e Wikipedia per una didattica costruttivistica in reteE-Learning, podcasting e Wikipedia per una didattica costruttivistica in rete
E-Learning, podcasting e Wikipedia per una didattica costruttivistica in rete
 

Similar a Web Storage

JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
eug3n_cojocaru
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Guillaume Laforge
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
DATAVERSITY
 
2011 JavaOne Fun with EJB 3.1 and OpenEJB
2011 JavaOne Fun with EJB 3.1 and OpenEJB2011 JavaOne Fun with EJB 3.1 and OpenEJB
2011 JavaOne Fun with EJB 3.1 and OpenEJB
David Blevins
 
jQueryTO: State of jQuery March 2013
jQueryTO: State of jQuery March 2013jQueryTO: State of jQuery March 2013
jQueryTO: State of jQuery March 2013
dmethvin
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies Today
Wesley Hales
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
dmethvin
 

Similar a Web Storage (20)

Mobile HTML5
Mobile HTML5Mobile HTML5
Mobile HTML5
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
 
Creating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
Creating a Global E-Commerce Website With E-Business Suite and Fusion MiddlewareCreating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
Creating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
 
Web micro-framework BATTLE!
Web micro-framework BATTLE!Web micro-framework BATTLE!
Web micro-framework BATTLE!
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
 
Fast Map Interaction without Flash
Fast Map Interaction without FlashFast Map Interaction without Flash
Fast Map Interaction without Flash
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
2011 JavaOne Fun with EJB 3.1 and OpenEJB
2011 JavaOne Fun with EJB 3.1 and OpenEJB2011 JavaOne Fun with EJB 3.1 and OpenEJB
2011 JavaOne Fun with EJB 3.1 and OpenEJB
 
jQueryTO: State of jQuery March 2013
jQueryTO: State of jQuery March 2013jQueryTO: State of jQuery March 2013
jQueryTO: State of jQuery March 2013
 
LatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 StandardLatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 Standard
 
How I stopped worrying about and loved DumpRenderTree
How I stopped worrying about and loved DumpRenderTreeHow I stopped worrying about and loved DumpRenderTree
How I stopped worrying about and loved DumpRenderTree
 
Donating a mature project to Eclipse
Donating a mature project to EclipseDonating a mature project to Eclipse
Donating a mature project to Eclipse
 
Java EE and Google App Engine
Java EE and Google App EngineJava EE and Google App Engine
Java EE and Google App Engine
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies Today
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
Slideshare presentation
Slideshare presentationSlideshare presentation
Slideshare presentation
 
Fun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBFun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJB
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
 
Integrating ECM (WebCenter Content) with your Enterprise! 5 Tips to Try, 5 Tr...
Integrating ECM (WebCenter Content) with your Enterprise! 5 Tips to Try, 5 Tr...Integrating ECM (WebCenter Content) with your Enterprise! 5 Tips to Try, 5 Tr...
Integrating ECM (WebCenter Content) with your Enterprise! 5 Tips to Try, 5 Tr...
 

Más de Sebastiano Armeli

Más de Sebastiano Armeli (12)

Managing a software engineering team
Managing a software engineering teamManaging a software engineering team
Managing a software engineering team
 
Enforcing coding standards in a JS project
Enforcing coding standards in a JS projectEnforcing coding standards in a JS project
Enforcing coding standards in a JS project
 
Enforcing coding standards
Enforcing coding standardsEnforcing coding standards
Enforcing coding standards
 
ES6: The future is now
ES6: The future is nowES6: The future is now
ES6: The future is now
 
EcmaScript 6 - The future is here
EcmaScript 6 - The future is hereEcmaScript 6 - The future is here
EcmaScript 6 - The future is here
 
Dependency management & Package management in JavaScript
Dependency management & Package management in JavaScriptDependency management & Package management in JavaScript
Dependency management & Package management in JavaScript
 
Karma - JS Test Runner
Karma - JS Test RunnerKarma - JS Test Runner
Karma - JS Test Runner
 
RequireJS
RequireJSRequireJS
RequireJS
 
Lazy load Everything!
Lazy load Everything!Lazy load Everything!
Lazy load Everything!
 
MVC on the server and on the client
MVC on the server and on the clientMVC on the server and on the client
MVC on the server and on the client
 
Backbone.js in a real-life application
Backbone.js in a real-life applicationBackbone.js in a real-life application
Backbone.js in a real-life application
 
Getting started with Selenium 2
Getting started with Selenium 2Getting started with Selenium 2
Getting started with Selenium 2
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Web Storage

  • 1. Web Storage Sebastiano Armeli-Battana seba.armeli@gmail.com @sebarmeli Sunday, 20 February 2011
  • 2. Remote Data Storage Sunday, 20 February 2011
  • 3. Why Web Storage? • Performance • Speed • Reduced load on the servers • Offline applications • Transaction - HTTP stateless Sunday, 20 February 2011
  • 4. History of Client-side Storage • HTTP Cookie • userData Behaviour in IE 5.5 • Local Shared Objects in Adobe Flash • Google Gears Sunday, 20 February 2011
  • 5. HTML Web Storage • by WHATWG / W3C • HTML5? Actually not... • 2 Storage Areas : • localStorage • sessionStorage • globalStorage Sunday, 20 February 2011
  • 6. Storage API interface Storage { readonly attribute unsigned long length; DOMString key(in unsigned long index); getter any getItem(in DOMString key); setter creator void setItem(in DOMString key, in any value); deleter void removeItem(in DOMString key); void clear(); }; Sunday, 20 February 2011
  • 7. localStorage • localStorage.setItem(“key1”, “value1”); localStorage.setItem(“key2”, “value2”); • localStorage.getItem(“key1”); // “value1” • localStorage.length; //2 • localStorage.removeItem(“key1”); • localStorage.length; // 1 • localStorage.clear(); • localStorage.length; // 0 Sunday, 20 February 2011
  • 8. sessionStorage • sessionStorage.setItem(“key1”, “value1”); sessionStorage.setItem(“key2”, “value2”); • sessionStorage.getItem(“key1”); // “value1” • sessionStorage.length; //2 • sessionStorage.removeItem(“key1”); • sessionStorage.length; // 1 • sessionStorage.clear(); • localStorage.length; // 0 Sunday, 20 February 2011
  • 9. Storing Objects • Key/value pairs • Value is a STRING! • Stringify / Parse JS Objects • JSON.stringify(myObject); • JSON.parse(myString); Sunday, 20 February 2011
  • 10. Storage Event • “storage” event • Triggered when Storage Areas change • Binded on Window • Attributes: • key, • oldValue • newValue • url Sunday, 20 February 2011
  • 11. Support • IE 8+ • FF 3.5+ • Safari 4+ • Chrome 7+ • Opera 10.6+ • iOS Safari 4.0+ / Android 2.2+ Sunday, 20 February 2011
  • 12. JS Utilities • YUI2 Storage • Dojo Storage • PersistJS Sunday, 20 February 2011
  • 13. Advantages (over Cookies) • Saving Bandwith • Size • Sessions not leaking • Network sniffing Sunday, 20 February 2011
  • 14. Limitations • 5 Mb (or 10Mb) • “QUOTA_EXCEEDED_ERR” • “SECURITY_ERR” • Storage per origin • Cross directory attacks -> DO not USE it! • DNS Spoofing -> SSL Sunday, 20 February 2011
  • 15. The future of Web Storage • Store data that rarely change • Mobile Sites • Offline apps • More Storage? Index Database API Sunday, 20 February 2011
  • 16. Thank you. Sunday, 20 February 2011