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

Choosing a back end for your mobile app:

Choosing a back end for your mobile app:

Although usually unnoticed by the final users, the back end is an important piece in the context of mobile application. In the past, building a back end meant renting some hardware or virtual machine, setting up the operative system, configuring the server, database, storage and writing the application logic. Nowadays great services and tools that allow to quickly setup a back end are spreading. I will provide an overview of the services which allow developers to integrate their mobile applications with back end functionalities and I am going to illustrate the features of BaasBox, an open source back end, and its SDKs.

Cesare Rocchi

March 05, 2014
Tweet

More Decks by Cesare Rocchi

Other Decks in Technology

Transcript

  1. SWIPE CONFERENCE 2012 •From web to app •Apps which are

    inherently mobile •App needs a back-end App Target
  2. SWIPE CONFERENCE 2012 •At which level? •Am I able to

    do it? •Have I time to learn? •Is it worth it? Have I to manage it?
  3. SWIPE CONFERENCE 2012 •Does it match my goals? •Can I

    change it if needed? •What about protocols? What’s the synch model?
  4. SWIPE CONFERENCE 2012 •Have I to manage it? •What’s the

    synch model? •Who’s to pay? •Impact on UX? •Lock-in? Questions
  5. SWIPE CONFERENCE 2012 •Learn the API •Apple takes care of

    •installation •scalability Have I to manage it?
  6. SWIPE CONFERENCE 2012 •The final user •Your app will use

    his quota •5Gb for free Who’s to pay?
  7. SWIPE CONFERENCE 2012 •User expectation •No control on upload •“Why

    isn’t there?” •Open the app to synch •User turns off iCloud? Impact on UX?
  8. SWIPE CONFERENCE 2012 •Desktop synchronizes continuously •Mobile apps have to

    query the backend •HTTP API •SDKs for iOS, Android, Ruby, Python What’s the synch model?
  9. SWIPE CONFERENCE 2012 •No conflict resolution (revision #) •Data serialization

    is up to you •No file shredding What’s the synch model?
  10. SWIPE CONFERENCE 2012 •The final user •Your app will use

    his disk quota •2 Gb for free Who’s to pay?
  11. SWIPE CONFERENCE 2012 Lock-in •None •Each user owns his data

    •Personal/team usage •... but nothing more
  12. SWIPE CONFERENCE 2012 •Data •Application IaaS PaaS SaaS •Data •Application

    •Runtime •Middleware •OS AWS, Rackspace, ... Heroku, Appfog, ... BaasBox
  13. SWIPE CONFERENCE 2012 •Essentially a process •Web •Worker •# of

    dynos + db profile + addons = backend cost Dyno
  14. SWIPE CONFERENCE 2012 •Buy a server •pick the hardware •install

    OS •rent space/bandwidth in a farm Good old way
  15. SWIPE CONFERENCE 2012 •Backend for mobile apps •Files, DB, key-value

    •API SDK •Push notifications •Analytics BaaS
  16. SWIPE CONFERENCE 2012 •No application server •No database server •JVM

    is the only requirement •Runs everywhere BaasBox
  17. SWIPE CONFERENCE 2012 BaasBox on CentOS yum install java-1.7.0-openjdk !

    scp baasbox-xx.tar.gz user@host:remotepath ! cd remotepath ! ./start
  18. SWIPE CONFERENCE 2012 Asset curl --form fi[email protected] --form name=margherita -H

    X-BB-SESSION:SESSION_TOKEN http://localhost:9000/admin/asset
  19. SWIPE CONFERENCE 2012 Menu curl -d "name=menu&meta=[ { "name": "Margherita",

    "id" : "margherita", "price": 5, "ingredients": "Pizza con pomodoro e mozzarella" }, ... ]" -H X-BB-SESSION:SESSION_TOKEN http://localhost:9000/admin/asset
  20. SWIPE CONFERENCE 2012 Create order curl -d "{ "list": {"margherita":

    2,"quattrostagioni": 2}, "user": { "name": "Cesare", "surname": "Rocchi", "address": "Via delle vie 12, Roma", ... }, "time": "2013-01-02Z14:21", "total": 12.5, }" -H X-BB-SESSION:SESSION_TOKEN http://localhost:9000/document/orders
  21. SWIPE CONFERENCE 2012 SignUp private void signupWithBaasBox(boolean newUser) { !

    BaasUser user = BaasUser.withUserName(mUsername); user.setPassword(mPassword); ! if (newUser) { mSignupOrLogin=user.signup(onComplete); } else { mSignupOrLogin=user.login(onComplete); } }
  22. SWIPE CONFERENCE 2012 DearDiary [SMPost getObjectsWithParams:nil completion:^(NSArray *objects, NSError *error)

    { if (error == nil) { self.posts = [objects mutableCopy]; [self.tableView reloadData]; } else { NSLog(@"error %@“, error); } }];
  23. SWIPE CONFERENCE 2012 Grid 1. Have I to manage it?

    2. What’s the synch model? 3. Who is to pay? 4. Impact on UX? 5. Lock-in?