SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
A client-side image uploader in
Ember.js
January 21st 2015
Demo
Traditional method: server-side
Client sends image to server as form payload
Server processes image, create multiple sizes
Server uploads all sizes to storage (S3 in our case)
High load on server
We found our servers are not great at resizing
images
Latency to upload an image was long
We used carrierwavegem, we were stuck with its
imposed way of working
Hard to provide responsive images
Decided we needed to optimize this
Switched to a client-side uploader:
Client does the processing and resizing
Client uploads directly to S3
Server is hardly involved
Fear that resizing would take too long on clients.
Not the case ( )Demo
What does client need?
File API: Firefox, Chrome, Safari, IE10+ ( )caniuse.com
Web Workers (optional): Firefox, Chrome, Safari, IE10+
( )caniuse.com
Models
App.ImageFile = DS.Model.extend({
/* Associations */
imageVersions: DS.hasMany('imageVersion'),
/* Attributes */
caption: DS.attr('string')
});
App.ImageVersion = DS.Model.extend({
/* Associations */
imageFile: DS.belongsTo('imageFile'),
/* Attributes */
width: DS.attr('number'),
height: DS.attr('number'),
url: DS.attr('string')
});
Component
{{image-uploader sizes=imageSizes imageUpdated="someActionOnController"}}
Input: sizes(array of { width: ..., height: ... }
objects)
Event: imageUpdated
Serving responsive images
Idea: serve images adapted to the screen size.
No point showing a 1920px image on smartphone
Look at your analytics for deciding which sizes to
serve
How does it work?
Each ImageFilehas multiple ImageVersions of different
sizes
After rendering, measure width and height of image container
Pick best ImageVersionaccording to this (first biggest
dimension)
Set imageFile.get('url')as srcattribute of the <img>
Advantages
Lower latency for the client
No heavy processing anymore for server
Much for flexible than a library like carrierwave
Possibility to adapt resizing algorithm according to
client
2500€ PC vs smartphone
Questions?

Más contenido relacionado

Similar a A client-side image uploader in Ember.js

DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
Yoav Avrahami
 
AWS Customer Presentation - family builder
AWS Customer Presentation -  family builderAWS Customer Presentation -  family builder
AWS Customer Presentation - family builder
Amazon Web Services
 
Python Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - Appengine
Python Ireland
 
Scaling digital asset repositories with aem dam and s7 by Devang Shah
Scaling digital asset repositories with aem dam and s7 by Devang ShahScaling digital asset repositories with aem dam and s7 by Devang Shah
Scaling digital asset repositories with aem dam and s7 by Devang Shah
AEM HUB
 
Dreamwares Corporate Presentation
Dreamwares Corporate PresentationDreamwares Corporate Presentation
Dreamwares Corporate Presentation
Sarang Jiwane
 

Similar a A client-side image uploader in Ember.js (20)

Building and scaling a B2D service, the bootstrap way
Building and scaling a B2D service, the bootstrap wayBuilding and scaling a B2D service, the bootstrap way
Building and scaling a B2D service, the bootstrap way
 
Images blast off at the speed of Jamstack! - Alba Silvente Fuentes
Images blast off at the speed of Jamstack! - Alba Silvente FuentesImages blast off at the speed of Jamstack! - Alba Silvente Fuentes
Images blast off at the speed of Jamstack! - Alba Silvente Fuentes
 
Dealing with Enterprise Level Data
Dealing with Enterprise Level DataDealing with Enterprise Level Data
Dealing with Enterprise Level Data
 
Optimize Images for SEO WordCamp Sacramento
Optimize Images for SEO WordCamp SacramentoOptimize Images for SEO WordCamp Sacramento
Optimize Images for SEO WordCamp Sacramento
 
Duda’s CWV Process & Fixes | DudaCon
Duda’s CWV Process & Fixes | DudaConDuda’s CWV Process & Fixes | DudaCon
Duda’s CWV Process & Fixes | DudaCon
 
