SlideShare a Scribd company logo
1 of 51
Download to read offline
Your browser, my storage
a new approach on data storing



Francesco Fullone
ff AT ideato.it
Who am I

Francesco Fullone aka Fullo

- PHP developer since 1999
-               President
-         and Open Source Evangelist
- CEO @
- founder @


- Nerd and geek
What we want is a lot of storage space, on
the client, that persists beyond a page
refresh and isn’t transmitted to the server.


                                ~ M. Pilgrim
Persistent local storage is one of
     the areas where client
  applications traditionally win
    against web applications.
A jump in the past
http://www.flickr.com/photos/betsyweber/4962298614/




  Cookies were introduced in
HTTP/1.0, limited to only 20 per
    domain and 4KB each.
Cookies are sent to
                                                   and from client at
                                                    any connection.



http://www.flickr.com/photos/dionhinchcliffe/4326080515
Microsoft with Internet Explorer 6
   introduced dHTML and the
userData API to store up to 64KB
             of data
Mozilla introduced with Firefox 2
the DOM Storage API, it will then
     know as Web Storage.
Adobe, in 2002, created the Flash
   Cookies aka “Local Shared
       Objects” for Flash 6.
 Data storage increased to 100KB
  but it was difficult to be used.
With Flash 8, in 2006,
 Adobe introduced the
  ExternalInterface
 to allow Js to access
to the stored resources.
Between 2005 and 2007
 dojox.storage was written by
  Brad Neuberg as a Js->Flash
bridge to manage bigger chunks
           of data

      (with user prompt over 1MB).
Google created Gears in 2007,
 that introduced a database
paradigm (based on SQLite) to
    the storage problem.
All these storage systems had
  different APIs, a common
platform is needed by all the
       browser vendors.
The two approaches of storing:
      Application Cache
       Offline storage
Application Caching involves
saving the application's core logic
       and user-interface.

 http://www.whatwg.org/specs/web-apps/current-
            work/#applicationcache
It is enabled by a file .manifest
 that declares which resources
     have to be saved locally.

       (theoretically limited to 5MB).
CACHE MANIFEST

# Explicitly cached entries
CACHE:
index.html
stylesheet.css
images/logo.png
scripts/main.js
# Resources that require the user to be online.
NETWORK:
login.php
/myapi
http://api.twitter.com
# static.html will be served if main.php is inaccessible
# offline.jpg will be served in place of all images in images/large/
FALLBACK:
/main.php /static.html
images/large/ images/offline.jpg
applicationCache can use events
 to trigger application behavior

– window.applicationCache.onchecking = function(e) {
     • log("Checking for application update");
–}
If you change a
                      resource and you
                     don't update (rev)
                      the .manifest the
                       browser may not
                 download the new file!
(yes! cached resources have priority on the online ones)
Data storage is about
                                                       capturing specific
                                                     data, or resources the
                                                      user has expressed
                                                          interest in.
http://www.flickr.com/photos/bfionline/2380398365/
Approaches to
Data Storage
Web Storage is the simpler
implementation of the Data
    Storage paradigm.

  http://dev.w3.org/html5/webstorage/
Web Storage is based on a
structure of key-value pairs like
     any JavaScript object.

localStorage.setItem("bar", foo);
Web Storage can save up to 5MB
but only as strings. So we have
 to force a casting if needed.

var bar = parseInt(localStorage["bar"]);
Web Storage should be local
 based or session based.

 var bar = localStorage["bar"];
var foo = sessionStorage["foo"];
sessionStorage mantains a
storage area that's available for
the duration of the web session.

 Opening a new window/tab will create a new
                  session.
localStorage relies only on
  client, so we have to track
changes and use storage.events
  to sync server and client if
            needed.
Web SQL Database is WAS just
an offline SQL implementation,
        based on SQLite.

   http://dev.w3.org/html5/webdatabase/
this.db = openDatabase('geomood', '1.0', 'Geo', 8192);
this.db.transaction(function(tx) {
  tx.executeSql("create table if not exists checkins(id
               integer primary key asc, time integer,
               latitude float, longitude float, mood
               string)",
               [],
                function() { console.log("siucc"); }
          »   );
});
Web SQL Database is not
  supported by Microsoft and
