studiomagnolia.comCesare Rocchi
Choosing a backend for your mobile application
_funkyboy
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Outline•Needs when choosing a backend
• Features
•Overview of different approaches
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Who am I?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
UX designer and developer
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
mnml
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
< is >
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
execution matters
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
lean approach
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Who are you?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Quick version
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
It’s complicated
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Thank you!
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
•twitter.com/_funkyboy
•app.net/funkyboy
•http://studiomagnolia.com
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
App Target•Not apps where mobile is “just a view”
•Apps which are inherently mobile
•Personal usage
•Backup or synchronization
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Examples
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
dayoneapp.com
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
culturedcode.com/things
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
iawriter.com
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Questions
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Have I to manage it?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Have I to manage it?•At which level?
•Am I able to do it?
•Have I time to learn?
• Is it worth it?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
What’s the synch model?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
What’s the synch model?•Does it match my goals?
•Can I change it if needed?
•What about protocols?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Have I to pay?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Have I to pay?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Who is to pay?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Impact on UX?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Impact on UX?•Does it break any flow?
•How frequently?
• is it “ok” with that?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Security?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Security?•How data are transferred?
• Is encryption implemented?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Options• iCloud
•Dropbox
•Parse & co.
•Custom
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
What is iCloud?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
6028 Startown Rd, Maiden, NC
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Stores and synchs stuff
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
It just works ...
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
... when it works.
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
seamlessness can be a limit
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Questions•Have I to manage it?
•What’s the synch model?
•Who’s to pay?
• Impact on UX?
• Security?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Have I to manage it?• Learn the API
•Apple takes care of
• installation
• scalability
• security
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
What’s the synch model?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Daemon•Monitors changes
•Works on metadata
• Shreds files
• Supports conflict resolution
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Special folder, synched
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Synched when “appropriate”
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Appropriate•Which OS?
•Which connection?
•Battery status?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Types of Information•Key-value
•Documents
•CoreData
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Who’s to pay?•The final user
•Your app will use his quota
•5Gb for free
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Impact on UX?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Impact on UX?•User expectation
•No control on upload
• “Why isn’t there?”
•Open the app to synch
•User turns off iCloud?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Security
http://support.apple.com/kb/HT4865?viewlocale=en_US&locale=en_US
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Security•Using the same API
•Mostly safe
•But ...
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Security•Using the same API
•Mostly safe
•But ...
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Notes•> iOS5 “Documents” folder is backed up
•You can prevent files from being backed up
•App might be rejected
https://developer.apple.com/library/ios/#qa/qa1719/_index.html
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Dropbox
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Dropbox• File-based
• Special folder
• Synchronized across devices
• Supports other platforms
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Have I to manage it?•Already set up
• installation
•bandwidth
• scalability
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
What’s the synch model?•Desktop synchronizes continuously
•Mobile apps have to query the backend
•HTTP API
• SDKs for iOS, Android, Ruby, Python
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
What’s the synch model?•No conflict resolution (revision #)
•Data serialization is up to you
•No file shredding
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Who’s to pay?•The final user
•Your app will use his disk quota
•2 Gb for free
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Impact on UX?•Authentication the first time
•User might modify files
•Control on the upload
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Security
https://www.dropbox.com/help/27/en
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Security•Https required
•3rd party apps are “sandboxed”
•Apps are reviewed
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Similar•box.net
• sugarsync.com
•google drive
• amazon S3
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Parse
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Parse•Backend for mobile apps
• Files, key-value
•API for iOS, Android, Javascript and REST
•Push notifications
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Parse•User management
• account creation/verification
• Login with Twitter/Facebook
•ACL
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Have I to manage it?• Just learn the API
•Parse takes care of
• Installation
•Bandwidth
• Scalability
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
What’s the synch model?•ORM approach on steroids
•No need to serialize/deserialize
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
steroids?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
PFObject *note = [PFObject objectWithClassName:@"Note"];
[note setObject:@"Ciao" forKey:@"title"];
[note setObject:@"Note on Parse" forKey:@"content"];
[note save];
//[note saveInBackground];//[note saveInBackgroundWithBlock:^( ){ }];//[note saveEventually]; <- steroids
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
PFObject *note = [PFObject objectWithClassName:@"Note"];
[note setObject:@"Ciao" forKey:@"title"];
[note setObject:@"Note on parse" forKey:@"content"];
PFObject *myTag = [PFObject objectWithClassName:@"Tag"];
[myTag setObject:@"important" forKey:@"tagName"];
// Add a relation[note setObject:myTag forKey:@"tag"];
// Saves both[note saveInBackground];
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Who’s to pay?•You
•Pay as you use
• Limit of calls/mo
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Who’s to pay?•You
•Pay as you use
• Limit of calls/mo
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Security•Uses SSL to transmit
•ACL is up to you
•DBs are snapshotted every 30min
•You own data
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Similar services• cloudmine.me
• stackmob.com
•kinvey.com
•buddy.com
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Custom
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
IaaS PaaS SaaS
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
•Data
•Application
•Runtime
•Middleware
•OS
•Data
•Application
IaaS PaaS SaaS
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
•Data
•Application
IaaS PaaS SaaS•Data
•Application
•Runtime
•Middleware
•OS
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
•Data
•Application
IaaS PaaS•Data
•Application
•Runtime
•Middleware
•OS
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
•Data
•Application
PaaS
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
PaaS Questions•Which language?
•Which DB?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Heroku
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Languages•Ruby
•Python
• Java
• Scala
•Closure
•Node.js
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
DBs•Postgres
•MySQL (via addon)
•MongoDB (via addon)
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Dyno• Essentially a process
•Web
•Worker
•# of dynos + db profile + addons = backend cost
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
•OS
•Middleware
•Runtime
•Data
•Application
•Data
•Application
IaaS PaaS
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
•OS
•Middleware
•Runtime
•Data
•Application
IaaS
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Questions•Which OS?
•Which language?
•Which DB?
•How many machines?
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Amazon Web Services
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Amazon Web Services•CDN
• Storage
•Networking
•DBs
• Services: email, queue managers
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Good old way•Buy a server
•pick the hardware
• install OS
• rent space/bandwidth in a farm
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Server side frameworks
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Ruby•http://rubyonrails.org
•http://www.sinatrarb.com
•http://www.padrinorb.com
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Python•https://www.djangoproject.com
•http://www.pylonsproject.org
•http://flask.pocoo.org
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Node.js•http://expressjs.com
•http://geddyjs.org
•http://flatironjs.org
•http://railwayjs.com
•http://towerjs.org
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
ORM•ActiveRecord
•DataMapper
• Sequel
• SQLAlchemy
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Client side frameworks
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Networking•AFNetworking
•MKNetworkKit
•RestKit
•DataKit
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
To have a cake ...
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Use a box mix•Choose between flavors
•Add basic ingredients
•Bake
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Do it from scratch•Choose all the elements
•Preparation
•Bake
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
In conclusion ...
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
“You can’t always get what you wantbut if you try sometime, you just might find ...”
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
Rolling Stones
“You can’t always get what you wantbut if you try sometime, you just might find ...”
Tuesday, September 11, 12
SWIPE CONFERENCE 2012
•twitter.com/_funkyboy
•app.net/funkyboy
•http://studiomagnolia.com
•http://www.icloudfordevelopers.com
Tuesday, September 11, 12