SlideShare uma empresa Scribd logo
1 de 30
HTML5 Data Storage
allanhuang@eSobi.com
Agenda
 Data



Cookie
Web Storage





Storage

Session Storage
Local Storage

Database Storage



Web SQL Database
Indexed Database
Data Storage
Cookie
 Disadvantages


Cookies are sent to the server with every HTTP
request






Slow down web application
Send data unencrypted over the Internet, except for
SSL

Cookies are limited to 4 KB per domain
Cookies are tied to the browser session, not
browser window / tab
Client-side Storage
 What



A lot of storage space…
On the client…




Increase accessibility

That persists beyond a page refresh…




we really want is…

More responsiveness

And is not transmitted to the server


Reduced load on server
Web Storage


Browser Support





Session Storage




Limit it to about 5 MB per domain
Already available in all major new browsers
Persist data for as long as that browser window / tab is
open

Local Storage



Persist data even the browser window / tab is closed in the
long-term
User agents may, if so configured by the user,
automatically delete stored data after a period of time
Web Storage API


Persist data storage of key-value pair data in Web
clients









long length;
string key(long position);
string getItem(string key);
void setItem(string key, string value);
void removeItem(string key);
void clear();

Store JSON object


JSON.parse, JSON.stringify
Web Storage API
Web Storage Event
 Storage

event is fired when a storage area
changes


Onstorage

 StorageEvent






object properties

key : string
oldValue : string / null
newValue : string / null
url : string
storageArea : storage
Analysis


Advantages







Supported on all modern browsers
Simple API signature
Simple call flow, being a synchronous API
Semantic events available to keep other tabs/windows in
sync

Disadvantages




Poor performance on searching or storing large / complex
data
Unscalable, no query language, schemas
It not supports a transactional database model
Database Storage
 Limit

it to about 5 MB per domain
 Web SQL Database



An embedded SQL database - SQLite
Chrome, Safari, Opera, iOS (iPhone / iPad / Mac),
Android

 Indexed




Database

A simple flat-file database with hierarchical
key/value persistence and basic indexing
Chrome, Firefox, IE10
Web SQL Database
Opening the Database
Creating a Table
Adding data to a table
Querying the data in a table
Deleting data from a table
Analysis


Advantages







Fast and pretty feature-rich SQL implementation
Good performance generally, being an asynchronous API
It supports a transactional database model
Easier to maintain integrity of data

Disadvantages




Available in Chrome and webkit-based browsers (Safari,
etc.), but not Firefox or IE
W3C announced that It is deprecated
Steep learning curve, requiring knowledge of relational
databases and SQL
Indexed Database
Opening the database
Creating an Object Store
Adding data to a store
Querying the data in a store
Deleting data from a store
Analysis


Advantages







If you're a NoSQL type of person, then this might fit the bill
perfectly
Good performance generally, being an asynchronous API
It supports a transactional database model
Fairly easy learning curve, due to a simple data model

Disadvantages





Somewhat complex API
Need to ensure data consistency and integrity
Not yet available in most new browsers
If you wanted SQL, you're not getting it here
Security Issues
 If


the data is in the data storage…
Non-Security!




No credential verification because there is no server
request

Verify the current value that you read to or write
from the data storage every time


If there’s any difference, delete all of the values from
data storage
Security Check
DB Storage Comparison
Category
Advantages

Disadvantages

Web SQL Database
A real, relational database
implementation on the client
(SQLite)
SQLite

•
•

•

The spec is deprecated
Overhead of SQL language
you need to master and
transform your JavaScript
objects into relational
schema
Not object-driven

Indexed Database
•Allows

fast indexing and searching of
objects, so in a web application scenario,
you can manage your data and read/write it
fast
•A NoSQL database that let you work with
your JavaScript objects and indexing them
based on your application needs
•Works in asynchronous mode with
moderately granular locking per transaction.
This allows you to work inside the eventdriven module of JavaScript
Harder to understand if you are coming
from the world of relational databases
DB Storage Comparison
Category

Web SQL Database

Indexed Database

Location

Tables contain columns and
rows

Object Store contains JavaScript objects and
keys

Query
Mechanism

SQL

Cursor APIs, Key Range APIs, and
Application Code

Transaction

Lock can happen on databases,
tables, or rows on
READ_WRITE transactions

Lock can happen on database
VERSION_CHANGE transaction, on an
objectStore READ_ONLY and READ_WRITE
transactions

Transaction
Commits