Mozilla, instead it is on browsers
        based on webkit.
But ...
Web SQL Database is dead!
  as being dropped by W3C from 18/11/10



             why bother more?
Web SQL Database is the only
 database storage engine
 working on mobile devices!
IndexedDB is a nice compromise
 between Web Storage and Web
        SQL Database.

     http://www.w3.org/TR/IndexedDB/
IndexedDB allows to create an
index on a certain field stored in
 a standard key->value mapping.
IndexedDB is promoted by all
browsers vendor, but is not yet
    fully supported by all

  Firefox 4, Chrome 11, have full implementation.
             Safari 5.1 and IE 10 will have
FileAPI or File Storage will give
us a way to store a lot of data.

      http://www.w3.org/TR/FileAPI/
File API includes FileReader and
         FileWriter APIs.

       Actually is supported by Chrome,
    Firefox > 3.6, Safari > 5.1, Opera > 11.1.
First steps on
                                                       offline storage
                                                       development.

http://www.flickr.com/photos/45449692@N00/3161567381
Storages Status/1
Storages Status/2
Detect if the storing feature is
 supported by the browser (with
modernizr), otherwise degradate
       to something else.
           (ie. dojox.storage)
http://www.flickr.com/photos/neate_photos/3529558272/




Protect against lost data,
  sync automatically.
http://www.flickr.com/photos/doctorow/2686237951/




            Automatically detect when
                users are online.
Do not exceed in storing data,
you can store binary data base64
  encoded but remember the
    pitfalls in performance.
Avoid race conditions.
If possible use WebSQL to use its
     transactions features.
use local storage to help your
application to become faster.
?
jsDay + phpDay 2012
 16-19 Maggio 2012 Verona
     www.phpday.it
Francesco Fullone
    ff@ideato.it
       @fullo



  via Quinto Bucci 205
   47023 Cesena (FC)
    info AT ideato.it
     www.ideato.it

More Related Content

What's hot

Tutorial 1 - Browser Basics
Tutorial 1 - Browser BasicsTutorial 1 - Browser Basics
Tutorial 1 - Browser Basicsdpd
 
Web browser pdf
Web browser pdfWeb browser pdf
Web browser pdfRavi Kumar
 
个人简历完整版-高强04052016
个人简历完整版-高强04052016个人简历完整版-高强04052016
个人简历完整版-高强04052016Kevin Gao
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentationImMe Khan
 
Posting Images using Android
Posting Images using AndroidPosting Images using Android
Posting Images using AndroidAli Muzaffar
 
Web Browser ! Batra Computer Centre
Web Browser ! Batra Computer CentreWeb Browser ! Batra Computer Centre
Web Browser ! Batra Computer Centrejatin batra
 
Lege nr. 192 2006, mo 441 2006
Lege nr. 192 2006, mo 441 2006Lege nr. 192 2006, mo 441 2006
Lege nr. 192 2006, mo 441 2006sabindutu
 
Introduction to web page
Introduction to web pageIntroduction to web page
Introduction to web pageMahmoud Shaqria
 
Browser Performance Tests - Internet Explorer 11 vs Firefox 25 vs Google Chro...
Browser Performance Tests - Internet Explorer 11 vs Firefox 25 vs Google Chro...Browser Performance Tests - Internet Explorer 11 vs Firefox 25 vs Google Chro...
Browser Performance Tests - Internet Explorer 11 vs Firefox 25 vs Google Chro...MIDAS
 
Building Dynamic Websites With Joomla CMS
Building Dynamic Websites With Joomla CMSBuilding Dynamic Websites With Joomla CMS
Building Dynamic Websites With Joomla CMSThomas Siegers
 
Web browser architecture
Web browser architectureWeb browser architecture
Web browser architectureNguyen Quang
 
Internet application unit2
Internet application unit2Internet application unit2
Internet application unit2MSc CST
 

What's hot (20)

Tutorial 1 - Browser Basics
Tutorial 1 - Browser BasicsTutorial 1 - Browser Basics
Tutorial 1 - Browser Basics
 
Web browser pdf
Web browser pdfWeb browser pdf
Web browser pdf
 
