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

Couchbase Mobile 101

Couchbase Mobile 101

Overview of Couchbase Mobile (the Couchbase Sync Gateway, and Couchbase Lite). Presented at Couchbase Connect 2015

Jens Alfke

May 28, 2015
Tweet

More Decks by Jens Alfke

Other Decks in Technology

Transcript

  1. ©2015 Couchbase Inc. ‹#› What Is Couchbase Mobile? ▪ Couchbase

    Lite ▪ Client library ▪ For mobile or desktop apps ▪ Couchbase Sync Gateway ▪ App server ▪ Front-end for Couchbase Server
  2. ©2015 Couchbase Inc. ‹#› Couchbase Lite ▪ Embedded database library

    for mobile apps ▪ Flexible, schemaless data model (“NoSQL”) ▪ Querying by map/reduce views ▪ Active change notifications, for reactive UIs ▪ Full-strength multi-master replication
  3. ©2015 Couchbase Inc. ‹#› Document Data Model  Database “to-do”

    “doc1” “doc2” “doc3” Document “doc1” { “text”: “Vacuum kitchen”, “created”: “2015-05–28”, “check”: false, “tags”: [“jens”, “chore”] } thumb.jpg
  4. ©2015 Couchbase Inc. ‹#› Document Data Model ▪ A database

    is a namespace for documents ▪ A document has ▪ A unique, immutable ID ▪ A JSON body containing properties ▪ Named attachments (binary, arbitrary size)
  5. ©2015 Couchbase Inc. ‹#› Interesting Document Facts ▪ JSON allows

    nested data structures (arrays, maps) ▪ Documents don’t need to have the same structure! ▪ Different types of docs can coexist in a database ▪ “type” property is a common convention ▪ Optimistic concurrency control (MVCC)
  6. ©2015 Couchbase Inc. ‹#› Map/Reduce Indexing ▪ Concept from functional

    programming, via Google emit(doc.created, doc.title) key value docID “2013-03-12” “taxes” “doc17” “2013-09-30” “call mom” “doc62” “2013-10-17” “cat food” “doc82” “2013-10-17” “tea bags” “doc83” “2013-10-22” “upgrade” “doc90” view index all documents map function
  7. ©2015 Couchbase Inc. ‹#› Change Notifications ▪ Three types: ▪

    DatabaseChanged: Any document updated ▪ DocumentChanged: A specific document updated ▪ LiveQuery: Change in query result set ▪ Enables reactive programming Controller Model (Database) GUI View User event Doc update Change notification Redraw
  8. ©2015 Couchbase Inc. ‹#› Replication, or Sync ▪ Client has

    a replica (or a subset) of the server database ▪ Replicator transfers changed documents ▪ Multi-master ▪ Arbitrary topologies ▪ Full offline support ▪ No latency