Transaction creation is explicit.
Default is to rollback unless we
call commit

Transaction creation is explicit. Default is to
commit unless we call abort or there is an
error that is not caught
Conclusion


Tips








If you're only deploying on Mobile platforms, then Web SQL
Database is a no-brainer
If you're deploying on Desktop platforms and can require IE
/ Firefox as your browser, then Indexed Database is for you
Don’t use Web Storage in any heavy-duty application at the
moment
Init-Time Branching




e.g. Browser sniffing

Q&A

Mais conteúdo relacionado

Mais procurados

Microsoft SQL Server 2008
Microsoft SQL Server 2008Microsoft SQL Server 2008
Microsoft SQL Server 2008Hossein Zahed
 
SPSBE building an faq for end users
SPSBE building an faq for end usersSPSBE building an faq for end users
SPSBE building an faq for end usersPaul Hunt
 
Single page applications with backbone js
Single page applications with backbone jsSingle page applications with backbone js
Single page applications with backbone jsGil Fink
 
Sharepointarchitecturereal worldscenariofundamentals-150419043032-conversion-...
Sharepointarchitecturereal worldscenariofundamentals-150419043032-conversion-...Sharepointarchitecturereal worldscenariofundamentals-150419043032-conversion-...
Sharepointarchitecturereal worldscenariofundamentals-150419043032-conversion-...BIWUG
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance TopicsAli Taki
 
Spsbe 18-04-15 - should i move my network folders to office 365
Spsbe   18-04-15 - should i move my network folders to office 365Spsbe   18-04-15 - should i move my network folders to office 365
Spsbe 18-04-15 - should i move my network folders to office 365BIWUG
 
[@NaukriEngineering] IndexedDB
[@NaukriEngineering] IndexedDB[@NaukriEngineering] IndexedDB
[@NaukriEngineering] IndexedDBNaukri.com
 