个人简历完整版-高强04052016
个人简历完整版-高强04052016个人简历完整版-高强04052016
个人简历完整版-高强04052016
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentation
 
How Browser Works?
How Browser Works?How Browser Works?
How Browser Works?
 
.htaccess
.htaccess.htaccess
.htaccess
 
Posting Images using Android
Posting Images using AndroidPosting Images using Android
Posting Images using Android
 
Web Browser ! Batra Computer Centre
Web Browser ! Batra Computer CentreWeb Browser ! Batra Computer Centre
Web Browser ! Batra Computer Centre
 
Lege nr. 192 2006, mo 441 2006
Lege nr. 192 2006, mo 441 2006Lege nr. 192 2006, mo 441 2006
Lege nr. 192 2006, mo 441 2006
 
Introduction to web page
Introduction to web pageIntroduction to web page
Introduction to web page
 
Browser Performance Tests - Internet Explorer 11 vs Firefox 25 vs Google Chro...
Browser Performance Tests - Internet Explorer 11 vs Firefox 25 vs Google Chro...Browser Performance Tests - Internet Explorer 11 vs Firefox 25 vs Google Chro...
Browser Performance Tests - Internet Explorer 11 vs Firefox 25 vs Google Chro...
 
Building Dynamic Websites With Joomla CMS
Building Dynamic Websites With Joomla CMSBuilding Dynamic Websites With Joomla CMS
Building Dynamic Websites With Joomla CMS
 
Presentation
PresentationPresentation
Presentation
 
Apache Web Server Setup 1
Apache Web Server Setup 1Apache Web Server Setup 1
Apache Web Server Setup 1
 
Web browers
Web browersWeb browers
Web browers
 
Web browser architecture
Web browser architectureWeb browser architecture
Web browser architecture
 
Importante leer
Importante leerImportante leer
Importante leer
 
introduction to web application development
introduction to web application developmentintroduction to web application development
introduction to web application development
 
ICT project
ICT projectICT project
ICT project
 
Internet application unit2
Internet application unit2Internet application unit2
Internet application unit2
 

Viewers also liked

Segregation And Resegregation (Online1)
Segregation And Resegregation (Online1)Segregation And Resegregation (Online1)
Segregation And Resegregation (Online1)dwax
 
Quality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingQuality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingFrancesco Fullone
 
Html5 storage and browser storage
Html5 storage and browser storageHtml5 storage and browser storage
Html5 storage and browser storageSway Deng
 
Many to many: no man is an island
Many to many: no man is an islandMany to many: no man is an island
Many to many: no man is an islandJacopo Romei
 

Viewers also liked (6)

Offline survival in the deadzone
Offline survival in the deadzoneOffline survival in the deadzone
Offline survival in the deadzone
 
Segregation And Resegregation (Online1)
Segregation And Resegregation (Online1)Segregation And Resegregation (Online1)
Segregation And Resegregation (Online1)
 
Quality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingQuality, Courtesy and a big Parking
Quality, Courtesy and a big Parking
 
Agile == Dynamic?
Agile == Dynamic?Agile == Dynamic?
Agile == Dynamic?
 
Html5 storage and browser storage
Html5 storage and browser storageHtml5 storage and browser storage
Html5 storage and browser storage
 
Many to many: no man is an island
Many to many: no man is an islandMany to many: no man is an island
Many to many: no man is an island
 

Similar to your browser, your storage

Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat ClientPaul Klipp
 
Don't touch the mobile parts
Don't touch the mobile partsDon't touch the mobile parts
Don't touch the mobile partsFrancesco Fullone
 
Caching objects-in-memory
Caching objects-in-memoryCaching objects-in-memory
Caching objects-in-memoryMauro Cassani
 
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
 
Building great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowBuilding great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowshwetank
 
Html5 cache mechanism & local storage
Html5 cache mechanism & local storageHtml5 cache mechanism & local storage
Html5 cache mechanism & local storageSendhil Kumar Kannan
 
Sitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversSitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversAnindita Bhattacharya
 
Caching and Its Main Types
Caching and Its Main TypesCaching and Its Main Types
Caching and Its Main TypesHTS Hosting
 
Silverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel PatternSilverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel PatternDerek Novavi
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Securitychuckbt
 
