Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Data: online and off
Search
Phil Nash
September 21, 2015
Programming
0
150
Data: online and off
Phil Nash
September 21, 2015
Tweet
Share
More Decks by Phil Nash
See All by Phil Nash
Four steps from JavaScript to TypeScript
philnash
3
310
JavaScript Apps Go Intl - GIDS Live 2021
philnash
2
170
You're on Mute! WebRTC and our Lives on Screen - GIDS Live 2021
philnash
1
190
Better API DX with a CLI - APIdays Jakarta
philnash
0
280
The trouble with webhooks - at Apidays Live Hong Kong
philnash
2
140
Four steps from JavaScript to TypeScript
philnash
0
330
Fantastic passwords and where to find them - at NoRuKo
philnash
36
2.5k
The trouble with webhooks - at APIdays Singapore
philnash
0
220
What's going on with Project Fugu? at DevTalks Reimagined
philnash
0
310
Other Decks in Programming
See All in Programming
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
250
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
6
880
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
200
新宿ダンジョンを可視化してみた
satoshi7190
2
210
Hanami and htmx
bkuhlmann
0
200
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
360
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
22
15k
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
220
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
130
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
640
Code Reviews
bkuhlmann
4
890
Featured
See All Featured
Writing Fast Ruby
sferik
620
60k
Ruby is Unlike a Banana
tanoku
96
10k
What the flash - Photography Introduction
edds
64
11k
Statistics for Hackers
jakevdp
789
220k
The Pragmatic Product Professional
lauravandoore
24
5.8k
The Power of CSS Pseudo Elements
geoffreycrofte
59
5k
A Tale of Four Properties
chriscoyier
150
22k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Scaling GitHub
holman
457
140k
Product Roadmaps are Hard
iamctodd
43
9.7k
jQuery: Nuts, Bolts and Bling
dougneiner
59
7.1k
Rails Girls Zürich Keynote
gr2m
91
13k
Transcript
DATA: ONLINE AND OFF
Phil Nash @philnash http:/ /philna.sh
[email protected]
DATA: ONLINE AND OFF
OFFLINE FIRST
Offline first An application that treats the network as an
enhancement
Not offline first • Graceful failure to network requests •
Just saving data client side
None
None
THINGS TO CONSIDER
ASSETS
SERVICE WORKER
None
USER DATA
None
DATA: ONLINE AND OFF
Data: online and off • Traditional application data storage •
Traditional vs offline first • Browser based data storage • Offline first and data
TRADITIONAL APPLICATION DATA STORAGE
GET / POST
Traditional application data storage 1. POST data to a server
2. Server stores data in a database 1. GET request for data 2. Server interprets request and delivers
OFFLINE?
TRADITIONAL VS OFFLINE FIRST
INTERACT LOCALLY
Interact locally • Save data locally • Retrieve data from
local cache
Interact locally • Crazy fast! • The network doesn't matter
THEN SYNC
Sync • People have multiple devices • Good as a
backup
Sync • Can be asychronous • Can be intentional •
Requires network
DATA STORAGE IN THE FRONT END
LOCALSTORAGE
LocalStorage • Simple key value store • Synchronous (slow)
WEBSQL
WEBSQL
INDEXEDDB
IndexedDB • Asynchronous • o_O
MAKING DATA OFFLINE FIRST
Making data offline first We need something that is: •
Easily distributed • Eventually consistent • Resolves conflicts • Web friendly
None
CouchDB Apache CouchDB™ is a database that uses JSON for
documents, JavaScript for MapReduce indexes, and regular HTTP for its API
None
PouchDB • CouchDB for the browser/Node • Wraps IndexedDB or
WebSQL • LocalStorage adapter available as a plugin
DEMO
Offline first • The time for offline first is now
• Distributing data like this requires a change of mindset • Not all application data needs to be stored this way
Help me! On a scale of 0 to 10, how
likely is it that you would recommend this talk to a friend or colleague? 0203 322 5761
Thanks! @philnash http:/ /philna.sh
[email protected]
On a scale of 0
to 10, how likely is it that you would recommend this talk to a friend or colleague? 0203 322 5761