SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
JSONH
An story in mobile API optimisation & how to get data
stuff faster.
Tuesday, 1 April 14
Tuesday, 1 April 14
Back in the day when I could barely pronounce API and for me,
JavaScript was some esoteric magic that induced pain and wonder.
Tuesday, 1 April 14
Mobile phones were unwieldy bricks of plastic and metal with huge antennas and then hefty
charge
W.A.P was the new kid on the block and I had to print out yet another manual to accompany my
hefty collection of mySQL 3.x and HTML / HTTP specs
I can remember that it filled me with hope & excitement period and helped cross the bridge
between our flashy web bracket plan intended bracket and these always connected devices with
screens the size of stamps
Tuesday, 1 April 14
Actually taking to where what's the point of this well today, you see, we have a
super bit, quadruple powered Infinity Gauntlet charged broadband speeds...
It's made us a little lazy KiloBytes?... pah! Peanuts four our broadband connected
society…
Tuesday, 1 April 14
But then came the iPhone followed by nestle droid sorry android and the rabbit holes
appeared we developers dived in red pill please and our complacency led us to grow home
bellies
Not really but my point is this to be really care or understand how user base not only in the
first I know we do so how can we improve our code designs technical debt and get out of a
lazy programming interface frame of mind
Cost of an API call
Tuesday, 1 April 14
I was looking for only that I wanted to increase performance speed
reducing packet size & cost of an API call. Specifically for a mobile
project talking to a node.ACS service interacting with one or more APIs
Mobile API query
TELCO WIFI
MIDDLEWARE SERVER
DATA BACKBONE
API PROVIDER DATA SOURCE
Cost of an
HTTP
REQUEST...
Tuesday, 1 April 14
EXPLAIN DIAGRAM & MULTIPLE REQUESTS
JSONH
JSON compression search
CJSON & JSON w HPack (now JSONH)
JSONH for Homogenous Collections
http://web-resource-optimization.blogspot.co.uk/2011/06/json-
compression-algorithms.html
A collection of objects with the same dynamic type. Arrays are the
most common homogeneous collection objects.
David J. Barnes
Tuesday, 1 April 14
Compression Comparison
JSONH looked best.
Tuesday, 1 April 14
Setting Up - 1
GET JSONH library
GET JSONminify (optional to strip whitespace/
comments)
Add both libraries into your project.
Add to Node.ACS & into your Ti project
Tuesday, 1 April 14
Setting Up - 2
Include the libs into your
Node.ACS/Ti App / Server
Minify & pack the data
Return string
var jsonminify = require("jsonminify");
var JSONH = require('jsonh');
! ! var resString = _minifyJS(data);
! ! resString.Contents = JSONH.pack(resString.Contents);
! ! return (JSON.stringify(resString));
Tuesday, 1 April 14
Setting Up - 3
decompress collection in
app
! function callback(e) {
! ! Ti.API.log('mobile request callback');
! ! var rJson = JSON.parse(e);
! ! // get return data and parse then unpack the JSON.
! ! rJson.Contents = JSONH.unpack(rJson.Contents);
! ! return rJson;
! }
Tuesday, 1 April 14
ACS/AWS
3rd Party
Service API Method
Stringify Reponse
Minify Reponse
pack JSONH
homogenous
collection node
Mobile Function
requires Data/ API
Call
Q
Q
Q
Parse responseText if
required
UNPACK JSONH
homogenous
collection node
API: XHR callback
API: XHR
HTTPRequest
Node.ACS
Service API Method
JSON
D
Q Decision based on query parameters
D Data response from HTTPClient
API: callback
API:
HTTPRequest
JSON / (string/min)ified
D
Mobile
JSON Compression: HPACK
using jsonh.js
Mobile > Node.ACS > ACS > Mobile
Ketan Majmudar
Tuesday, 1 April 14

Mais conteúdo relacionado

Semelhante a JSONH & Mobile APIs