Caching Enhancement in ASP.NET 4.0
Caching Enhancement in ASP.NET 4.0Caching Enhancement in ASP.NET 4.0
Caching Enhancement in ASP.NET 4.0Abhijit Jana
 

Similar to your browser, your storage (20)

Your browser, my storage
Your browser, my storageYour browser, my storage
Your browser, my storage
 
Html5
Html5Html5
Html5
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
 
Web storage
Web storage Web storage
Web storage
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Don't touch the mobile parts
Don't touch the mobile partsDon't touch the mobile parts
Don't touch the mobile parts
 
Caching objects-in-memory
Caching objects-in-memoryCaching objects-in-memory
Caching objects-in-memory
 
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
 
Building great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowBuilding great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to know
 
Html5 cache mechanism & local storage
Html5 cache mechanism & local storageHtml5 cache mechanism & local storage
Html5 cache mechanism & local storage
 
Cache is king
Cache is kingCache is king
Cache is king
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
Sitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversSitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN servers
 
Caching and Its Main Types
Caching and Its Main TypesCaching and Its Main Types
Caching and Its Main Types
 
Internet test
Internet testInternet test
Internet test
 
Silverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel PatternSilverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel Pattern
 
Caching On Zos
Caching On ZosCaching On Zos
Caching On Zos
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
Caching Enhancement in ASP.NET 4.0
Caching Enhancement in ASP.NET 4.0Caching Enhancement in ASP.NET 4.0
Caching Enhancement in ASP.NET 4.0
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 

More from Francesco Fullone

Life Cycle Design e Circular Economy: un caso reale
Life Cycle Design e Circular Economy: un caso reale Life Cycle Design e Circular Economy: un caso reale
Life Cycle Design e Circular Economy: un caso reale Francesco Fullone
 
Okr istruzioni per l'uso - devfest
Okr   istruzioni per l'uso - devfestOkr   istruzioni per l'uso - devfest
Okr istruzioni per l'uso - devfestFrancesco Fullone
 
OKR, sono veramente utili alla mia azienda?
OKR, sono veramente utili alla mia azienda?OKR, sono veramente utili alla mia azienda?
OKR, sono veramente utili alla mia azienda?Francesco Fullone
 
Open Governance, un caso reale
Open Governance, un caso realeOpen Governance, un caso reale
Open Governance, un caso realeFrancesco Fullone
 
A recommendation engine for your applications
A recommendation engine for your applicationsA recommendation engine for your applications
A recommendation engine for your applicationsFrancesco Fullone
 
A recommendation engine for your applications
A recommendation engine for your applicationsA recommendation engine for your applications
A recommendation engine for your applicationsFrancesco Fullone
 
MVP & Startup, with OpenSource Software and Microsoft Azure
MVP & Startup, with OpenSource Software and Microsoft AzureMVP & Startup, with OpenSource Software and Microsoft Azure
MVP & Startup, with OpenSource Software and Microsoft AzureFrancesco Fullone
 
Help yourself, grow an healthy ecosystem
Help yourself, grow an healthy ecosystemHelp yourself, grow an healthy ecosystem
Help yourself, grow an healthy ecosystemFrancesco Fullone
 
Outsourcing, partners or suppliers?
Outsourcing, partners or suppliers?Outsourcing, partners or suppliers?
Outsourcing, partners or suppliers?Francesco Fullone
 
From brainstorming to product development
From brainstorming to product developmentFrom brainstorming to product development
From brainstorming to product developmentFrancesco Fullone
 
Compromises and not solution
Compromises and not solutionCompromises and not solution
Compromises and not solutionFrancesco Fullone
 
From webagency to...a better job, life and a lot of fun
From webagency to...a better job, life and a lot of funFrom webagency to...a better job, life and a lot of fun
From webagency to...a better job, life and a lot of funFrancesco Fullone
 

More from Francesco Fullone (20)

Life Cycle Design e Circular Economy: un caso reale
Life Cycle Design e Circular Economy: un caso reale Life Cycle Design e Circular Economy: un caso reale
Life Cycle Design e Circular Economy: un caso reale
 
