SlideShare a Scribd company logo
Who's afraid of front end databases?
WHO’S AFRAID OF FRONT-
END DATABASES?
The problems
Performance
Offline Scenarios
User Experience
WHO’S AFRAID OF FRONT-
END DATABASES?
About Me
‱ sparXys CEO and senior consultant
‱ Microsoft MVP in the last 8 years
‱ Pro Single Page Application Development (Apress) co-author
‱ 4 Microsoft Official Courses (MOCs) co-author
‱ GDG Rishon and AngularUP co-organizer
Agenda
‱ The options
‱ IndexedDB
‱ Working with libraries
Storing Data in The Browser
‱ Cookies
‱ Super small storage, string based, API not friendly
‱ Web Storage (localStorage / sessionStorage)
‱ String based dictionary, synchronous API
‱ Web SQL database
‱ Deprecated!
Cookies
Are such an old technology

DEMO: COOKIES
How localStorage feels like
DEMO: LOCALSTORAGE
Who's afraid of front end databases?
IndexedDB
‱ Advanced key-value data management
IndexedDB
Front-end
App
Fast
Reliable
Limited capacity
Local access only
Information loss
IndexedDB
Database
objectStore
Cursor on
objectStore
key : value
key : value
key : value
Index
Cursor on
index
IndexedDB API
‱ Very massive!
‱ Asynchronous
‱ Important note: synchronous APIs were deprecated by W3C
‱ Exposed through window.indexedDB object
DEMO: INDEXEDDB IN
ACTION
Who's afraid of front end databases?
IndexedDB – Open the Database
var db;
var request = window.indexedDB.open(“dbName");
request.onerror = function(event) {


};
request.onsuccess = function(event) {
db = request.result;
};
IndexedDB – Creating an objectStore
var request = indexedDB.open(‘dbName’, 2);
request.onupgradeneeded = function(event) {
// Create an objectStore to hold information about customers.
var objectStore = db.createObjectStore(“products", { keyPath: “id" });
// Create an index to search customers by name.
objectStore.createIndex("name", "name", { unique: false });
};
IndexedDB – Creating a Transaction
var transaction = db.transaction([“products"], “readwrite”);
transaction.oncomplete = function(event) { 
 };
transaction.onerror = function(event) { 
 };
// will add the object into the objectStore
var objectStore = transaction.objectStore(“products”);
var request = objectStore.add({ id: 7, name: “IndexedDB" });
request.onsuccess = function(event) {
// event.target.result == object.id
}
IndexedDB – Using a Cursor
var transaction = db.transaction([“products”]);
var objectStore = transaction.objectStore(“products”);
var cursor = objectStore.openCursor();
cursor.onsuccess = function(event) {
var cursor = event.target.result;
if (cursor) {


cursor.continue();
} else {
console.log(“No entries”);
}
};
IndexedDB – Working with Indexes
var transaction = db.transaction([“products”]);
var objectStore = transaction.objectStore(“products”);
var index = objectStore.index(“name”);
var request = index.get(“John");
request.onsuccess = function(event) { 
 };
DEMO: LET’S CODE WITH
INDEXEDDB
IndexedDB Problems?
‱ Verbose syntax
‱ Too much boilerplate
‱ No support for queries style SQL
‱ No full text search
‱ And more
Libraries to the Rescue
‱ Dixie.js - http://dexie.org/
‱ localForage - https://github.com/localForage/localForage
‱ PouchDB - https://pouchdb.com/
‱ Working with Angular? you are covered
‱ Angular 1 service - https://github.com/bramski/angular-indexedDB
‱ angular2-indexeddb service - https://github.com/gilf/angular2-indexeddb
DEMO: DIXIE
Where IndexedDB Shines?
‱ Data driven scenarios
‱ As a hybrid application database
‱ Combined with Service Workers
‱ Or for any offline scenarios
Summary
‱ IndexedDB is a full blown database in your app’s front-end
‱ It can help you to persist your front-end data
‱ IndexedDB is suitable for offline scenarios
Resources
‱ IndexedDB on MDN - http://mzl.la/1u1sngQ
‱ angular2-indexeddb - https://github.com/gilf/angular2-indexeddb
‱ My Website – http://www.gilfink.net
‱ Follow me on Twitter – @gilfink
Thank You!
Ad

More Related Content

What's hot (20)

SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
Sonja Madsen
 
Client storage
Client storageClient storage
Client storage
Parashuram N
 
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Sirar Salih
 
seamless – Object Oriented CMS System
seamless – Object Oriented CMS Systemseamless – Object Oriented CMS System
seamless – Object Oriented CMS System
ESUG
 
Web storage
Web storageWeb storage
Web storage
Junji Manno
 
Icinga Camp Bangalore - Icinga and Icinga Director
Icinga Camp Bangalore - Icinga and Icinga Director Icinga Camp Bangalore - Icinga and Icinga Director
Icinga Camp Bangalore - Icinga and Icinga Director
Icinga
 
Indexed DB
Indexed DBIndexed DB
Indexed DB
Parashuram N
 
Search as main navigation
Search as main navigationSearch as main navigation
Search as main navigation
punkt.de GmbH
 
I3 - Running SharePoint 2016 in Azure the do's and dont's - Jasjit Chopra
I3 - Running SharePoint 2016 in Azure the do's and dont's - Jasjit ChopraI3 - Running SharePoint 2016 in Azure the do's and dont's - Jasjit Chopra
I3 - Running SharePoint 2016 in Azure the do's and dont's - Jasjit Chopra
SPS Paris
 
Best Oracle adf online training
Best Oracle adf online trainingBest Oracle adf online training
Best Oracle adf online training
Mindmajix Technologies
 
When Windows Apps meet SharePoint
When Windows Apps meet SharePointWhen Windows Apps meet SharePoint
When Windows Apps meet SharePoint
SPC Adriatics
 
Asp.Net MVC
Asp.Net MVCAsp.Net MVC
Asp.Net MVC
Sudheesh Valathil
 
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga
 
Do Logic Apps support error handling?
Do Logic Apps support error handling?Do Logic Apps support error handling?
Do Logic Apps support error handling?
BizTalk360
 
Database basics
Database basicsDatabase basics
Database basics
Program in Interdisciplinary Computing
 
Dotnet Online Training
Dotnet Online TrainingDotnet Online Training
Dotnet Online Training
Summa Mcclane
 
Dot Net Online training in uk and usa
Dot Net Online training in uk and usaDot Net Online training in uk and usa
Dot Net Online training in uk and usa
almaandrea
 
Single page application 07
Single page application   07Single page application   07
Single page application 07
Ismaeel Enjreny
 
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart FeenstraEntities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Triquanta
 
MongoDB
MongoDBMongoDB
MongoDB
Rony Gregory
 
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
Sonja Madsen
 
Client storage
Client storageClient storage
Client storage
Parashuram N
 
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (10 min. lightning talk)
Sirar Salih
 
seamless – Object Oriented CMS System
seamless – Object Oriented CMS Systemseamless – Object Oriented CMS System
seamless – Object Oriented CMS System
ESUG
 
Web storage
Web storageWeb storage
Web storage
Junji Manno
 
Icinga Camp Bangalore - Icinga and Icinga Director
Icinga Camp Bangalore - Icinga and Icinga Director Icinga Camp Bangalore - Icinga and Icinga Director
Icinga Camp Bangalore - Icinga and Icinga Director
Icinga
 
Search as main navigation
Search as main navigationSearch as main navigation
Search as main navigation
punkt.de GmbH
 
I3 - Running SharePoint 2016 in Azure the do's and dont's - Jasjit Chopra
I3 - Running SharePoint 2016 in Azure the do's and dont's - Jasjit ChopraI3 - Running SharePoint 2016 in Azure the do's and dont's - Jasjit Chopra
I3 - Running SharePoint 2016 in Azure the do's and dont's - Jasjit Chopra
SPS Paris
 
When Windows Apps meet SharePoint
When Windows Apps meet SharePointWhen Windows Apps meet SharePoint
When Windows Apps meet SharePoint
SPC Adriatics
 
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga
 
Do Logic Apps support error handling?
Do Logic Apps support error handling?Do Logic Apps support error handling?
Do Logic Apps support error handling?
BizTalk360
 
Dotnet Online Training
Dotnet Online TrainingDotnet Online Training
Dotnet Online Training
Summa Mcclane
 
Dot Net Online training in uk and usa
Dot Net Online training in uk and usaDot Net Online training in uk and usa
Dot Net Online training in uk and usa
almaandrea
 
Single page application 07
Single page application   07Single page application   07
Single page application 07
Ismaeel Enjreny
 
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart FeenstraEntities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Triquanta
 

Similar to Who's afraid of front end databases? (20)

Who's afraid of front end databases
Who's afraid of front end databasesWho's afraid of front end databases
Who's afraid of front end databases
Gil Fink
 
Whos afraid of front end databases?
Whos afraid of front end databases?Whos afraid of front end databases?
Whos afraid of front end databases?
Gil Fink
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
Pedro Morais
 
Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)
Mike West
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePoint
Mark Rackley
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
Christian Baranowski
 
Cubes – pluggable model explained
Cubes – pluggable model explainedCubes – pluggable model explained
Cubes – pluggable model explained
Stefan Urbanek
 
Fast Data Intelligence in the IoT - real-time data analytics with Spark
Fast Data Intelligence in the IoT - real-time data analytics with SparkFast Data Intelligence in the IoT - real-time data analytics with Spark
Fast Data Intelligence in the IoT - real-time data analytics with Spark
Bas Geerdink
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
Buildingsocialanalyticstoolwithmongodb
MongoDB APAC
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
Doris Chen
 
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide
Mark Rackley
 
Indexed db
Indexed dbIndexed db
Indexed db
Martin Giger
 
Brightstar DB
Brightstar DBBrightstar DB
Brightstar DB
Connected Data World
 
Webinar: Building Your First Application with MongoDB
Webinar: Building Your First Application with MongoDBWebinar: Building Your First Application with MongoDB
Webinar: Building Your First Application with MongoDB
MongoDB
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
 
In-browser storage and me
In-browser storage and meIn-browser storage and me
In-browser storage and me
Jason Casden
 
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
ICS User Group
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Jussi Pohjolainen
 
Examiness hints and tips from the trenches
Examiness hints and tips from the trenchesExaminess hints and tips from the trenches
Examiness hints and tips from the trenches
Ismail Mayat
 
Who's afraid of front end databases
Who's afraid of front end databasesWho's afraid of front end databases
Who's afraid of front end databases
Gil Fink
 
Whos afraid of front end databases?
Whos afraid of front end databases?Whos afraid of front end databases?
Whos afraid of front end databases?
Gil Fink
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
Pedro Morais
 
Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)
Mike West
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePoint
Mark Rackley
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
Christian Baranowski
 
Cubes – pluggable model explained
Cubes – pluggable model explainedCubes – pluggable model explained
Cubes – pluggable model explained
Stefan Urbanek
 
Fast Data Intelligence in the IoT - real-time data analytics with Spark
Fast Data Intelligence in the IoT - real-time data analytics with SparkFast Data Intelligence in the IoT - real-time data analytics with Spark
Fast Data Intelligence in the IoT - real-time data analytics with Spark
Bas Geerdink
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
Buildingsocialanalyticstoolwithmongodb
MongoDB APAC
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
Doris Chen
 
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide
Mark Rackley
 
Webinar: Building Your First Application with MongoDB
Webinar: Building Your First Application with MongoDBWebinar: Building Your First Application with MongoDB
Webinar: Building Your First Application with MongoDB
MongoDB
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
 
In-browser storage and me
In-browser storage and meIn-browser storage and me
In-browser storage and me
Jason Casden
 
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
ICS User Group
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Jussi Pohjolainen
 
Examiness hints and tips from the trenches
Examiness hints and tips from the trenchesExaminess hints and tips from the trenches
Examiness hints and tips from the trenches
Ismail Mayat
 
Ad

More from Gil Fink (20)

Becoming a Tech Speaker
Becoming a Tech SpeakerBecoming a Tech Speaker
Becoming a Tech Speaker
Gil Fink
 
Web animation on steroids web animation api
Web animation on steroids web animation api Web animation on steroids web animation api
Web animation on steroids web animation api
Gil Fink
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has Arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Stencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedStencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has Arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Being a tech speaker
Being a tech speakerBeing a tech speaker
Being a tech speaker
Gil Fink
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular Animations
Gil Fink
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
Gil Fink
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
Gil Fink
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type script
Gil Fink
 
End to-end apps with type script
End to-end apps with type scriptEnd to-end apps with type script
End to-end apps with type script
Gil Fink
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
Gil Fink
 
Web components
Web componentsWeb components
Web components
Gil Fink
 
Redux data flow with angular 2
Redux data flow with angular 2Redux data flow with angular 2
Redux data flow with angular 2
Gil Fink
 
Biological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSBiological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJS
Gil Fink
 
Biological modeling, powered by angular js
Biological modeling, powered by angular jsBiological modeling, powered by angular js
Biological modeling, powered by angular js
Gil Fink
 
Web components the future is here
Web components   the future is hereWeb components   the future is here
Web components the future is here
Gil Fink
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type script
Gil Fink
 
Becoming a Tech Speaker
Becoming a Tech SpeakerBecoming a Tech Speaker
Becoming a Tech Speaker
Gil Fink
 
Web animation on steroids web animation api
Web animation on steroids web animation api Web animation on steroids web animation api
Web animation on steroids web animation api
Gil Fink
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has Arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Stencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedStencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has Arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Being a tech speaker
Being a tech speakerBeing a tech speaker
Being a tech speaker
Gil Fink
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular Animations
Gil Fink
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
Gil Fink
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
Gil Fink
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type script
Gil Fink
 
End to-end apps with type script
End to-end apps with type scriptEnd to-end apps with type script
End to-end apps with type script
Gil Fink
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
Gil Fink
 
Web components
Web componentsWeb components
Web components
Gil Fink
 
Redux data flow with angular 2
Redux data flow with angular 2Redux data flow with angular 2
Redux data flow with angular 2
Gil Fink
 
Biological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSBiological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJS
Gil Fink
 
Biological modeling, powered by angular js
Biological modeling, powered by angular jsBiological modeling, powered by angular js
Biological modeling, powered by angular js
Gil Fink
 
Web components the future is here
Web components   the future is hereWeb components   the future is here
Web components the future is here
Gil Fink
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type script
Gil Fink
 
Ad

Recently uploaded (20)

Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 

Who's afraid of front end databases?

  • 2. WHO’S AFRAID OF FRONT- END DATABASES?
  • 7. WHO’S AFRAID OF FRONT- END DATABASES?
  • 8. About Me ‱ sparXys CEO and senior consultant ‱ Microsoft MVP in the last 8 years ‱ Pro Single Page Application Development (Apress) co-author ‱ 4 Microsoft Official Courses (MOCs) co-author ‱ GDG Rishon and AngularUP co-organizer
  • 9. Agenda ‱ The options ‱ IndexedDB ‱ Working with libraries
  • 10. Storing Data in The Browser ‱ Cookies ‱ Super small storage, string based, API not friendly ‱ Web Storage (localStorage / sessionStorage) ‱ String based dictionary, synchronous API ‱ Web SQL database ‱ Deprecated!
  • 11. Cookies Are such an old technology

  • 16. IndexedDB ‱ Advanced key-value data management IndexedDB Front-end App Fast Reliable Limited capacity Local access only Information loss
  • 17. IndexedDB Database objectStore Cursor on objectStore key : value key : value key : value Index Cursor on index
  • 18. IndexedDB API ‱ Very massive! ‱ Asynchronous ‱ Important note: synchronous APIs were deprecated by W3C ‱ Exposed through window.indexedDB object
  • 21. IndexedDB – Open the Database var db; var request = window.indexedDB.open(“dbName"); request.onerror = function(event) { 
 }; request.onsuccess = function(event) { db = request.result; };
  • 22. IndexedDB – Creating an objectStore var request = indexedDB.open(‘dbName’, 2); request.onupgradeneeded = function(event) { // Create an objectStore to hold information about customers. var objectStore = db.createObjectStore(“products", { keyPath: “id" }); // Create an index to search customers by name. objectStore.createIndex("name", "name", { unique: false }); };
  • 23. IndexedDB – Creating a Transaction var transaction = db.transaction([“products"], “readwrite”); transaction.oncomplete = function(event) { 
 }; transaction.onerror = function(event) { 
 }; // will add the object into the objectStore var objectStore = transaction.objectStore(“products”); var request = objectStore.add({ id: 7, name: “IndexedDB" }); request.onsuccess = function(event) { // event.target.result == object.id }
  • 24. IndexedDB – Using a Cursor var transaction = db.transaction([“products”]); var objectStore = transaction.objectStore(“products”); var cursor = objectStore.openCursor(); cursor.onsuccess = function(event) { var cursor = event.target.result; if (cursor) { 
 cursor.continue(); } else { console.log(“No entries”); } };
  • 25. IndexedDB – Working with Indexes var transaction = db.transaction([“products”]); var objectStore = transaction.objectStore(“products”); var index = objectStore.index(“name”); var request = index.get(“John"); request.onsuccess = function(event) { 
 };
  • 26. DEMO: LET’S CODE WITH INDEXEDDB
  • 27. IndexedDB Problems? ‱ Verbose syntax ‱ Too much boilerplate ‱ No support for queries style SQL ‱ No full text search ‱ And more
  • 28. Libraries to the Rescue ‱ Dixie.js - http://dexie.org/ ‱ localForage - https://github.com/localForage/localForage ‱ PouchDB - https://pouchdb.com/ ‱ Working with Angular? you are covered ‱ Angular 1 service - https://github.com/bramski/angular-indexedDB ‱ angular2-indexeddb service - https://github.com/gilf/angular2-indexeddb
  • 30. Where IndexedDB Shines? ‱ Data driven scenarios ‱ As a hybrid application database ‱ Combined with Service Workers ‱ Or for any offline scenarios
  • 31. Summary ‱ IndexedDB is a full blown database in your app’s front-end ‱ It can help you to persist your front-end data ‱ IndexedDB is suitable for offline scenarios
  • 32. Resources ‱ IndexedDB on MDN - http://mzl.la/1u1sngQ ‱ angular2-indexeddb - https://github.com/gilf/angular2-indexeddb ‱ My Website – http://www.gilfink.net ‱ Follow me on Twitter – @gilfink