Apachecon 2011 stanbol_ogrisel
Apachecon 2011 stanbol_ogriselApachecon 2011 stanbol_ogrisel
Apachecon 2011 stanbol_ogriselNuxeo
 
NPR - NewMediaDays2010 - Flexible Content
NPR - NewMediaDays2010 - Flexible ContentNPR - NewMediaDays2010 - Flexible Content
NPR - NewMediaDays2010 - Flexible Contentzachbrand
 
Apache Stanbol 
and the Web of Data - ApacheCon 2011
Apache Stanbol 
and the Web of Data - ApacheCon 2011Apache Stanbol 
and the Web of Data - ApacheCon 2011
Apache Stanbol 
and the Web of Data - ApacheCon 2011Nuxeo
 
Introducing Riak and Ripple
Introducing Riak and RippleIntroducing Riak and Ripple
Introducing Riak and RippleSean Cribbs
 
W2E NY 2010 NPR Everywhere
W2E NY 2010 NPR EverywhereW2E NY 2010 NPR Everywhere
W2E NY 2010 NPR Everywherezachbrand
 
Ebook undisturbed rest-v1 [res_tful apis]
Ebook undisturbed rest-v1 [res_tful apis]Ebook undisturbed rest-v1 [res_tful apis]
Ebook undisturbed rest-v1 [res_tful apis]johnkbutcher
 
Linked data driven EPCIS Event-based Traceability across Supply chain busine...
Linked data driven EPCIS Event-based Traceability across  Supply chain busine...Linked data driven EPCIS Event-based Traceability across  Supply chain busine...
Linked data driven EPCIS Event-based Traceability across Supply chain busine...Monika Solanki
 
Mashups and data portals where next? (spatial@gov)
Mashups and data portals where next? (spatial@gov)Mashups and data portals where next? (spatial@gov)
Mashups and data portals where next? (spatial@gov)josediacono
 
Open Annotation Collaboration Briefing
Open Annotation Collaboration BriefingOpen Annotation Collaboration Briefing
Open Annotation Collaboration BriefingTimothy Cole
 
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Boris Mann
 
Web2expo 2011u
Web2expo 2011uWeb2expo 2011u
Web2expo 2011uzachbrand
 
OpenData, Web Semântica e afins.
OpenData, Web Semântica e afins.OpenData, Web Semântica e afins.
OpenData, Web Semântica e afins.Alexandre Gomes
 
One Page, One App -or- How to Write a Crawlable Single Page Web App
One Page, One App -or- How to Write a Crawlable Single Page Web AppOne Page, One App -or- How to Write a Crawlable Single Page Web App
One Page, One App -or- How to Write a Crawlable Single Page Web Apptechnicolorenvy
 
Hadoop webinar-130808141030-phpapp01
Hadoop webinar-130808141030-phpapp01Hadoop webinar-130808141030-phpapp01
Hadoop webinar-130808141030-phpapp01Kaushik Dey
 
Hateoas APIs are about relationships
Hateoas APIs are about relationshipsHateoas APIs are about relationships
Hateoas APIs are about relationshipsMatt Bishop
 
NPR API: Create Once Publish Everywhere
NPR API: Create Once Publish EverywhereNPR API: Create Once Publish Everywhere
NPR API: Create Once Publish Everywherezachbrand
 
Shifting from a newspapermindset to an information perspective
Shifting from a newspapermindset to an information perspectiveShifting from a newspapermindset to an information perspective
Shifting from a newspapermindset to an information perspectiveWAN-IFRA
 

Semelhante a JSONH & Mobile APIs (20)

Apachecon 2011 stanbol_ogrisel
Apachecon 2011 stanbol_ogriselApachecon 2011 stanbol_ogrisel
Apachecon 2011 stanbol_ogrisel
 
