SlideShare a Scribd company logo
Client side storage on the
                     modern web



Rajasekharan Vengalil     bit.ly/avranju
Developer Evangelist           @avranju
Microsoft
Agenda
•   Why should you care?   • Security Concerns
•   Cookies                • Summary
•   DOM Storage            • Questions
•   Indexed DB
•   Compatibility
    concerns
Why should you care?
• Enabling disconnected user experiences
  – Intermittent/no connectivity
  – Data caching – shopping carts, user profile
• Complements “Offline Web Applications”
  spec
• HTML based metro style apps on
  Windows 8
COOKIES
Cookies
• Works pretty much
  everywhere
• Storage size limitations
• Transmitted with every
  request
• Poor programming model
DOM STORAGE
DOM Storage
•   Simple persistent key/value store
•   Session storage persists for the session
•   Local storage persists across sessions
•   Scoped by domain
•   Supported even by IE8
•   Can store lots of data
    – 5 MB on FF and Chrome and 10 MB on IE
• But cannot iterate over data
DOM STORAGE

DEMO
INDEXED DB
Indexed DB defined
• Persistent data store in the browser
• Scoped by “origin”
• Each database is versioned

                               example.com


                                Store1   Store2
Indexed DB - Concepts
• Object Store
  – Like tables but only key/value
  – Object store can have 1 or more indexes
  – Keys can be arrays, strings, dates or numbers
  – Values can be objects also
• Transactions
  – Reads/writes done in transaction scope
  – Atomic, durable data access and mutation
Indexed DB – More concepts
• Requests
  – All read/write operations are executed using a
    Request
• Programming model
  – Synchronous
  – Asynchronous
DEMO

SAVE THE DOODLES
What about compatibility?
• Look up polyfills for DOM Storage and Indexed
  DB here:

       bit.ly/polyfills

• Amplify.js – abstracts client side storage
Security concerns
• DOM Storage and Indexed DB – scoped by
  origin
  – Think about cross-directory attacks -
    *.example.com
• Don’t store stuff like credit card numbers
• Be careful when you include 3rd party scripts
• Be careful when storing personally identifiable
  information (PII)
Summary
• We reviewed
  – Options for client side storage today
  – DOM Storage
  – Indexed DB
  – Security concerns to think about
Resources
• IE 10 Dev Guide         • My blog
   – bit.ly/HZUqm5           – bit.ly/avranju
• MDN Documentation       • Twitter
   – mzl.la/HZUz8V           – @avranju
• IE Test Drive Demo      • Email
   – bit.ly/IYidlc           – rajave@microsoft.com
• Indexed DB W3C Spec
   – bit.ly/Jf4MC0
QUESTIONS?

More Related Content

KEY
CE-9506_Session02
PDF
Forms as Structured Content
ODP
Web design using html
PPTX
Multi-content Containers in dotCMS 3.0
PPTX
Web development using html and wordpress
PPTX
Web Pages
PPTX
Varnish & Magento TechTalk @Lyracons
PPTX
World Wide Web
CE-9506_Session02
Forms as Structured Content
Web design using html
Multi-content Containers in dotCMS 3.0
Web development using html and wordpress
Web Pages
Varnish & Magento TechTalk @Lyracons
World Wide Web

What's hot (11)

PDF
Visual Design for Content Management Systems
PPT
Bib frame
PPTX
Web Design Norms
PPTX
WordPress Architecture For Beginners
PPTX
Introducing Joomla! CMS
PPTX
Castro Chapter 2
PDF
Rubedo features list
PPTX
SharePointArchitecture3
PDF
[@NaukriEngineering] IndexedDB
PPTX
CSS Stylesheet Training
PPTX
Font-End Development Tools
Visual Design for Content Management Systems
Bib frame
Web Design Norms
WordPress Architecture For Beginners
Introducing Joomla! CMS
Castro Chapter 2
Rubedo features list
SharePointArchitecture3
[@NaukriEngineering] IndexedDB
CSS Stylesheet Training
Font-End Development Tools
Ad

Similar to Client side storage on the modern web (20)

