SlideShare ist ein Scribd-Unternehmen logo
1 von 33
JavaScript Persistence & Offline Storage Dec 9 2009 Alexei White (Foresee Results - Nitobi) http://ambiguiti.es @AlexeiRWhite
What is Persistence / Storage? ,[object Object],[object Object],[object Object],[object Object]
Why Persistent Storage? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Offline Storage Use Case
Isn’t That What Cookies are For? ,[object Object],[object Object],[object Object],[object Object]
The Flavors of JS Persistence
Storage Flavors
window.name ,[object Object],[object Object],[object Object],[object Object]
window.name ,[object Object],// Write a structure to window.name: var myObj = { “a”:”hello world”, “b”:324234 }; window.name  = JSON.stringify(myObj); // Read it back: var myObj; try { myObj = JSON.parse( window.name ); } catch(e) {}
window.name ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Flash Local Shared Object ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Flash Local Shared Object ,[object Object],import flash.external.ExternalInterface; // Saves data to datastore function saveData(store, key, value) { sharedObject = SharedObject.getLocal(store); sharedObject.data[key] = value; sharedObject.flush(); } // Retrieves data function loadDate(store, key) { return SharedObject.getLocal(store).data[key]; } ExternalInterface.addCallback(“saveData”, this.saveData); ExternalInterface.addCallback(“loadData”, this.loadData);
Flash Local Shared Object ,[object Object],<object classid=“bla” codebase=“bla”  height=“1” width=“1”  id=“storageMovie”> <param name=“movie” value=“sharedobject.swf” /> <param  name=“allowScriptAccess”  value=“always” /> <embed src=“shredobject.swf” allowScriptAccess=“always” width=“1” height=“1” name=“storageMovie” /> </object>
Flash Local Shared Object ,[object Object],// Save $(‘storageMovie’).saveData(store,key,value); // Load var result = $(‘storageMovie’).loadData(store, key);
Flash Local Shared Object ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Lowest Common Denominator ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],* When combined with GZIP.
Silverlight IsolatedStorage ,[object Object],[object Object],[object Object],[object Object],[object Object],http://www.shinedraw.com/data-handling/silverlight-vs-flash-local-storage/ System.IO.IsolatedStorage.IsolatedStorageFile
Silverlight IsolatedStorage http://www.shinedraw.com/data-handling/silverlight-vs-flash-local-storage/ using System.IO.IsolatedStorage.IsolatedStorageFile; IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();    if(store.FileExists(FILENAME)){        isfs = new IsolatedStorageFileStream(FILENAME, FileMode.OpenOrCreate, store);        StreamReader streamReader = new StreamReader(isfs);        string s;        while ((s = streamReader.ReadLine()) != null)            TextArea.Text += (s + '');        streamReader.Close();    }      // save data to local storage    IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();    IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(FILENAME, FileMode.OpenOrCreate, store);    StreamWriter streamWriter = new StreamWriter(isfs);    streamWriter.Write(&quot;New Text&quot;);    streamWriter.Flush();    streamWriter.Close();
HTML5 Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
HTML5 Features In Jeopardy ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
HTML5 Storage Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
HTML5 DOM Storage ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
HTML5 DOM Storage ,[object Object],[object Object],// Writing data sessionStorage.myKey = “Hello”; window.sessionStorage[“myKey”] = “Hello”; window.localStorage.myKey = “Hello”; localStorage[“myKey”] = “Hello”; sessionStorage.myObj = {a:true, b:false}; console.log(sessionStorage.myObj) // “[Object object]”
HTML5 DOM Storage ,[object Object],function handleStorageEvent(e) { // These attributes only appear in Safari var str = “Key: “ + e.key + “”; str += “Original Value: “ + e.oldValue + “”; str += “New Value: “ + e.newValue; alert(str); } // Bindings, IE then W3C if (document.attachEvent) document.attachEvent(“onstorage”, handleStorageEvent); else document.body.addEventListener(“storage”, handleStorageEvent); *IE8 only
HTML5 DOM Storage ,[object Object],[object Object],[object Object],sessionStorage.clear(); for (var I = 0; I < sessionStorage.length; I++) { console.log(sessionStorage[sessionStorage.key(I)]); } sessionStorage.removeItem(“mykey”);
HTML5 WebDB ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
HTML5 Database ,[object Object],[object Object],if (window.openDatabase) { // … } try { // DB operations go here } catch(e) { if (e == 2) { // Version mismatch } }
HTML5 Database ,[object Object],[object Object],var database = openDatabase(&quot;Database Name&quot;, &quot;Database Version&quot;); database.executeSql(&quot;SELECT * FROM test&quot;, function(result1) {    // do something with the results    database.executeSql(&quot;DROP TABLE test&quot;, function(result2) {      // do some more stuff      alert(&quot;My second database query finished executing!&quot;);    }); }); openDatabase(shortName, version, displayName, maxSize)
HTML5 Database ,[object Object],[object Object],transaction.executeSql(“INSERT INTO products (name, price) VALUES (?, ?);’, [“Book”, 2.01]); myDB.transaction( function(transaction) { // Create the products table transaction.executeSQL(‘CREATE TABLE products (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL DEFAULT “Widget”, price REAL NOT NULL DEFAULT 9.99);’, []); transaction.executeSql(“INSERT INTO products (name, price) VALUES (?, ?);’, [“Book”, 2.01]); } }
HTML5 Database ,[object Object],db.transaction( function (transaction) { var query=&quot;SELECT * FROM products”; transaction.executeSql(query, [], handleProductsQuery, errorHandler); }, transactionErrorCallback); function handleProductsQuery(transaction, resultSet) { for (var I = 0; I < resultSet.length; I++) { var row = resultSet.rows.item(i); console.log(row[‘name’] + “: “ + row[‘price’]); } } http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/UsingtheJavascriptDatabase.html#//apple_ref/doc/uid/TP40007256-CH3-SW1
HTML5 Database ,[object Object]
Alternatives to HTML5 WebDB ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],* Discontinued by Google
Questions? ,[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Mojo – Simple REST Server
Mojo – Simple REST ServerMojo – Simple REST Server
Mojo – Simple REST Serverhendrikvb
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The WhenFITC
 
Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)Thomas Bassetto
 
Even faster django
Even faster djangoEven faster django
Even faster djangoGage Tseng
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessionsUdaAs PaNchi
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutionswoutervugt
 
Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Mike West
 
Intorduction of Playframework
Intorduction of PlayframeworkIntorduction of Playframework
Intorduction of Playframeworkmaltiyadav
 
The Future of the Web
The Future of the WebThe Future of the Web
The Future of the WebRay Nicholus
 
Simple Web Development in Java
Simple Web Development in JavaSimple Web Development in Java
Simple Web Development in JavaVincent Tencé
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Adrian Olaru
 
TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!
TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!
TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!Coulawrence
 
Talk about html5 security
Talk about html5 securityTalk about html5 security
Talk about html5 securityHuang Toby
 

Was ist angesagt? (20)

Mojo – Simple REST Server
Mojo – Simple REST ServerMojo – Simple REST Server
Mojo – Simple REST Server
 
Dot netnuke
Dot netnukeDot netnuke
Dot netnuke
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
 
Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)
 
Ecom2
Ecom2Ecom2
Ecom2
 
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
 
Indexed db
Indexed dbIndexed db
Indexed db
 
Even faster django
Even faster djangoEven faster django
Even faster django
 
AD102 - Break out of the Box
AD102 - Break out of the BoxAD102 - Break out of the Box
AD102 - Break out of the Box
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutions
 
Dandelion 0.10.0
Dandelion 0.10.0Dandelion 0.10.0
Dandelion 0.10.0
 
Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)
 
Intorduction of Playframework
Intorduction of PlayframeworkIntorduction of Playframework
Intorduction of Playframework
 
The Future of the Web
The Future of the WebThe Future of the Web
The Future of the Web
 
Simple Web Development in Java
Simple Web Development in JavaSimple Web Development in Java
Simple Web Development in Java
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Html5 local storage
Html5 local storageHtml5 local storage
Html5 local storage
 
TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!
TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!
TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!
 
Talk about html5 security
Talk about html5 securityTalk about html5 security
Talk about html5 security
 

Andere mochten auch

A Visual History of Calculators
A Visual History of CalculatorsA Visual History of Calculators
A Visual History of CalculatorsBen Scott
 
Heating System Innovations
Heating System InnovationsHeating System Innovations
Heating System InnovationsZMERLY & CO
 
LAMP (Loop Mediated Isothermal Amplification)
LAMP (Loop Mediated Isothermal Amplification)LAMP (Loop Mediated Isothermal Amplification)
LAMP (Loop Mediated Isothermal Amplification)Varij Nayan
 
History of washing machine
History of washing machineHistory of washing machine
History of washing machineNataliya Shulgan
 
Design and fabrication of smart portable air conditioner
Design and fabrication of smart portable air conditionerDesign and fabrication of smart portable air conditioner
Design and fabrication of smart portable air conditionerAzRil Afif
 
EVOLUTION OF COMPUTER
EVOLUTION OF COMPUTEREVOLUTION OF COMPUTER
EVOLUTION OF COMPUTERfhemrosacia
 
Evolution of the television!!!!!
Evolution of the television!!!!!Evolution of the television!!!!!
Evolution of the television!!!!!cbrady24
 

Andere mochten auch (10)

A Visual History of Calculators
A Visual History of CalculatorsA Visual History of Calculators
A Visual History of Calculators
 
nintendo
nintendonintendo
nintendo
 
Nintendo innovation
Nintendo innovationNintendo innovation
Nintendo innovation
 
Heating System Innovations
Heating System InnovationsHeating System Innovations
Heating System Innovations
 
LAMP (Loop Mediated Isothermal Amplification)
LAMP (Loop Mediated Isothermal Amplification)LAMP (Loop Mediated Isothermal Amplification)
LAMP (Loop Mediated Isothermal Amplification)
 
History of washing machine
History of washing machineHistory of washing machine
History of washing machine
 
Design and fabrication of smart portable air conditioner
Design and fabrication of smart portable air conditionerDesign and fabrication of smart portable air conditioner
Design and fabrication of smart portable air conditioner
 
Washing Machine
Washing MachineWashing Machine
Washing Machine
 
EVOLUTION OF COMPUTER
EVOLUTION OF COMPUTEREVOLUTION OF COMPUTER
EVOLUTION OF COMPUTER
 
Evolution of the television!!!!!
Evolution of the television!!!!!Evolution of the television!!!!!
Evolution of the television!!!!!
 

Ähnlich wie Persistent Offline Storage White

Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat ClientPaul Klipp
 
Your browser, your storage (extended version)
Your browser, your storage (extended version)Your browser, your storage (extended version)
Your browser, your storage (extended version)Francesco Fullone
 
HTML5 Storage/Cache
HTML5 Storage/CacheHTML5 Storage/Cache
HTML5 Storage/CacheAndy Wang
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Web Directions
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...SPTechCon
 
Front-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsFront-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsArtur Cistov
 
Notes on SF W3Conf
Notes on SF W3ConfNotes on SF W3Conf
Notes on SF W3ConfEdy Dawson
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backendDavid Padbury
 
Top 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersTop 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersBrian Huff
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricWim Van den Broeck
 

Ähnlich wie Persistent Offline Storage White (20)

Local storage
Local storageLocal storage
Local storage
 
your browser, your storage
your browser, your storageyour browser, your storage
your browser, your storage
 
Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
 
Your browser, your storage (extended version)
Your browser, your storage (extended version)Your browser, your storage (extended version)
Your browser, your storage (extended version)
 
Sqllite
SqlliteSqllite
Sqllite
 
Html5
Html5Html5
Html5
 
HTML5 Storage/Cache
HTML5 Storage/CacheHTML5 Storage/Cache
HTML5 Storage/Cache
 
Your browser, my storage
Your browser, my storageYour browser, my storage
Your browser, my storage
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 
Front-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsFront-end optimisation & jQuery Internals
Front-end optimisation & jQuery Internals
 
Notes on SF W3Conf
Notes on SF W3ConfNotes on SF W3Conf
Notes on SF W3Conf
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
Top 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersTop 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud Developers
 
Play 2.0
Play 2.0Play 2.0
Play 2.0
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
 

Kürzlich hochgeladen

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Persistent Offline Storage White

  • 1. JavaScript Persistence & Offline Storage Dec 9 2009 Alexei White (Foresee Results - Nitobi) http://ambiguiti.es @AlexeiRWhite
  • 2.
  • 3.
  • 5.
  • 6. The Flavors of JS Persistence
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. Silverlight IsolatedStorage http://www.shinedraw.com/data-handling/silverlight-vs-flash-local-storage/ using System.IO.IsolatedStorage.IsolatedStorageFile; IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();    if(store.FileExists(FILENAME)){        isfs = new IsolatedStorageFileStream(FILENAME, FileMode.OpenOrCreate, store);        StreamReader streamReader = new StreamReader(isfs);        string s;        while ((s = streamReader.ReadLine()) != null)            TextArea.Text += (s + '');        streamReader.Close();    }      // save data to local storage    IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();    IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(FILENAME, FileMode.OpenOrCreate, store);    StreamWriter streamWriter = new StreamWriter(isfs);    streamWriter.Write(&quot;New Text&quot;);    streamWriter.Flush();    streamWriter.Close();
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.

Hinweis der Redaktion

  1. Historically, most desktop apps have this idea that when you open a document or database or any data-driven application, you have a certain amount of freedom to interact with that data without necessarily affecting the version that is saved on the disk. So if I change the font of my entire word doc to comic-sans just for fun to see what it looks like, I don’t need to worry about that change being permenant because I didn’t save it. Generally speaking, web apps don’t provide this ‘sandbox’ mode because it’s a major development effort to distinguish between data modifications that are sandboxed and ones that are permanent. And because the browser itself is for the most part not at all stateful or aware of the data you are working with – you have to provide that functionality on your own. Talk briefly about how you have used/needed persistent storage.
  2. Byte limits.. Your cookies need to be encoded as well, as though you were embedding them in XML attributes which bumps up the size. Overloading your cookies has been known to crash browsers too.
  3. The only thing not on this list is anything provided by Silverlight or possibly a Java Applet – but I know very little about these. Gears – no support for Safari 4 yet on snow leopard. Built right into chrome. Talk about window.name interesting features. How perf drops on FF around 2 mb. Data can be accessed off domain, etc. HTML5 Sqlite storage limits don’t appear to be enforced yet. Opera 3MB http://blog.futtta.be/2009/11/18/chrome-opera-to-support-html5-webdb-ff-ie-wont/ I should point out that Adobe AIR’s javascript interface is a bit of a different ball game. They have their own storage IO mechanisms, and support SQLite as well. ALSO: GOOGLE GEARS has been discontinued by google.
  4. Can be read and written to outside its origin. Not crash safe, but extremely useful.
  5. Can be read and written to outside its origin
  6. Despite these negatives, sometimes there’s really no better way to do something
  7. Despite these negatives, sometimes there’s really no better way to do something
  8. Can be read and written to outside its origin
  9. Can be read and written to outside its origin
  10. Byte limits.. Your cookies need to be encoded as well, as though you were embedding them in XML attributes which bumps up the size. Overloading your cookies has been known to crash browsers too. In flash 9+ you can combine this with GZIP which is built right into the engine to really stretch this. With user permission you can increase this to massive amounts.
  11. http://www.shinedraw.com/data-handling/silverlight-vs-flash-local-storage/
  12. http://www.shinedraw.com/data-handling/silverlight-vs-flash-local-storage/
  13. Web Hypertext Application Technology Working Group The WHATWG was founded by individuals from Apple , the Mozilla Foundation and Opera Software . [1] Since then, the editor of the WHATWG specifications, Ian Hickson , has moved to Google . Chris Wilson of Microsoft was invited but did not join, citing the lack of a patent policy to ensure all specifications can be implemented on a royalty-free basis Limited involvement from Microsoft. Not all vendors will implement all features.
  14. http://blog.futtta.be/2009/11/18/chrome-opera-to-support-html5-webdb-ff-ie-wont/ - in order to have a webdb standard, you also have to specify (and standardize) the SQL-language to query that database, the question is what SQL-dialect to standardize on. - as the current implementations are all SQLite -based (including Google’s and Opera’s), the spec would have to describe the very specific SQL-dialect that SQLite uses (and maybe even of a specific version of SQLite) - http://blog.vlad1.com/2009/04/06/html5-web-storage-and-sql/ Enjoinment IE USED TO HAVE INLINE VIDEO AND AUDIO embedding: &lt;img src=&amp;quot;cover.gif&amp;quot; dynsrc=&amp;quot;clock.avi&amp;quot; controls&gt; http://sharovatov.wordpress.com/2009/06/05/html5-video-tag-and-internet-explorer/
  15. There’s this other thing called globalStorage provided by FF which has been deprecated to my knowledge.
  16. There’s this other thing called globalStorage provided by FF which has been deprecated to my knowledge.
  17. DIFFERENCE IS: onstorage fires on both storage formats, but onstoragecommit only should fire on localstorage ALSO: onstoragecommit is ONLY for ie8 There’s this other thing called globalStorage provided by FF which has been deprecated to my knowledge. Can also use the JSON library here to support objects. For events: In FF and safari the event args are actually the storage event object. In IE you get an event object, and in safari you can an expanded object with additional properties. HTML5 origin (scheme + hostname + non-standard port)
  18. http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/UsingtheJavascriptDatabase.html#//apple_ref/doc/uid/TP40007256-CH3-SW1 A database transaction comprises a unit of work performed within a database management system (or similar system) against a database, and treated in a coherent and reliable way independent of other transactions. Transactions in a database environment have two main purposes: To provide reliable units of work that allow correct recovery from failures and keep a database consistent even in cases of system failure, when execution stops (completely or partially) and many operations upon a database remain uncompleted, with unclear status. To provide isolation between programs accessing a database concurrently. Without isolation the programs&apos; outcomes are typically erroneous.
  19. http://blog.futtta.be/2009/11/18/chrome-opera-to-support-html5-webdb-ff-ie-wont/ - in order to have a webdb standard, you also have to specify (and standardize) the SQL-language to query that database, the question is what SQL-dialect to standardize on. - as the current implementations are all SQLite -based (including Google’s and Opera’s), the spec would have to describe the very specific SQL-dialect that SQLite uses (and maybe even of a specific version of SQLite) - http://blog.vlad1.com/2009/04/06/html5-web-storage-and-sql/ - enjoinment