NPR - NewMediaDays2010 - Flexible Content
NPR - NewMediaDays2010 - Flexible ContentNPR - NewMediaDays2010 - Flexible Content
NPR - NewMediaDays2010 - Flexible Content
 
Apache Stanbol 
and the Web of Data - ApacheCon 2011
Apache Stanbol 
and the Web of Data - ApacheCon 2011Apache Stanbol 
and the Web of Data - ApacheCon 2011
Apache Stanbol 
and the Web of Data - ApacheCon 2011
 
Introducing Riak and Ripple
Introducing Riak and RippleIntroducing Riak and Ripple
Introducing Riak and Ripple
 
W2E NY 2010 NPR Everywhere
W2E NY 2010 NPR EverywhereW2E NY 2010 NPR Everywhere
W2E NY 2010 NPR Everywhere
 
Ebook undisturbed rest-v1 [res_tful apis]
Ebook undisturbed rest-v1 [res_tful apis]Ebook undisturbed rest-v1 [res_tful apis]
Ebook undisturbed rest-v1 [res_tful apis]
 
Linked data driven EPCIS Event-based Traceability across Supply chain busine...
Linked data driven EPCIS Event-based Traceability across  Supply chain busine...Linked data driven EPCIS Event-based Traceability across  Supply chain busine...
Linked data driven EPCIS Event-based Traceability across Supply chain busine...
 
Mashups and data portals where next? (spatial@gov)
Mashups and data portals where next? (spatial@gov)Mashups and data portals where next? (spatial@gov)
Mashups and data portals where next? (spatial@gov)
 
Open Annotation Collaboration Briefing
Open Annotation Collaboration BriefingOpen Annotation Collaboration Briefing
Open Annotation Collaboration Briefing
 
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
 
Web2expo 2011u
Web2expo 2011uWeb2expo 2011u
Web2expo 2011u
 
OpenData, Web Semântica e afins.
OpenData, Web Semântica e afins.OpenData, Web Semântica e afins.
OpenData, Web Semântica e afins.
 
Introducing Placemaker
Introducing PlacemakerIntroducing Placemaker
Introducing Placemaker
 
20100714accel
20100714accel20100714accel
20100714accel
 
One Page, One App -or- How to Write a Crawlable Single Page Web App
One Page, One App -or- How to Write a Crawlable Single Page Web AppOne Page, One App -or- How to Write a Crawlable Single Page Web App
One Page, One App -or- How to Write a Crawlable Single Page Web App
 
Hadoop webinar-130808141030-phpapp01
Hadoop webinar-130808141030-phpapp01Hadoop webinar-130808141030-phpapp01
Hadoop webinar-130808141030-phpapp01
 
Hateoas APIs are about relationships
Hateoas APIs are about relationshipsHateoas APIs are about relationships
Hateoas APIs are about relationships
 
2010 Sopac Cosugi
2010 Sopac Cosugi2010 Sopac Cosugi
2010 Sopac Cosugi
 
NPR API: Create Once Publish Everywhere
NPR API: Create Once Publish EverywhereNPR API: Create Once Publish Everywhere
NPR API: Create Once Publish Everywhere
 
Shifting from a newspapermindset to an information perspective
Shifting from a newspapermindset to an information perspectiveShifting from a newspapermindset to an information perspective
Shifting from a newspapermindset to an information perspective
 

Mais de Ket Majmudar

Ti.connect Awesome UX/UI Strategy with T-10
Ti.connect  Awesome UX/UI Strategy with T-10 Ti.connect  Awesome UX/UI Strategy with T-10
Ti.connect Awesome UX/UI Strategy with T-10 Ket Majmudar
 
T-10 Presentation TiConf EU
T-10 Presentation TiConf EU T-10 Presentation TiConf EU
T-10 Presentation TiConf EU Ket Majmudar
 
T-10 Session at Over The Air 2013
T-10 Session at Over The Air 2013T-10 Session at Over The Air 2013
T-10 Session at Over The Air 2013Ket Majmudar
 
