38
©2015 Couchbase Inc. 1 Nic Raboy, Developer Advocate at Couchbase Cross Platform Storage & Sync with Couchbase and Ionic Framework

Cross Platform Storage & Sync with Couchbase and Ionic Framework

Embed Size (px)

Citation preview

Page 1: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 1

Nic Raboy, Developer Advocate at Couchbase

Cross Platform Storage & Sync with Couchbase and Ionic Framework

Page 2: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 2

About Me

Nic RaboyDeveloper Advocate at Couchbase@nraboy (Twitter)

Page 3: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 3

The Plan

The business problem Couchbase Mobile Ionic Framework Couchbase + Ionic Framework

Page 4: Cross Platform Storage & Sync with Couchbase and Ionic Framework

What is the business problem?

Page 5: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Today’s Mobile Apps

5

Try again later.

No Internet

please wait…

Page 6: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 6

How Does This Affect What People Think?

Doesn’t work a lot of the time and when it does it’s slow.

Page 7: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 7

How Does This Affect App Uninstall Rates?

0%

20%

40%

60%

80%

100%

FreezingCrashingSlow Responsiveness

Unin

stal

l Rat

e

Source: uSamp

Page 8: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Data Location is the Problem

8

Page 9: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Local Data + Sync is the Solution

9

Page 10: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 10

What Does This Mean For Your Apps

Always work both online & offlineAlways be blazing fast

Built with orders of magnitude less codeUsers will absolutely love your apps

Page 11: Cross Platform Storage & Sync with Couchbase and Ionic Framework

What is Couchbase Mobile?

Page 12: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Couchbase Lite Sync Gateway

Page 13: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 13

Couchbase Lite

• NoSQL Mobile Database• Document Oriented & Schema-Less• Small Footprint• Runs In-Process

Page 14: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 14

Couchbase Sync Gateway

• Data Replication Between Server & Device

• Data Orchestration• Authentication & Authorization

Page 15: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 15

Channels

Sports San Francisco

Nature

Admin

Page 16: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 16

Replication

Is asynchronous Can be continuous or one-shot Sends JSON over HTTP Handles network hiccups Network timeouts

Page 17: Cross Platform Storage & Sync with Couchbase and Ionic Framework

17

Page 18: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Where Does Ionic Framework Fit In?

Page 19: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 19

Ionic Framework

HTML5 & AngularJS Framework Built on Apache Cordova Build Once, Deploy Everywhere Accepts Apache Cordova Plugins

Page 20: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Couchbase Cordova Plugin

Page 21: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 21

Couchbase Plugin

Compatible with Android and iOS Makes Couchbase Lite accessible via RESTful

APIs Easily integrate with Ionic Framework through

the ng-couchbase-lite wrapper

Page 22: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 22

A Classic Todo List

Page 23: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 23

NoSQL Documents

Page 24: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 24

Creating a Database

Page 25: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 25

Inserting Documents

Page 26: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 26

Map / Reduce Views

Concept from functional program, via Google App-defined map function operates on

documents Function output generates an index ordered by

key Index rows can be aggregated via a reduce

function Index is queried by a key or key range

Page 27: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 27

Couchbase Lite Views

Page 28: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 28

Querying Couchbase Views

Page 29: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 29

Replication With Sync Gateway

Page 30: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 30

Listen for Changes

Page 31: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Couchbase Sync Gateway

Page 32: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 32

Basic Sync Gateway Configuration

Page 33: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Demo Time!

Page 34: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 34

Couchbase Labs on GitHub

https://github.com/couchbaselabs/todolite-ionic

Page 35: Cross Platform Storage & Sync with Couchbase and Ionic Framework

Questions?

©2014 Couchbase, Inc.

Page 36: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 36

San Francisco Couchbase Meetup

http://www.meetup.com/The-San-Francisco-Couchbase-Meetup-Group

Page 37: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 37

We’re Hiring!http://www.couchbase.com/careers

Page 38: Cross Platform Storage & Sync with Couchbase and Ionic Framework

©2015 Couchbase Inc. 38

Thank You!

Nic Raboy@nraboy (Twitter)