SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
Client-side Storage
The Little Book Of (Mostly) Everything
Friday, April 26, 13
About me
Ruben Tan
VPE of OnApp CDN KL
Aspiring Javascript Samurai
@roguejs
http://roguejs.com
https://github.com/soggie
Friday, April 26, 13
CATS!!!!!
Friday, April 26, 13
About me
Friday, April 26, 13
About me
Worked with Java 6+ years
Friday, April 26, 13
About me
Worked with Java 6+ years
Adopted node.js, redis & CouchDB
Friday, April 26, 13
About me
Worked with Java 6+ years
Adopted node.js, redis & CouchDB
Huge fan of Javascript & related technologies
Friday, April 26, 13
About me
Worked with Java 6+ years
Adopted node.js, redis & CouchDB
Huge fan of Javascript & related technologies
Organizer of NodeHack
Friday, April 26, 13
About me
Worked with Java 6+ years
Adopted node.js, redis & CouchDB
Huge fan of Javascript & related technologies
Organizer of NodeHack
Dabbled in 0MQ and various messaging techs
Friday, April 26, 13
About me
Worked with Java 6+ years
Adopted node.js, redis & CouchDB
Huge fan of Javascript & related technologies
Organizer of NodeHack
Dabbled in 0MQ and various messaging techs
Working on a auto-devenv provisioner with vagrant
and puppet
Friday, April 26, 13
HTTP & Browser State
COOKIES:
HTTP by nature is stateless
1994 - web cookies created (in Netscape) for e-
commerce (carts)
Cookies became de-facto browser-side store
Inefficient because cookies are included in every
request
Friday, April 26, 13
HTTP & Browser State
Cookies inefficient and insecure
Sessions stored on server side became standard
Then HTML5 came along...
Friday, April 26, 13
Case Studies
Friday, April 26, 13
Case Studies
Synchronizing data across tabs
Friday, April 26, 13
Case Studies
Synchronizing data across tabs
Reduce server load by minimizing polling
Friday, April 26, 13
Case Studies
Synchronizing data across tabs
Reduce server load by minimizing polling
Historic immutable data (analytics, history, etc)
Friday, April 26, 13
Case Studies
Synchronizing data across tabs
Reduce server load by minimizing polling
Historic immutable data (analytics, history, etc)
Simplify data sync between frontend & backend
Friday, April 26, 13
Case Studies
Synchronizing data across tabs
Reduce server load by minimizing polling
Historic immutable data (analytics, history, etc)
Simplify data sync between frontend & backend
Persisting form data in complex forms
Friday, April 26, 13
Case Studies
Synchronizing data across tabs
Reduce server load by minimizing polling
Historic immutable data (analytics, history, etc)
Simplify data sync between frontend & backend
Persisting form data in complex forms
etc
Friday, April 26, 13
Example:
Server
Tab 1 Tab 2
Poll Poll
Friday, April 26, 13
Example:
Server
Tab 1 Tab 2
Update Push
Friday, April 26, 13
Example:
Server
Tab 1 Tab 2
Update
Update
Store
Read/Auto
SERVER
BROWSER
Friday, April 26, 13
Client-side Overview
Web Storage
Web SQL Database
Indexed Database
File Access
Friday, April 26, 13
Web Storage
http://dev.w3.org/html5/webstorage/
Protocol to store data in browser across tabs
Improvement on cookies
Comes in two flavors:
localStorage - forever
sessionStorage - until end of browser session
No support for transactions
Friday, April 26, 13
Web Storage Support
Friday, April 26, 13
Web SQL Database
Bringing SQL to client-side storage, based on
sqlite
Developers love it
Browser makers hated it
W3C abandoned it in November 2010
Friday, April 26, 13
Web SQL Support
Friday, April 26, 13
Indexed Database
Proposed by Oracle in 2009
Web Storage on steroids
Assumes data stored is an object, with an index
Allows queries via the indices
Friday, April 26, 13
Indexed Database Support
Friday, April 26, 13
File API
Let’s you save files in the browser
Friday, April 26, 13
File Access Support
Friday, April 26, 13
Limitations of Client Storage
Friday, April 26, 13
Limitations of Client Storage
Cookies = 4kb each
Friday, April 26, 13
Limitations of Client Storage
Cookies = 4kb each
localStorage = 2.5 ~ 5MB average
Friday, April 26, 13
Limitations of Client Storage
Cookies = 4kb each
localStorage = 2.5 ~ 5MB average
IndexedDB = up to 20% of available space
Friday, April 26, 13
Limitations of Client Storage
Cookies = 4kb each
localStorage = 2.5 ~ 5MB average
IndexedDB = up to 20% of available space
FileAPI = same as IndexedDB
Friday, April 26, 13
Moar Limitations!!
Friday, April 26, 13
Moar Limitations!!
Data-types to store:
Friday, April 26, 13
Moar Limitations!!
Data-types to store:
Cookie: STRING
Friday, April 26, 13
Moar Limitations!!
Data-types to store:
Cookie: STRING
Web Storage: STRING
Friday, April 26, 13
Moar Limitations!!
Data-types to store:
Cookie: STRING
Web Storage: STRING
Indexed Database: JS OBJECT
Friday, April 26, 13
Moar Limitations!!
Data-types to store:
Cookie: STRING
Web Storage: STRING
Indexed Database: JS OBJECT
File: BINARY
Friday, April 26, 13
Moving on...
Browsers and W3C sees the need for client-side
storage
Web Store + IndexedDB + File API = an almost
complete solution
Where does this leave us?
Friday, April 26, 13
The Emerging Scene
Google Gears (sadly, is dead)
Synckit
Store.js
Garlic.js - form persistence
PouchDB (based on CouchDB) - auto-sync with couchDB
jQuery plugins
db.js
LocalStorageDB
Lawnchair
ydn-db - unifying indexedDB, webSQL and webStorage
Friday, April 26, 13
Client-side Storage Challenges
Friday, April 26, 13
Client-side Storage Challenges
Limited amount of resources
Friday, April 26, 13
Client-side Storage Challenges
Limited amount of resources
Must be as lightweight as possible
Friday, April 26, 13
Client-side Storage Challenges
Limited amount of resources
Must be as lightweight as possible
Focuses more on querying of data vs. storage
mechanism
Friday, April 26, 13
Client-side Storage Challenges
Limited amount of resources
Must be as lightweight as possible
Focuses more on querying of data vs. storage
mechanism
Security, consistency, performance
Friday, April 26, 13
Client-side Storage Challenges
Limited amount of resources
Must be as lightweight as possible
Focuses more on querying of data vs. storage
mechanism
Security, consistency, performance
Javascript. Duuuddeeeee....
Friday, April 26, 13
What can we do?
Friday, April 26, 13
What can we do?
Observe the scene (PouchDB & ydn-db)
Friday, April 26, 13
What can we do?
Observe the scene (PouchDB & ydn-db)
Incorporate into major frameworks (backbone,
ember, angular, KO, etc)
Friday, April 26, 13
What can we do?
Observe the scene (PouchDB & ydn-db)
Incorporate into major frameworks (backbone,
ember, angular, KO, etc)
Simplify and standardize API
Friday, April 26, 13
What can we do?
Observe the scene (PouchDB & ydn-db)
Incorporate into major frameworks (backbone,
ember, angular, KO, etc)
Simplify and standardize API
Understanding the power of client-side
offloading
Friday, April 26, 13
That’s all folks!
Friday, April 26, 13