Titanium London - URLs & Alloy vs CommonJS
Titanium London - URLs & Alloy vs CommonJSTitanium London - URLs & Alloy vs CommonJS
Titanium London - URLs & Alloy vs CommonJSKet Majmudar
 
T-10 International Space Apps Challenge Presentation in London 2013
T-10 International Space Apps Challenge Presentation in London 2013T-10 International Space Apps Challenge Presentation in London 2013
T-10 International Space Apps Challenge Presentation in London 2013Ket Majmudar
 
London Titanium July 2012 Intro
London Titanium July 2012 IntroLondon Titanium July 2012 Intro
London Titanium July 2012 IntroKet Majmudar
 
London Titanium July 2012 Intro
London Titanium July 2012 IntroLondon Titanium July 2012 Intro
London Titanium July 2012 IntroKet Majmudar
 
SQLite - Dynamic Data in Titanium
SQLite - Dynamic Data in TitaniumSQLite - Dynamic Data in Titanium
SQLite - Dynamic Data in TitaniumKet Majmudar
 
Kitchen Sink to App
Kitchen Sink to AppKitchen Sink to App
Kitchen Sink to AppKet Majmudar
 
Getting Started with Titanium Studio
Getting Started with Titanium StudioGetting Started with Titanium Studio
Getting Started with Titanium StudioKet Majmudar
 
Titanium London - Going Social - June 2011
Titanium London - Going Social - June 2011Titanium London - Going Social - June 2011
Titanium London - Going Social - June 2011Ket Majmudar
 
How to build your own 3D Digital Camera rig
How to build your own 3D Digital Camera rig How to build your own 3D Digital Camera rig
How to build your own 3D Digital Camera rig Ket Majmudar
 

Mais de Ket Majmudar (13)

Ti.connect Awesome UX/UI Strategy with T-10
Ti.connect  Awesome UX/UI Strategy with T-10 Ti.connect  Awesome UX/UI Strategy with T-10
Ti.connect Awesome UX/UI Strategy with T-10
 
T-10 Presentation TiConf EU
T-10 Presentation TiConf EU T-10 Presentation TiConf EU
T-10 Presentation TiConf EU
 
T-10 Session at Over The Air 2013
T-10 Session at Over The Air 2013T-10 Session at Over The Air 2013
T-10 Session at Over The Air 2013
 
Titanium London - URLs & Alloy vs CommonJS
Titanium London - URLs & Alloy vs CommonJSTitanium London - URLs & Alloy vs CommonJS
Titanium London - URLs & Alloy vs CommonJS
 
T-10 International Space Apps Challenge Presentation in London 2013
T-10 International Space Apps Challenge Presentation in London 2013T-10 International Space Apps Challenge Presentation in London 2013
T-10 International Space Apps Challenge Presentation in London 2013
 
London Titanium July 2012 Intro
London Titanium July 2012 IntroLondon Titanium July 2012 Intro
London Titanium July 2012 Intro
 
London Titanium July 2012 Intro
London Titanium July 2012 IntroLondon Titanium July 2012 Intro
London Titanium July 2012 Intro
 
SQLite - Dynamic Data in Titanium
SQLite - Dynamic Data in TitaniumSQLite - Dynamic Data in Titanium
SQLite - Dynamic Data in Titanium
 
Titanium setup
Titanium setupTitanium setup
Titanium setup
 
Kitchen Sink to App
Kitchen Sink to AppKitchen Sink to App
Kitchen Sink to App
 
Getting Started with Titanium Studio
Getting Started with Titanium StudioGetting Started with Titanium Studio
Getting Started with Titanium Studio
 
Titanium London - Going Social - June 2011
Titanium London - Going Social - June 2011Titanium London - Going Social - June 2011
Titanium London - Going Social - June 2011
 
How to build your own 3D Digital Camera rig
How to build your own 3D Digital Camera rig How to build your own 3D Digital Camera rig
How to build your own 3D Digital Camera rig
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 

