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

Couchbase Lite iOS Geo

Couchbase Lite iOS Geo

Chris Anderson

September 12, 2014
Tweet

More Decks by Chris Anderson

Other Decks in Programming

Transcript

  1. 3 Couchbase  Lite   On-­‐device,  lightweight,  native   embedded  JSON

     database Sync  Gateway   Synchronize  on-­‐device   Couchbase  Lite  with  Couchbase   Server  in  the  cloud Couchbase  Server   High  performance,  scalable,   always-­‐on  JSON  database  in   the  cloud Couchbase Mobile
  2. Conflict Resolution 5 Johnny (555)123-4567 Johnny Smith [email protected] 123 Main

    Street Anywhere, USA (555)123-4567 Johnny Smith 123 Main Street Anywhere, USA (555)123-4567 John A. Smith [email protected] 123 Main Street Anywhere, USA (555)123-4567 John A. Smith [email protected] 123 Main Street Anywhere, USA (555)123-4567 Johnny Smith (555)123-4567 Jon A. Smith [email protected] 123 Main Street Anywhere, USA (555)123-4567 John A. Smith [email protected] 123 Main Street Anywhere, USA (555)123-4567 CONFLICT ACTIVE
  3. Access Control, Filtering, and Validation 9 Pluggable Authentication Javascript sync

    function runs on all mutations. Access/Filtering – channel(…): Routes the document to the named channel – access(…): Grants access to a channel to a specified user, list of users, or a role – role(…): Grants a user a role Validation – throw(…): Prevents a document mutation from persisting – requireUser/Role/Access(…): Validates the user, their role assignments, or their access privileges.
  4. Sync Function 10 function (doc, oldDoc) { if (doc.published) {

    channel ("public"); } access (”joe", ”public"); ! role (”joe", "role:admin"); ! throw ({forbidden : "read only!"}) ! requireUser(doc.owner); requireRole("admin"); requireAccess(”public"); }
  5. Infinite Campus Education  /  Social  Interaction   ▪ Selectively  push

     out  learning  modules  /   multimedia  lessons  to  individual  students   ▪ Teachers  and  students  use  custom  mobile   chat  apps  for  real-­‐time  Q&A  during   lectures   ▪ Homework  assignments  can  be  completed   offline  anywhere “We needed to provide an educational experience as engaging as the apps students love to use everyday. The ability to work online/offline and seamlessly sync across devices and between users was critical to delivering the experience they need for both in the classroom, and off campus. We investigated the market for an ultra-lightweight NoSQL mobile database with easy sync and Couchbase was the only choice.” Mike Lamb, Principal Software Engineer, Infinite Campus
  6. Picsolve Embedded     ▪ Image  capture  of  roller  coaster

      riders  to  local  database  in  multiple   theme  park  locations   ▪ Machine  to  machine   communication  example   ▪ Unreliable  network  connectivity   required  offline  capture  /  later   sync  to  centralized  management   system
  7. Microsoft Peer-­‐to-­‐Peer   ▪ What  does  it  mean  to  make

     the   web  truly  peer-­‐to-­‐peer?   ▪ Data  stored  on  the  edge   ▪ Enable  applications  that  can  live   on  the  edge  of  the  network
  8. Couchbase Lite Setup Setup  Steps   ▪ Open  database  

    ▪ Configure  sync   ▪ Install  index  definitions
  9. Import Photos Loading  Photos   ▪ Enumerate  assets   ▪

    Save  JSON  document   ▪ Attach  image  thumbnail
  10. Live Query for Map Annotations Rendering  Points   ▪ Create

     LiveQuery   ▪ Observe  Results   ▪ Update  Map  Annotations
  11. Update Query on Region Change Bounding  Box   ▪ Observe

     Region  Changes   ▪ BBox  from  MapRect   ▪ Refresh  Live  Query
  12. Q&A