Weitere ähnliche Inhalte

Andere mochten auch

Теория и практика обработки естественного языка
Теория и практика обработки естественного языкаТеория и практика обработки естественного языка
Теория и практика обработки естественного языка
Nikolay Karpov
 
Построение собственного JS SDK — зачем и как?
Построение собственного JS SDK — зачем и как?Построение собственного JS SDK — зачем и как?
Построение собственного JS SDK — зачем и как?
buranLcme
 
Juniper Content Delivery Network
Juniper Content Delivery NetworkJuniper Content Delivery Network
Juniper Content Delivery Network
Sergii Liventsev
 
Future of CDN - Next 10 Years - Ahmet Ozalp, Akamai Technologies - DigiWorld ...
Future of CDN - Next 10 Years - Ahmet Ozalp, Akamai Technologies - DigiWorld ...Future of CDN - Next 10 Years - Ahmet Ozalp, Akamai Technologies - DigiWorld ...
Future of CDN - Next 10 Years - Ahmet Ozalp, Akamai Technologies - DigiWorld ...
IDATE DigiWorld
 

Andere mochten auch (14)

Symantec investor presentation may 2015 final
Symantec investor presentation may 2015 finalSymantec investor presentation may 2015 final
Symantec investor presentation may 2015 final
 
WebRTC: Business models and implications for mobile
WebRTC: Business models and implications for mobileWebRTC: Business models and implications for mobile
WebRTC: Business models and implications for mobile
 