Último (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

JSONH & Mobile APIs

  • 1. JSONH An story in mobile API optimisation & how to get data stuff faster. Tuesday, 1 April 14
  • 2. Tuesday, 1 April 14 Back in the day when I could barely pronounce API and for me, JavaScript was some esoteric magic that induced pain and wonder.
  • 3. Tuesday, 1 April 14 Mobile phones were unwieldy bricks of plastic and metal with huge antennas and then hefty charge W.A.P was the new kid on the block and I had to print out yet another manual to accompany my hefty collection of mySQL 3.x and HTML / HTTP specs I can remember that it filled me with hope & excitement period and helped cross the bridge between our flashy web bracket plan intended bracket and these always connected devices with screens the size of stamps
  • 4. Tuesday, 1 April 14 Actually taking to where what's the point of this well today, you see, we have a super bit, quadruple powered Infinity Gauntlet charged broadband speeds... It's made us a little lazy KiloBytes?... pah! Peanuts four our broadband connected society…
  • 5. Tuesday, 1 April 14 But then came the iPhone followed by nestle droid sorry android and the rabbit holes appeared we developers dived in red pill please and our complacency led us to grow home bellies Not really but my point is this to be really care or understand how user base not only in the first I know we do so how can we improve our code designs technical debt and get out of a lazy programming interface frame of mind
  • 6. Cost of an API call Tuesday, 1 April 14 I was looking for only that I wanted to increase performance speed reducing packet size & cost of an API call. Specifically for a mobile project talking to a node.ACS service interacting with one or more APIs
  • 7. Mobile API query TELCO WIFI MIDDLEWARE SERVER DATA BACKBONE API PROVIDER DATA SOURCE Cost of an HTTP REQUEST... Tuesday, 1 April 14 EXPLAIN DIAGRAM & MULTIPLE REQUESTS
  • 8. JSONH JSON compression search CJSON & JSON w HPack (now JSONH) JSONH for Homogenous Collections http://web-resource-optimization.blogspot.co.uk/2011/06/json- compression-algorithms.html A collection of objects with the same dynamic type. Arrays are the most common homogeneous collection objects. David J. Barnes Tuesday, 1 April 14
  • 9. Compression Comparison JSONH looked best. Tuesday, 1 April 14
  • 10. Setting Up - 1 GET JSONH library GET JSONminify (optional to strip whitespace/ comments) Add both libraries into your project. Add to Node.ACS & into your Ti project Tuesday, 1 April 14
  • 11. Setting Up - 2 Include the libs into your Node.ACS/Ti App / Server Minify & pack the data Return string var jsonminify = require("jsonminify"); var JSONH = require('jsonh'); ! ! var resString = _minifyJS(data); ! ! resString.Contents = JSONH.pack(resString.Contents); ! ! return (JSON.stringify(resString)); Tuesday, 1 April 14
  • 12. Setting Up - 3 decompress collection in app ! function callback(e) { ! ! Ti.API.log('mobile request callback'); ! ! var rJson = JSON.parse(e); ! ! // get return data and parse then unpack the JSON. ! ! rJson.Contents = JSONH.unpack(rJson.Contents); ! ! return rJson; ! } Tuesday, 1 April 14
  • 13. ACS/AWS 3rd Party Service API Method Stringify Reponse Minify Reponse pack JSONH homogenous collection node Mobile Function requires Data/ API Call Q Q Q Parse responseText if required UNPACK JSONH homogenous collection node API: XHR callback API: XHR HTTPRequest Node.ACS Service API Method JSON D Q Decision based on query parameters D Data response from HTTPClient API: callback API: HTTPRequest JSON / (string/min)ified D Mobile JSON Compression: HPACK using jsonh.js Mobile > Node.ACS > ACS > Mobile Ketan Majmudar Tuesday, 1 April 14