Search-Driven Applications with SharePoint 2013 (#SBSBE16)
Search-Driven Applications with SharePoint 2013 (#SBSBE16)Search-Driven Applications with SharePoint 2013 (#SBSBE16)
Search-Driven Applications with SharePoint 2013 (#SBSBE16)Maximilian Melcher
 
Back to the Basics - 1 - Introduction to Web Development
Back to the Basics - 1 - Introduction to Web DevelopmentBack to the Basics - 1 - Introduction to Web Development
Back to the Basics - 1 - Introduction to Web DevelopmentClint LaForest
 
Using the Cascade Server Web Service API, by Artur Tomusiak
Using the Cascade Server Web Service API, by Artur TomusiakUsing the Cascade Server Web Service API, by Artur Tomusiak
Using the Cascade Server Web Service API, by Artur Tomusiakhannonhill
 

Mais procurados (20)

Ajax workshop
Ajax workshopAjax workshop
Ajax workshop
 
Microsoft SQL Server 2008
Microsoft SQL Server 2008Microsoft SQL Server 2008
Microsoft SQL Server 2008
 
SPSBE building an faq for end users
SPSBE building an faq for end usersSPSBE building an faq for end users
SPSBE building an faq for end users
 
Mobile Web
Mobile WebMobile Web
Mobile Web
 
Ajax
AjaxAjax
Ajax
 
Single page applications with backbone js
Single page applications with backbone jsSingle page applications with backbone js
Single page applications with backbone js
 
ITI006En-AJAX
ITI006En-AJAXITI006En-AJAX
ITI006En-AJAX
 
Ajax
AjaxAjax
Ajax
 
Sharepointarchitecturereal worldscenariofundamentals-150419043032-conversion-...
Sharepointarchitecturereal worldscenariofundamentals-150419043032-conversion-...Sharepointarchitecturereal worldscenariofundamentals-150419043032-conversion-...
Sharepointarchitecturereal worldscenariofundamentals-150419043032-conversion-...
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
Spsbe 18-04-15 - should i move my network folders to office 365
Spsbe   18-04-15 - should i move my network folders to office 365Spsbe   18-04-15 - should i move my network folders to office 365
Spsbe 18-04-15 - should i move my network folders to office 365
 
Asp.net Project
Asp.net Project Asp.net Project
Asp.net Project
 
[@NaukriEngineering] IndexedDB
[@NaukriEngineering] IndexedDB[@NaukriEngineering] IndexedDB
[@NaukriEngineering] IndexedDB
 
Search-Driven Applications with SharePoint 2013 (#SBSBE16)
Search-Driven Applications with SharePoint 2013 (#SBSBE16)Search-Driven Applications with SharePoint 2013 (#SBSBE16)
Search-Driven Applications with SharePoint 2013 (#SBSBE16)
 
Web Design Norms
Web Design NormsWeb Design Norms
Web Design Norms
 
Back to the Basics - 1 - Introduction to Web Development
Back to the Basics - 1 - Introduction to Web DevelopmentBack to the Basics - 1 - Introduction to Web Development
Back to the Basics - 1 - Introduction to Web Development
 
ASP
ASPASP
ASP
 
Introduction ASP
Introduction ASPIntroduction ASP
Introduction ASP
 
Using the Cascade Server Web Service API, by Artur Tomusiak
Using the Cascade Server Web Service API, by Artur TomusiakUsing the Cascade Server Web Service API, by Artur Tomusiak
Using the Cascade Server Web Service API, by Artur Tomusiak
 

Semelhante a HTML5 Data Storage

Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat ClientPaul Klipp
 
Lift web framework
Lift web frameworkLift web framework
Lift web frameworkPetr Hošek
 
Asia Pacific SharePoint Capacity Planning by Joel Oleson
Asia Pacific SharePoint Capacity Planning by Joel OlesonAsia Pacific SharePoint Capacity Planning by Joel Oleson
Asia Pacific SharePoint Capacity Planning by Joel OlesonJoel Oleson
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationJonathan Abrams
 
Back to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonBack to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonJoel Oleson
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSguest7c2e070
 
Dipping Your Toes: Azure Data Lake for DBAs
Dipping Your Toes: Azure Data Lake for DBAsDipping Your Toes: Azure Data Lake for DBAs
Dipping Your Toes: Azure Data Lake for DBAsBob Pusateri
 
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...Kalaiselvan (Selvan)
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Archroyans
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Archguest18a0f1
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Archmclee
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Commit University
 
ArcReady - Architecting For The Cloud
ArcReady - Architecting For The CloudArcReady - Architecting For The Cloud
ArcReady - Architecting For The CloudMicrosoft ArcReady
 
Afternoons with Azure - Azure Data Services
Afternoons with Azure - Azure Data ServicesAfternoons with Azure - Azure Data Services
Afternoons with Azure - Azure Data ServicesCCG
 
SharePoint Intelligence Real World Business Workflow With Share Point Designe...
SharePoint Intelligence Real World Business Workflow With Share Point Designe...SharePoint Intelligence Real World Business Workflow With Share Point Designe...
SharePoint Intelligence Real World Business Workflow With Share Point Designe...Ivan Sanders
 
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with AzureAzure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with AzureMarco Parenzan
 
Academy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageAcademy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageBinary Studio
 
Overview of MongoDB and Other Non-Relational Databases
Overview of MongoDB and Other Non-Relational DatabasesOverview of MongoDB and Other Non-Relational Databases
Overview of MongoDB and Other Non-Relational DatabasesAndrew Kandels
 

Semelhante a HTML5 Data Storage (20)

Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
 
Lift web framework
Lift web frameworkLift web framework
Lift web framework
 
Asia Pacific SharePoint Capacity Planning by Joel Oleson
Asia Pacific SharePoint Capacity Planning by Joel OlesonAsia Pacific SharePoint Capacity Planning by Joel Oleson
Asia Pacific SharePoint Capacity Planning by Joel Oleson
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
 
Back to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonBack to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel Oleson
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
 
Dipping Your Toes: Azure Data Lake for DBAs
Dipping Your Toes: Azure Data Lake for DBAsDipping Your Toes: Azure Data Lake for DBAs
Dipping Your Toes: Azure Data Lake for DBAs
 
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
Silicon India Java Conference: Building Scalable Solutions For Commerce Silic...
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
 
ArcReady - Architecting For The Cloud
ArcReady - Architecting For The CloudArcReady - Architecting For The Cloud
ArcReady - Architecting For The Cloud
 
Java part 3
Java part  3Java part  3
Java part 3
 
Afternoons with Azure - Azure Data Services
Afternoons with Azure - Azure Data ServicesAfternoons with Azure - Azure Data Services
Afternoons with Azure - Azure Data Services
 
SharePoint Intelligence Real World Business Workflow With Share Point Designe...
SharePoint Intelligence Real World Business Workflow With Share Point Designe...SharePoint Intelligence Real World Business Workflow With Share Point Designe...
SharePoint Intelligence Real World Business Workflow With Share Point Designe...
 
50 Shades of SharePoint: SharePoint 2013 Insanity Demystified
50 Shades of SharePoint: SharePoint 2013 Insanity Demystified50 Shades of SharePoint: SharePoint 2013 Insanity Demystified
50 Shades of SharePoint: SharePoint 2013 Insanity Demystified
 
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with AzureAzure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure
Azure Weekly - 2015.01.20 - Marco Parenzan - Data Opportunities with Azure
 
Academy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageAcademy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storage
 
Overview of MongoDB and Other Non-Relational Databases
Overview of MongoDB and Other Non-Relational DatabasesOverview of MongoDB and Other Non-Relational Databases
Overview of MongoDB and Other Non-Relational Databases
 

Mais de Allan Huang

Concurrency in Java
Concurrency in  JavaConcurrency in  Java
Concurrency in JavaAllan Huang
 
Build, logging, and unit test tools
Build, logging, and unit test toolsBuild, logging, and unit test tools
Build, logging, and unit test toolsAllan Huang
 
Java JSON Parser Comparison
Java JSON Parser ComparisonJava JSON Parser Comparison
Java JSON Parser ComparisonAllan Huang
 
Netty 4-based RPC System Development
Netty 4-based RPC System DevelopmentNetty 4-based RPC System Development
Netty 4-based RPC System DevelopmentAllan Huang
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureAllan Huang
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New EvolutionAllan Huang
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New EvolutionAllan Huang
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New EvolutionAllan Huang
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignAllan Huang
 
Boilerpipe Integration And Improvement
Boilerpipe Integration And ImprovementBoilerpipe Integration And Improvement
Boilerpipe Integration And ImprovementAllan Huang
 
Build Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapBuild Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapAllan Huang
 
HTML5 Multithreading
HTML5 MultithreadingHTML5 Multithreading
HTML5 MultithreadingAllan Huang
 
HTML5 Offline Web Application
HTML5 Offline Web ApplicationHTML5 Offline Web Application
HTML5 Offline Web ApplicationAllan Huang
 
Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script PatternsAllan Huang
 
Weighted feed recommand
Weighted feed recommandWeighted feed recommand
Weighted feed recommandAllan Huang
 
eSobi Site Initiation
eSobi Site InitiationeSobi Site Initiation
eSobi Site InitiationAllan Huang
 
Architecture of eSobi club based on J2EE
Architecture of eSobi club based on J2EEArchitecture of eSobi club based on J2EE
Architecture of eSobi club based on J2EEAllan Huang
 

Mais de Allan Huang (20)

Concurrency in Java
Concurrency in  JavaConcurrency in  Java
Concurrency in Java
 
Build, logging, and unit test tools
Build, logging, and unit test toolsBuild, logging, and unit test tools
Build, logging, and unit test tools
 
Drools
DroolsDrools
Drools
 
Java JSON Parser Comparison
Java JSON Parser ComparisonJava JSON Parser Comparison
Java JSON Parser Comparison
 
Netty 4-based RPC System Development
Netty 4-based RPC System DevelopmentNetty 4-based RPC System Development
Netty 4-based RPC System Development
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered Architecture
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New Evolution
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New Evolution
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Boilerpipe Integration And Improvement
Boilerpipe Integration And ImprovementBoilerpipe Integration And Improvement
Boilerpipe Integration And Improvement
 
YQL Case Study
YQL Case StudyYQL Case Study
YQL Case Study
 
Build Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapBuild Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGap
 
HTML5 Multithreading
HTML5 MultithreadingHTML5 Multithreading
HTML5 Multithreading
 
HTML5 Offline Web Application
HTML5 Offline Web ApplicationHTML5 Offline Web Application
HTML5 Offline Web Application
 
Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script Patterns
 
Weighted feed recommand
Weighted feed recommandWeighted feed recommand
Weighted feed recommand
 
Web Crawler
Web CrawlerWeb Crawler
Web Crawler
 
eSobi Site Initiation
eSobi Site InitiationeSobi Site Initiation
eSobi Site Initiation
 
Architecture of eSobi club based on J2EE
Architecture of eSobi club based on J2EEArchitecture of eSobi club based on J2EE
Architecture of eSobi club based on J2EE
 

Último

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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 MountPuma Security, LLC
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Último (20)

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

HTML5 Data Storage

  • 2. Agenda  Data   Cookie Web Storage    Storage Session Storage Local Storage Database Storage   Web SQL Database Indexed Database
  • 4. Cookie  Disadvantages  Cookies are sent to the server with every HTTP request     Slow down web application Send data unencrypted over the Internet, except for SSL Cookies are limited to 4 KB per domain Cookies are tied to the browser session, not browser window / tab
  • 5. Client-side Storage  What   A lot of storage space… On the client…   Increase accessibility That persists beyond a page refresh…   we really want is… More responsiveness And is not transmitted to the server  Reduced load on server
  • 6. Web Storage  Browser Support    Session Storage   Limit it to about 5 MB per domain Already available in all major new browsers Persist data for as long as that browser window / tab is open Local Storage   Persist data even the browser window / tab is closed in the long-term User agents may, if so configured by the user, automatically delete stored data after a period of time
  • 7. Web Storage API  Persist data storage of key-value pair data in Web clients        long length; string key(long position); string getItem(string key); void setItem(string key, string value); void removeItem(string key); void clear(); Store JSON object  JSON.parse, JSON.stringify
  • 9. Web Storage Event  Storage event is fired when a storage area changes  Onstorage  StorageEvent      object properties key : string oldValue : string / null newValue : string / null url : string storageArea : storage
  • 10. Analysis  Advantages      Supported on all modern browsers Simple API signature Simple call flow, being a synchronous API Semantic events available to keep other tabs/windows in sync Disadvantages    Poor performance on searching or storing large / complex data Unscalable, no query language, schemas It not supports a transactional database model
  • 11. Database Storage  Limit it to about 5 MB per domain  Web SQL Database   An embedded SQL database - SQLite Chrome, Safari, Opera, iOS (iPhone / iPad / Mac), Android  Indexed   Database A simple flat-file database with hierarchical key/value persistence and basic indexing Chrome, Firefox, IE10
  • 15. Adding data to a table
  • 16. Querying the data in a table
  • 18. Analysis  Advantages      Fast and pretty feature-rich SQL implementation Good performance generally, being an asynchronous API It supports a transactional database model Easier to maintain integrity of data Disadvantages    Available in Chrome and webkit-based browsers (Safari, etc.), but not Firefox or IE W3C announced that It is deprecated Steep learning curve, requiring knowledge of relational databases and SQL
  • 22. Adding data to a store
  • 23. Querying the data in a store
  • 25. Analysis  Advantages      If you're a NoSQL type of person, then this might fit the bill perfectly Good performance generally, being an asynchronous API It supports a transactional database model Fairly easy learning curve, due to a simple data model Disadvantages     Somewhat complex API Need to ensure data consistency and integrity Not yet available in most new browsers If you wanted SQL, you're not getting it here
  • 26. Security Issues  If  the data is in the data storage… Non-Security!   No credential verification because there is no server request Verify the current value that you read to or write from the data storage every time  If there’s any difference, delete all of the values from data storage
  • 28. DB Storage Comparison Category Advantages Disadvantages Web SQL Database A real, relational database implementation on the client (SQLite) SQLite • • • The spec is deprecated Overhead of SQL language you need to master and transform your JavaScript objects into relational schema Not object-driven Indexed Database •Allows fast indexing and searching of objects, so in a web application scenario, you can manage your data and read/write it fast •A NoSQL database that let you work with your JavaScript objects and indexing them based on your application needs •Works in asynchronous mode with moderately granular locking per transaction. This allows you to work inside the eventdriven module of JavaScript Harder to understand if you are coming from the world of relational databases
  • 29. DB Storage Comparison Category Web SQL Database Indexed Database Location Tables contain columns and rows Object Store contains JavaScript objects and keys Query Mechanism SQL Cursor APIs, Key Range APIs, and Application Code Transaction Lock can happen on databases, tables, or rows on READ_WRITE transactions Lock can happen on database VERSION_CHANGE transaction, on an objectStore READ_ONLY and READ_WRITE transactions Transaction Commits Transaction creation is explicit. Default is to rollback unless we call commit Transaction creation is explicit. Default is to commit unless we call abort or there is an error that is not caught
  • 30. Conclusion  Tips     If you're only deploying on Mobile platforms, then Web SQL Database is a no-brainer If you're deploying on Desktop platforms and can require IE / Firefox as your browser, then Indexed Database is for you Don’t use Web Storage in any heavy-duty application at the moment Init-Time Branching   e.g. Browser sniffing Q&A