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

How I left iCloud

How I left iCloud

An introduction to my first iOS app, its use of iCloud, and how it was migrated from iCloud to Firebase.

August 2013

Chris Aves

August 20, 2013
Tweet

More Decks by Chris Aves

Other Decks in Programming

Transcript

  1. My first iOS app • Simple multiple list task manager

    • Written in Objective-C • Developed using Xcode • Uses Core Data and iCloud
  2. Core Data • Apple's abstraction of underlying database technology used

    in iOS and Mac OS X • Developers can model data architecture; Core Data does all the legwork • Supports migration of database (e.g. to add a due date to all tasks)
  3. Problems with Core Data • Draw models and relationships •

    Multiple versions of specification (e.g. to support migrations) • Disassociated from the actual code 1
  4. Problems with Core Data • Database migrations aren't always easy

    • Sometimes extra code needs to be written 2
  5. iCloud • "Seamlessly" synchronise documents and databases between multiple Apple

    devices • Fairly easy to implement, but this depends on the requirements of each application
  6. Problems with iCloud • Can't test on iOS Simulator •

    Synchronisation takes an unspecified period of time 2
  7. Remember NoSQL? • Schema-free • Easy replication • Simple API

    • Eventual consistency • Humongous data
  8. Main benefits • No modelling required, just code and go

    • The model is the code • No need for simple migrations
  9. Example class Task < Sadis::Model attribute :parentID attribute :title attribute

    :displayOrder attribute :completed attribute :sequenceID belongs_to :list, "List" class List < Sadis::Model attribute :title attribute :displayOrder has_many :tasks, "Task"
  10. What is Firebase? • Key-Value pairs of data • Accessible

    at a given URL:
 e.g.: ../model/list/123 • Read, write, query
  11. Why is it brilliant? • Libraries for iOS and Mac

    OS X, Android, JavaScript • Well documented and easy to use • Access rules • Clients can listen for live updates to data, and write live • Lightning fast • Built-in caching, so works offline • Developers can get access to the data
  12. Updating Sadis • Enhanced to work with Firebase • Completely

    seamless • Any set of models work with Firebase, automatically
  13. Oodles of options • Official libraries that integrate with Angular.js

    and Backbone.js • Lots of unofficial libraries
  14. after much trial and error... • backbone.js, using basic firebase.js

    library • marionette.js • Backbone.VirtualCollection
  15. What next? • Add multi-user support • Update my iOS

    application accordingly • Write Mac OS X application • Write web application