Sso every where
Sso every whereSso every where
Sso every where
 
тезисы к докладу по электронной аутентификации в государственных системах
тезисы к докладу по электронной аутентификации в государственных системахтезисы к докладу по электронной аутентификации в государственных системах
тезисы к докладу по электронной аутентификации в государственных системах
 
Теория и практика обработки естественного языка
Теория и практика обработки естественного языкаТеория и практика обработки естественного языка
Теория и практика обработки естественного языка
 
OAuth 2.0
OAuth 2.0OAuth 2.0
OAuth 2.0
 
Eficientizarea IT - Temperfield
Eficientizarea IT - TemperfieldEficientizarea IT - Temperfield
Eficientizarea IT - Temperfield
 
Everyday - mongodb
Everyday - mongodbEveryday - mongodb
Everyday - mongodb
 
Построение собственного JS SDK — зачем и как?
Построение собственного JS SDK — зачем и как?Построение собственного JS SDK — зачем и как?
Построение собственного JS SDK — зачем и как?
 
WebRTC in the Real World
WebRTC in the Real WorldWebRTC in the Real World
WebRTC in the Real World
 
Juniper Content Delivery Network
Juniper Content Delivery NetworkJuniper Content Delivery Network
Juniper Content Delivery Network
 
Future of CDN - Next 10 Years - Ahmet Ozalp, Akamai Technologies - DigiWorld ...
Future of CDN - Next 10 Years - Ahmet Ozalp, Akamai Technologies - DigiWorld ...Future of CDN - Next 10 Years - Ahmet Ozalp, Akamai Technologies - DigiWorld ...
Future of CDN - Next 10 Years - Ahmet Ozalp, Akamai Technologies - DigiWorld ...
 
How Content Delivery Networks Work
How Content Delivery Networks WorkHow Content Delivery Networks Work
How Content Delivery Networks Work
 
Content Delivery Network
Content Delivery NetworkContent Delivery Network
Content Delivery Network
 

Ähnlich wie Client-side storage

Consideration for Building a Private Cloud
Consideration for Building a Private CloudConsideration for Building a Private Cloud
Consideration for Building a Private Cloud
OpenStack Foundation
 
Butter Web Browsing with Margarine
Butter Web Browsing with MargarineButter Web Browsing with Margarine
Butter Web Browsing with Margarine
Wayne Walls
 
High Performance WordPress
High Performance WordPressHigh Performance WordPress
High Performance WordPress
vnsavage
 
AWS Summit 2013 | Auckland - Opening Keynote
AWS Summit 2013 | Auckland - Opening KeynoteAWS Summit 2013 | Auckland - Opening Keynote
AWS Summit 2013 | Auckland - Opening Keynote
Amazon Web Services
 
