Couchbase_for mobile_Couchbase_SF_2013
-
Upload
couchbase -
Category
Technology
-
view
14.125 -
download
0
Transcript of Couchbase_for mobile_Couchbase_SF_2013
Couchbase for Mobile
Dip2 Borkar – Director, Product Management
J. Chris Anderson – Mobile Architect
Couchbase Lite
The only Na2ve NoSQL Database for
Mobile
The Complete Mobile Solu2on
JSON Anywhere
Couchbase Server
• JSON on the device Developers
increasingly prefer NoSQL database
• JSON on the wire No need for data
transforma<on
• JSON in the cloud Flexible data model High performance Easy scalability
ServerSync GatewayLiteJS N
JS N
JS N
Architecture
SERVER 3
SERVER 1
SERVER 2
Couchbase Server
Channel
Sync Gateway
Channel
Channel
Sync Gateway
Channel
Couchbase Lite for iOS and Android
On Premise In the cloud
Couchbase Lite The only NoSQL Database for Mobile Devices
• Features Ultra-‐lightweight, secure JSON database
Na<ve support for iOS, Android and REST/HTML5
Full document, index and querying and sync capabili<es
Powerful conflict resolu<on Lite
Couchbase Lite
Android
Couchbase Lite iOS
What you get
Lite
Couchbase Lite
Android
Couchbase Lite iOS
Enable new class of rich data intensive local applica<ons
Rapid development using na<ve JSON data
Highly responsive interac<ve applica<ons
Always available -‐ online or offline
What you get
JSON Everywhere
• Flexible JSON on device lets you work with local data & modify your data structure on the fly without impac<ng your back-‐end.
• Your users can count on having an amazing app experience with a fast and unbreakable local database
Easy Sync
• Effortlessly sync local data with a database in the cloud for updates, replica<on or collabora<ve sharing.
• In addi<on, scale your data <er horizontally and reliably as your data and sync needs grow.
JSONJSONJSON
JSONJSON
Couchbase Sync Gateway Easy, Reliable Data Sync to the Cloud
• Features • Dynamic sync capabili<es via
Sync Func<on APIs • Easy Administra<on • Seamless scaleout
• Benefits 10x reduc<on in development
<me Scales to support millions of
users
Sync Gateway
How does sync work?
Collaborate using Channels
• For each document, you specify a set of channels it belongs to
• For each user or device, you control which channels they can access
• Replicate only a subset of documents down to the device User-‐defined filter func<ons Simply lets you know whether a document should be replicated
• And you can authen2cate users
Data Routing
Dat
a D
ata
Data Routing
Dat
a
Data
Dat
a
Data Routing
Data
Dat
a D
ata
Data Routing
Dat
a Da
ta
Data Routing
Data
Data
Dat
a D
ata
Data Routing
Data
Dat
a D
ata
How do I get started?
Zero to sync in 5 minutes !!!
A liVle deep dive
• Get familiar with Couchbase Lite through looking at an applica2on
• Introduce the app with a demo create a list / live query my lists create some tasks / live query tasks sign in to the cloud collaborate via the cloud
• Show the code for the features as we use them
Couchbase Lite -‐ Features
JSON / REST interface -‐ CRUD opera<ons use
HTTP verbs
-‐ Works with libraries like jQuery and Backbone Live Query UI Updates
-‐ UI updated to reflect
database changes, even for remote changes
-‐ HTTP long poll API to support quick redraw
Collaborate via Cloud -‐ social network login
-‐ programmable sync func<on for update valida<on and channel rou<ng
JSON Document Schema
All Todo Lists
• Rendered with HTML and JavaScript
• View query to show all the lists on a device.
• Form submit event creates a document represen2ng a list.
Task List -‐ Items
• Toggle a checkbox • Add a photo • Live update
Toggle a Task Checkbox by upda2ng the JSON Document
Uses a familiar REST paradigm. GET and PUT used here.
Live Update UI
Local and remote updates both trigger a database event, used for redraw.
Sign-‐in to sync and collaborate
• Example uses Facebook, we support a wide variety of authen2ca2on op2on
• Pick from the list of signed in users when sharing
Photo AVachment
Sync Func2on
• Applica2on code run in the cloud
• Access control • Channel rou2ng • Update Valida2on
Your cloud in one page of code.
Get Started
mobile.couchbase.com
Sample App
• hVps://github.com/couchbaselabs/TodoLite-‐PhoneGap