Infinum Android Talks #04 - CouchBase Lite

13

Click here to load reader

description

CouchBase Lite is a native NoSQL database for Android (mobile) that enables JSON data and document storage, replication and conflict management. We will show you how we use it to get our data updated, distributed and in the format that suits us best.

Transcript of Infinum Android Talks #04 - CouchBase Lite

Page 1: Infinum Android Talks #04 - CouchBase Lite

Couchbase Lite

Ana Baotić

Page 2: Infinum Android Talks #04 - CouchBase Lite

NoSql

Specifics● Data not modeled in tabular relations● Typical structures: graph, tree, key-value pairs● Simpler design ● Horizontal scaling● Used for big data and availability applications

Drawbacks● Consistency ● Lack of standardized interfaces and full ACID support● Use of low level query languages

Page 3: Infinum Android Talks #04 - CouchBase Lite

Database mechanisms

Documents (JSON) are building blocks, handled one at a time

● Reading– Key-based lookup mechanism– Client provides the key(s range)

● Writing– Key-based update mechanism– Documents are updated (low latency)

● Push and pull replication

● Conflict management support

Page 4: Infinum Android Talks #04 - CouchBase Lite

Document content

Page 5: Infinum Android Talks #04 - CouchBase Lite

Adding CouchBase Lite

Page 6: Infinum Android Talks #04 - CouchBase Lite

Adding CouchBase Lite

Page 7: Infinum Android Talks #04 - CouchBase Lite

Creating a database

Page 8: Infinum Android Talks #04 - CouchBase Lite

Create, update, delete

Page 9: Infinum Android Talks #04 - CouchBase Lite

Replication

● Key feature that enables document syncing– Pull, remote to local

– Push, local to remote

– Sync, configuration consisting of pull and push

● Continuous replication– Open connection, acts upon detected change

– Connectivity change aware!

– cannot get a marker on the map by an id

● One shot replication

– Active until changes are copied● Persistent replications vs non-persistent● Filters

Page 10: Infinum Android Talks #04 - CouchBase Lite

Replication example

Page 11: Infinum Android Talks #04 - CouchBase Lite

Demo app example

● Cloudant used for the data layer

– NoSql database as a service– RESTful API– https://cloudant.com/product/cloudant-features/

● GitHub repo

– https://github.com/abaotic/CouchBaseLite-Demo

Page 12: Infinum Android Talks #04 - CouchBase Lite

Links● NoSql wiki

– http://en.wikipedia.org/wiki/NoSQL

● Couchbase tutorial

– http://docs.couchbase.com/couchbase-lite/cbl-android/cbl-android-1.0b2/#tutorial

● Cloudant server

– https://cloudant.com/

● CouchBase Lite Github repo

– https://github.com/couchbase/couchbase-lite-android

● CouchBase Lite demo

– https://github.com/abaotic/CouchBaseLite-Demo

Page 13: Infinum Android Talks #04 - CouchBase Lite

Thank you!