Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Choosing a backend for your mobile app

Cesare Rocchi
September 06, 2012

Choosing a backend for your mobile app

Choosing a backend for your mobile app
Swipe conference 2012

Although usually not noticed by the final users, the backend is a very important piece in the context of a mobile application. It is the place where data are stored and organized.

A few years ago building a back-end meant renting some hardware or virtual machine, setting up the operative system, configuring the server, database, storage and writing the back-end logic. In case the app had success, you had also to take care of scaling. While this is still possible, nowadays great services that allow to quickly setup a back-end are growing and spreading.

In this talk I will provide an overview of the services which allow developers to integrate their mobile applications with back-end functionalities enabling features like back-up, synchronization and data exchange. The goal is to illustrate different services and frameworks ranging from mobile-specific, to managed, to generic ones, helping the developers to make an informed choice about the most suitable solution for their applications' needs.

Cesare Rocchi

September 06, 2012
Tweet

More Decks by Cesare Rocchi

Other Decks in Programming

Transcript

  1. SWIPE CONFERENCE 2012 Outline •Needs when choosing a backend •Features

    •Overview of different approaches Tuesday, September 11, 12
  2. 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
  3. 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
  4. 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
  5. SWIPE CONFERENCE 2012 Impact on UX? •Does it break any

    flow? •How frequently? •is it “ok” with that? Tuesday, September 11, 12
  6. 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
  7. SWIPE CONFERENCE 2012 Have I to manage it? •Learn the

    API •Apple takes care of •installation •scalability •security Tuesday, September 11, 12
  8. SWIPE CONFERENCE 2012 Daemon •Monitors changes •Works on metadata •Shreds

    files •Supports conflict resolution Tuesday, September 11, 12
  9. SWIPE CONFERENCE 2012 Who’s to pay? •The final user •Your

    app will use his quota •5Gb for free Tuesday, September 11, 12
  10. 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
  11. 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
  12. SWIPE CONFERENCE 2012 Have I to manage it? •Already set

    up •installation •bandwidth •scalability Tuesday, September 11, 12
  13. 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
  14. 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
  15. 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
  16. SWIPE CONFERENCE 2012 Impact on UX? •Authentication the first time

    •User might modify files •Control on the upload Tuesday, September 11, 12
  17. SWIPE CONFERENCE 2012 Security •Https required •3rd party apps are

    “sandboxed” •Apps are reviewed Tuesday, September 11, 12
  18. SWIPE CONFERENCE 2012 Parse •Backend for mobile apps •Files, key-value

    •API for iOS, Android, Javascript and REST •Push notifications Tuesday, September 11, 12
  19. SWIPE CONFERENCE 2012 Have I to manage it? •Just learn

    the API •Parse takes care of •Installation •Bandwidth •Scalability Tuesday, September 11, 12
  20. SWIPE CONFERENCE 2012 What’s the synch model? •ORM approach on

    steroids •No need to serialize/deserialize Tuesday, September 11, 12
  21. 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
  22. 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
  23. SWIPE CONFERENCE 2012 Who’s to pay? •You •Pay as you

    use •Limit of calls/mo Tuesday, September 11, 12
  24. SWIPE CONFERENCE 2012 Who’s to pay? •You •Pay as you

    use •Limit of calls/mo Tuesday, September 11, 12
  25. 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
  26. SWIPE CONFERENCE 2012 •Data •Application IaaS PaaS SaaS •Data •Application

    •Runtime •Middleware •OS Tuesday, September 11, 12
  27. SWIPE CONFERENCE 2012 Dyno •Essentially a process •Web •Worker •#

    of dynos + db profile + addons = backend cost Tuesday, September 11, 12
  28. SWIPE CONFERENCE 2012 Amazon Web Services •CDN •Storage •Networking •DBs

    •Services: email, queue managers Tuesday, September 11, 12
  29. SWIPE CONFERENCE 2012 Good old way •Buy a server •pick

    the hardware •install OS •rent space/bandwidth in a farm Tuesday, September 11, 12
  30. SWIPE CONFERENCE 2012 Use a box mix •Choose between flavors

    •Add basic ingredients •Bake Tuesday, September 11, 12
  31. SWIPE CONFERENCE 2012 Do it from scratch •Choose all the

    elements •Preparation •Bake Tuesday, September 11, 12
  32. SWIPE CONFERENCE 2012 “You can’t always get what you want

    but if you try sometime, you just might find ...” Tuesday, September 11, 12
  33. SWIPE CONFERENCE 2012 Rolling Stones “You can’t always get what

    you want but if you try sometime, you just might find ...” Tuesday, September 11, 12