PPTX
Webinar: How MongoDB is Used to Manage Reference Data - May 2014
PPT
Redis e Memcached - Daniel Naves - Omnilogic
PPTX
Managing storage on Prem and in Cloud
PPTX
Cache is king
PPTX
Gr12 2_4 InternetServicesTechnologies.pptx
PPTX
Cloudian Webinar - 7 Key Reasons why Object Storage lowers Storage TCO
PDF
Content is King but Context is Queen ERM & ECM in SharePoint 2013
PPTX
In-browser storage and me
PPTX
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
PPTX
Porting ASP.NET applications to Windows Azure
PDF
Design - Building a Foundation for Hybrid Cloud Storage
PPTX
Ahmedabad- Global Azure bootcamp- Azure Storage Services- Global Azure Bootca...
PDF
PLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case Study
PPTX
dmBridge & dmMonocle
PPTX
Cloud computing UNIT 2.1 presentation in
PPTX
Webinar: Cloud Storage: The 5 Reasons IT Can Do it Better
PPTX
Encryption in Microsoft 365 - session for CollabDays UK - Bletchley Park
PPT
HTML5 Data Storage
PDF
IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...
KEY
MongoDB SF Python
Webinar: How MongoDB is Used to Manage Reference Data - May 2014
Redis e Memcached - Daniel Naves - Omnilogic
Managing storage on Prem and in Cloud
Cache is king
Gr12 2_4 InternetServicesTechnologies.pptx
Cloudian Webinar - 7 Key Reasons why Object Storage lowers Storage TCO
Content is King but Context is Queen ERM & ECM in SharePoint 2013
In-browser storage and me
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
Porting ASP.NET applications to Windows Azure
Design - Building a Foundation for Hybrid Cloud Storage
Ahmedabad- Global Azure bootcamp- Azure Storage Services- Global Azure Bootca...
PLNOG 6: Piotr Modzelewski, Bartłomiej Rymarski - Product Catalogue - Case Study
dmBridge & dmMonocle
Cloud computing UNIT 2.1 presentation in
Webinar: Cloud Storage: The 5 Reasons IT Can Do it Better
Encryption in Microsoft 365 - session for CollabDays UK - Bletchley Park
HTML5 Data Storage
IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...
MongoDB SF Python
Ad

Recently uploaded (20)

PPT
Module 1.ppt Iot fundamentals and Architecture
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Architecture types and enterprise applications.pdf
PPTX
The various Industrial Revolutions .pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Hybrid model detection and classification of lung cancer
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Modernising the Digital Integration Hub
PDF
Unlock new opportunities with location data.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPT
Geologic Time for studying geology for geologist
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
Module 1.ppt Iot fundamentals and Architecture
Chapter 5: Probability Theory and Statistics
Assigned Numbers - 2025 - Bluetooth® Document
Enhancing emotion recognition model for a student engagement use case through...
1 - Historical Antecedents, Social Consideration.pdf
sustainability-14-14877-v2.pddhzftheheeeee
Architecture types and enterprise applications.pdf
The various Industrial Revolutions .pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Hybrid model detection and classification of lung cancer
Tartificialntelligence_presentation.pptx
Modernising the Digital Integration Hub
Unlock new opportunities with location data.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Hindi spoken digit analysis for native and non-native speakers
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Geologic Time for studying geology for geologist
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
A contest of sentiment analysis: k-nearest neighbor versus neural network

Client side storage on the modern web

  • 1. Client side storage on the modern web Rajasekharan Vengalil bit.ly/avranju Developer Evangelist @avranju Microsoft
  • 2. Agenda • Why should you care? • Security Concerns • Cookies • Summary • DOM Storage • Questions • Indexed DB • Compatibility concerns
  • 3. Why should you care? • Enabling disconnected user experiences – Intermittent/no connectivity – Data caching – shopping carts, user profile • Complements “Offline Web Applications” spec • HTML based metro style apps on Windows 8
  • 5. Cookies • Works pretty much everywhere • Storage size limitations • Transmitted with every request • Poor programming model
  • 7. DOM Storage • Simple persistent key/value store • Session storage persists for the session • Local storage persists across sessions • Scoped by domain • Supported even by IE8 • Can store lots of data – 5 MB on FF and Chrome and 10 MB on IE • But cannot iterate over data
  • 10. Indexed DB defined • Persistent data store in the browser • Scoped by “origin” • Each database is versioned example.com Store1 Store2
  • 11. Indexed DB - Concepts • Object Store – Like tables but only key/value – Object store can have 1 or more indexes – Keys can be arrays, strings, dates or numbers – Values can be objects also • Transactions – Reads/writes done in transaction scope – Atomic, durable data access and mutation
  • 12. Indexed DB – More concepts • Requests – All read/write operations are executed using a Request • Programming model – Synchronous – Asynchronous
  • 14. What about compatibility? • Look up polyfills for DOM Storage and Indexed DB here: bit.ly/polyfills • Amplify.js – abstracts client side storage
  • 15. Security concerns • DOM Storage and Indexed DB – scoped by origin – Think about cross-directory attacks - *.example.com • Don’t store stuff like credit card numbers • Be careful when you include 3rd party scripts • Be careful when storing personally identifiable information (PII)
  • 16. Summary • We reviewed – Options for client side storage today – DOM Storage – Indexed DB – Security concerns to think about
  • 17. Resources • IE 10 Dev Guide • My blog – bit.ly/HZUqm5 – bit.ly/avranju • MDN Documentation • Twitter – mzl.la/HZUz8V – @avranju • IE Test Drive Demo • Email – bit.ly/IYidlc – rajave@microsoft.com • Indexed DB W3C Spec – bit.ly/Jf4MC0