Okr istruzioni per l'uso - devfest
Okr   istruzioni per l'uso - devfestOkr   istruzioni per l'uso - devfest
Okr istruzioni per l'uso - devfest
 
OKR, sono veramente utili alla mia azienda?
OKR, sono veramente utili alla mia azienda?OKR, sono veramente utili alla mia azienda?
OKR, sono veramente utili alla mia azienda?
 
Okr per community - icms
Okr   per community - icmsOkr   per community - icms
Okr per community - icms
 
Open Governance, un caso reale
Open Governance, un caso realeOpen Governance, un caso reale
Open Governance, un caso reale
 
A recommendation engine for your applications
A recommendation engine for your applicationsA recommendation engine for your applications
A recommendation engine for your applications
 
A recommendation engine for your applications
A recommendation engine for your applicationsA recommendation engine for your applications
A recommendation engine for your applications
 
Con te non ci lavoro
Con te non ci lavoroCon te non ci lavoro
Con te non ci lavoro
 
Con te non ci lavoro
Con te non ci lavoroCon te non ci lavoro
Con te non ci lavoro
 
Continuous budgeting
Continuous budgetingContinuous budgeting
Continuous budgeting
 
Remote working istruzioni
Remote working istruzioniRemote working istruzioni
Remote working istruzioni
 
Remote working istruzioni
Remote working istruzioniRemote working istruzioni
Remote working istruzioni
 
MVP & Startup, with OpenSource Software and Microsoft Azure
MVP & Startup, with OpenSource Software and Microsoft AzureMVP & Startup, with OpenSource Software and Microsoft Azure
MVP & Startup, with OpenSource Software and Microsoft Azure
 
Remote working istruzioni
Remote working istruzioniRemote working istruzioni
Remote working istruzioni
 
Help yourself, grow an healthy ecosystem
Help yourself, grow an healthy ecosystemHelp yourself, grow an healthy ecosystem
Help yourself, grow an healthy ecosystem
 
Outsourcing, partners or suppliers?
Outsourcing, partners or suppliers?Outsourcing, partners or suppliers?
Outsourcing, partners or suppliers?
 
From brainstorming to product development
From brainstorming to product developmentFrom brainstorming to product development
From brainstorming to product development
 
Compromises and not solution
Compromises and not solutionCompromises and not solution
Compromises and not solution
 
PHP Goes Enterprise
PHP Goes EnterprisePHP Goes Enterprise
PHP Goes Enterprise
 
From webagency to...a better job, life and a lot of fun
From webagency to...a better job, life and a lot of funFrom webagency to...a better job, life and a lot of fun
From webagency to...a better job, life and a lot of fun
 

Recently uploaded

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