Ingesting Banner output Schedule Classes into Cascade Server (In Java - Web S...
Ingesting Banner output Schedule Classes into Cascade Server (In Java - Web S...Ingesting Banner output Schedule Classes into Cascade Server (In Java - Web S...
Ingesting Banner output Schedule Classes into Cascade Server (In Java - Web S...
hannonhill
 

Ähnlich wie Client-side storage (20)

Introduction to NoSQL with MongoDB
Introduction to NoSQL with MongoDBIntroduction to NoSQL with MongoDB
Introduction to NoSQL with MongoDB
 
Consideration for Building a Private Cloud
Consideration for Building a Private CloudConsideration for Building a Private Cloud
Consideration for Building a Private Cloud
 
Butter Web Browsing with Margarine
Butter Web Browsing with MargarineButter Web Browsing with Margarine
Butter Web Browsing with Margarine
 
Aqua Browser Implementation at Oklahoma State University
Aqua Browser Implementation at Oklahoma State UniversityAqua Browser Implementation at Oklahoma State University
Aqua Browser Implementation at Oklahoma State University
 
Events and metrics the Lifeblood of Webops
Events and metrics the Lifeblood of WebopsEvents and metrics the Lifeblood of Webops
Events and metrics the Lifeblood of Webops
 
Slides
SlidesSlides
Slides
 
High Performance WordPress
High Performance WordPressHigh Performance WordPress
High Performance WordPress
 
Definitive Guide to Select Right Data Warehouse (2020)
Definitive Guide to Select Right Data Warehouse (2020)Definitive Guide to Select Right Data Warehouse (2020)
Definitive Guide to Select Right Data Warehouse (2020)
 
AWS Summit 2013 | Auckland - Opening Keynote
AWS Summit 2013 | Auckland - Opening KeynoteAWS Summit 2013 | Auckland - Opening Keynote
AWS Summit 2013 | Auckland - Opening Keynote
 
Ingesting Banner output Schedule Classes into Cascade Server (In Java - Web S...
Ingesting Banner output Schedule Classes into Cascade Server (In Java - Web S...Ingesting Banner output Schedule Classes into Cascade Server (In Java - Web S...
Ingesting Banner output Schedule Classes into Cascade Server (In Java - Web S...
 
Amazon Aurora (Debanjan Saha) - AWS DB Day
Amazon Aurora (Debanjan Saha) - AWS DB DayAmazon Aurora (Debanjan Saha) - AWS DB Day
Amazon Aurora (Debanjan Saha) - AWS DB Day
 
Mongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappeMongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappe
 
Html5 apis
Html5 apisHtml5 apis
Html5 apis
 
Free Load Testing Tools for Oracle Database – Which One Do I Use?
Free Load Testing Tools for Oracle Database – Which One Do I Use?Free Load Testing Tools for Oracle Database – Which One Do I Use?
Free Load Testing Tools for Oracle Database – Which One Do I Use?
 
Oredev 2013: Building Web Apps with Ember.js
Oredev 2013: Building Web Apps with Ember.jsOredev 2013: Building Web Apps with Ember.js
Oredev 2013: Building Web Apps with Ember.js
 
Cloud Databases in Research and Practice
Cloud Databases in Research and PracticeCloud Databases in Research and Practice
Cloud Databases in Research and Practice
 
An Introduction to Amazon Aurora Cloud-native Relational Database
An Introduction to Amazon Aurora Cloud-native Relational DatabaseAn Introduction to Amazon Aurora Cloud-native Relational Database
An Introduction to Amazon Aurora Cloud-native Relational Database
 
Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Casario
Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - CasarioBecome a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Casario
Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Casario
 
Set this Big Data technology zoo in order (@pavlobaron)
Set this Big Data technology zoo in order (@pavlobaron)Set this Big Data technology zoo in order (@pavlobaron)
Set this Big Data technology zoo in order (@pavlobaron)
 
Nosql kl-2013-04-25
Nosql kl-2013-04-25Nosql kl-2013-04-25
Nosql kl-2013-04-25
 

Mehr von Ruben Tan

Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
Ruben Tan
 
40 square's git workflow
40 square's git workflow40 square's git workflow
40 square's git workflow
Ruben Tan
 
Unit testing for 40 square software
Unit testing for 40 square softwareUnit testing for 40 square software
Unit testing for 40 square software
Ruben Tan
 

Mehr von Ruben Tan (11)

Basic distributed systems principles
Basic distributed systems principlesBasic distributed systems principles
Basic distributed systems principles
 
Demystifying blockchains
Demystifying blockchainsDemystifying blockchains
Demystifying blockchains
 
Banking on blockchains
Banking on blockchainsBanking on blockchains
Banking on blockchains
 
Consensus in distributed computing
Consensus in distributed computingConsensus in distributed computing
Consensus in distributed computing
 
Leveraging zeromq for node.js
Leveraging zeromq for node.jsLeveraging zeromq for node.js
Leveraging zeromq for node.js
 
Defensive programming in Javascript and Node.js
Defensive programming in Javascript and Node.jsDefensive programming in Javascript and Node.js
Defensive programming in Javascript and Node.js
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
 
How we git - commit policy and code review
How we git - commit policy and code reviewHow we git - commit policy and code review
How we git - commit policy and code review
 
NodeHack #2 - MVP
NodeHack #2 - MVPNodeHack #2 - MVP
NodeHack #2 - MVP
 
40 square's git workflow
40 square's git workflow40 square's git workflow
40 square's git workflow
 
Unit testing for 40 square software
Unit testing for 40 square softwareUnit testing for 40 square software
Unit testing for 40 square software
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
[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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
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...
 
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?
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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...
 
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
 
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
 

Client-side storage