Delivering Optimal Images for Phones and Tablets on the Modern Web
Delivering Optimal Images for Phones and Tablets on the Modern WebDelivering Optimal Images for Phones and Tablets on the Modern Web
Delivering Optimal Images for Phones and Tablets on the Modern Web
 
Wordpress site scaling architecture on cloud infrastructure with AWS
Wordpress site scaling architecture on cloud infrastructure with AWSWordpress site scaling architecture on cloud infrastructure with AWS
Wordpress site scaling architecture on cloud infrastructure with AWS
 
AWS Customer Presentation - Conde Nast
AWS Customer Presentation - Conde NastAWS Customer Presentation - Conde Nast
AWS Customer Presentation - Conde Nast
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
 
Take a load off! Load testing your Oracle APEX or JDeveloper web applications
Take a load off! Load testing your Oracle APEX or JDeveloper web applicationsTake a load off! Load testing your Oracle APEX or JDeveloper web applications
Take a load off! Load testing your Oracle APEX or JDeveloper web applications
 
imgproxy is amazing
imgproxy is amazingimgproxy is amazing
imgproxy is amazing
 
7 Use Cases in 7 Minutes Each : The Power of Workflows and Automation (SVC101...
7 Use Cases in 7 Minutes Each : The Power of Workflows and Automation (SVC101...7 Use Cases in 7 Minutes Each : The Power of Workflows and Automation (SVC101...
7 Use Cases in 7 Minutes Each : The Power of Workflows and Automation (SVC101...
 
AWS Customer Presentation - family builder
AWS Customer Presentation -  family builderAWS Customer Presentation -  family builder
AWS Customer Presentation - family builder
 
CON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWSCON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWS
 
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
Build an AppStream 2.0 Environment to Deliver Desktop Applications to Any Com...
 
Python Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - Appengine
 
IDC - CS for real - responsive images
IDC - CS for real - responsive imagesIDC - CS for real - responsive images
IDC - CS for real - responsive images
 
SMX Milan - Supercharge Responsive Design | Idea Evolver
SMX Milan - Supercharge Responsive Design | Idea EvolverSMX Milan - Supercharge Responsive Design | Idea Evolver
SMX Milan - Supercharge Responsive Design | Idea Evolver
 
Scaling digital asset repositories with aem dam and s7 by Devang Shah
Scaling digital asset repositories with aem dam and s7 by Devang ShahScaling digital asset repositories with aem dam and s7 by Devang Shah
Scaling digital asset repositories with aem dam and s7 by Devang Shah
 
Dreamwares Corporate Presentation
Dreamwares Corporate PresentationDreamwares Corporate Presentation
Dreamwares Corporate Presentation
 

Más de yoranbe (6)

Test with YouTube
Test with YouTubeTest with YouTube
Test with YouTube
 
Changes in Ember.js 1.9 and the Road to Ember.js 2.0
Changes in Ember.js 1.9 and the Road to Ember.js 2.0Changes in Ember.js 1.9 and the Road to Ember.js 2.0
Changes in Ember.js 1.9 and the Road to Ember.js 2.0
 
REST APIs in the context of single-page applications
REST APIs in the context of single-page applicationsREST APIs in the context of single-page applications
REST APIs in the context of single-page applications
 
Ember Data and JSON API
Ember Data and JSON APIEmber Data and JSON API
Ember Data and JSON API
 
From Ember.js 1.5 to 1.7
From Ember.js 1.5 to 1.7From Ember.js 1.5 to 1.7
From Ember.js 1.5 to 1.7
 
Ember.js Brussels Meetup #3 - Testing your Ember.js app
Ember.js Brussels Meetup #3 - Testing your Ember.js appEmber.js Brussels Meetup #3 - Testing your Ember.js app
Ember.js Brussels Meetup #3 - Testing your Ember.js app
 

Último

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
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
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
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 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
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
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
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...
 
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
 
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 🔝✔️✔️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

A client-side image uploader in Ember.js