your browser, your storage

  • 1. Your browser, my storage a new approach on data storing Francesco Fullone ff AT ideato.it
  • 2. Who am I Francesco Fullone aka Fullo - PHP developer since 1999 - President - and Open Source Evangelist - CEO @ - founder @ - Nerd and geek
  • 3. What we want is a lot of storage space, on the client, that persists beyond a page refresh and isn’t transmitted to the server. ~ M. Pilgrim
  • 4. Persistent local storage is one of the areas where client applications traditionally win against web applications.
  • 5. A jump in the past
  • 6. http://www.flickr.com/photos/betsyweber/4962298614/ Cookies were introduced in HTTP/1.0, limited to only 20 per domain and 4KB each.
  • 7. Cookies are sent to and from client at any connection. http://www.flickr.com/photos/dionhinchcliffe/4326080515
  • 8. Microsoft with Internet Explorer 6 introduced dHTML and the userData API to store up to 64KB of data
  • 9. Mozilla introduced with Firefox 2 the DOM Storage API, it will then know as Web Storage.
  • 10. Adobe, in 2002, created the Flash Cookies aka “Local Shared Objects” for Flash 6. Data storage increased to 100KB but it was difficult to be used.
  • 11. With Flash 8, in 2006, Adobe introduced the ExternalInterface to allow Js to access to the stored resources.
  • 12. Between 2005 and 2007 dojox.storage was written by Brad Neuberg as a Js->Flash bridge to manage bigger chunks of data (with user prompt over 1MB).
  • 13. Google created Gears in 2007, that introduced a database paradigm (based on SQLite) to the storage problem.
  • 14. All these storage systems had different APIs, a common platform is needed by all the browser vendors.
  • 15.
  • 16. The two approaches of storing: Application Cache Offline storage
  • 17. Application Caching involves saving the application's core logic and user-interface. http://www.whatwg.org/specs/web-apps/current- work/#applicationcache
  • 18. It is enabled by a file .manifest that declares which resources have to be saved locally. (theoretically limited to 5MB).
  • 19. CACHE MANIFEST # Explicitly cached entries CACHE: index.html stylesheet.css images/logo.png scripts/main.js # Resources that require the user to be online. NETWORK: login.php /myapi http://api.twitter.com # static.html will be served if main.php is inaccessible # offline.jpg will be served in place of all images in images/large/ FALLBACK: /main.php /static.html images/large/ images/offline.jpg
  • 20. applicationCache can use events to trigger application behavior – window.applicationCache.onchecking = function(e) { • log("Checking for application update"); –}
  • 21. If you change a resource and you don't update (rev) the .manifest the browser may not download the new file! (yes! cached resources have priority on the online ones)
  • 22. Data storage is about capturing specific data, or resources the user has expressed interest in. http://www.flickr.com/photos/bfionline/2380398365/
  • 24. Web Storage is the simpler implementation of the Data Storage paradigm. http://dev.w3.org/html5/webstorage/
  • 25. Web Storage is based on a structure of key-value pairs like any JavaScript object. localStorage.setItem("bar", foo);
  • 26. Web Storage can save up to 5MB but only as strings. So we have to force a casting if needed. var bar = parseInt(localStorage["bar"]);
  • 27. Web Storage should be local based or session based. var bar = localStorage["bar"]; var foo = sessionStorage["foo"];
  • 28. sessionStorage mantains a storage area that's available for the duration of the web session. Opening a new window/tab will create a new session.
  • 29. localStorage relies only on client, so we have to track changes and use storage.events to sync server and client if needed.
  • 30. Web SQL Database is WAS just an offline SQL implementation, based on SQLite. http://dev.w3.org/html5/webdatabase/
  • 31. this.db = openDatabase('geomood', '1.0', 'Geo', 8192); this.db.transaction(function(tx) { tx.executeSql("create table if not exists checkins(id integer primary key asc, time integer, latitude float, longitude float, mood string)", [], function() { console.log("siucc"); } » ); });
  • 32. Web SQL Database is not supported by Microsoft and Mozilla, instead it is on browsers based on webkit.
  • 33. But ... Web SQL Database is dead! as being dropped by W3C from 18/11/10 why bother more?
  • 34. Web SQL Database is the only database storage engine working on mobile devices!
  • 35. IndexedDB is a nice compromise between Web Storage and Web SQL Database. http://www.w3.org/TR/IndexedDB/
  • 36. IndexedDB allows to create an index on a certain field stored in a standard key->value mapping.
  • 37. IndexedDB is promoted by all browsers vendor, but is not yet fully supported by all Firefox 4, Chrome 11, have full implementation. Safari 5.1 and IE 10 will have
  • 38. FileAPI or File Storage will give us a way to store a lot of data. http://www.w3.org/TR/FileAPI/
  • 39. File API includes FileReader and FileWriter APIs. Actually is supported by Chrome, Firefox > 3.6, Safari > 5.1, Opera > 11.1.
  • 40. First steps on offline storage development. http://www.flickr.com/photos/45449692@N00/3161567381
  • 43. Detect if the storing feature is supported by the browser (with modernizr), otherwise degradate to something else. (ie. dojox.storage)
  • 45. http://www.flickr.com/photos/doctorow/2686237951/ Automatically detect when users are online.
  • 46. Do not exceed in storing data, you can store binary data base64 encoded but remember the pitfalls in performance.
  • 47. Avoid race conditions. If possible use WebSQL to use its transactions features.
  • 48. use local storage to help your application to become faster.
  • 49. ?
  • 50. jsDay + phpDay 2012 16-19 Maggio 2012 Verona www.phpday.it
  • 51. Francesco Fullone ff@ideato.it @fullo via Quinto Bucci 205 47023 Cesena (FC) info AT ideato.it www.ideato.it