Webinar - Couchbase Lite Under the Hood

4,047 views

Published on

In this webinar we'll take a deep dive into Couchbase Lite's architecture. We'll be starting with an overview of Couchbase Lite concepts, and how those concepts have been realized in Couchbase Lite and Couchbase Sync Gateway.

In this webinar you will see:

Key concepts behind Couchbase Lite and the Couchbase mobile strategy
A detailed overview of the Couchbase Lite components
A technical overview of Couchbase Sync Gateway
Examples of APIs (REST, iOS, Android)

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,047
On SlideShare
0
From Embeds
0
Number of Embeds
2,771
Actions
Shares
0
Downloads
47
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Webinar - Couchbase Lite Under the Hood

  1. 1. Couchbase*Lite*Under*the*Hood * J.*Chris*Anderson*–*Mobile*Architect *
  2. 2. JSON*Anywhere** JS N! Lite Couchbase*Server* Sync Gateway Server JS N! JS N! •  JSON*on*the*device * •  JSON*on*the*wire* ­  Developers* increasingly*prefer* NoSQL*database* ­  No*need*for*data* transforma<on* •  JSON*in*the*cloud* ­  Flexible*data*model* ­  High*performance* ­  Easy*scalability*
  3. 3. Couchbase*Lite * The*only*NoSQL*Database*for*Mobile*Devices * Couchbase* Lite** iOS* Couchbase* Lite** Android* Lite •  Features* ­  UltraBlightweight,*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*
  4. 4. 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* Sync Gateway •  Benefits* ­  10x*reduc<on*in*development* <me* ­  Scales*to*support*millions*of* users*
  5. 5. Couchbase*Server* IndustryKleading*NoSQL*database * •  MulMple*deployment*opMons* ­  OnBPremise* ­  Hosted*on*Amazon* ­  Cloud*Services* •  Couchbase*Cloud* Server •  KuroBase*
  6. 6. IntegraMons* Partnerships*for*Couchbase*Lite * Couchbase*Lite*Plugin*for*PhoneGap* hVp://plugins.cordova.io/#/com.couchbase.lite.phonegap* Couchbase*Lite*for*Xamarin* hVp://components.xamarin.com/view/couchbaseBlite/* Couchbase*Lite*Titanium* hVps://marketplace.appcelerator.com/apps/6706?1396013098*
  7. 7. Sync%Architecture
  8. 8. Couchbase%Server Server%1 Server%2 Server%3
  9. 9. Architecture On Premise In the cloud Couchbase%Server Server%1 Server%2 Server%3
  10. 10. Architecture On Premise In the cloud Couchbase%Server Server%1 Sync%Gateway Channel Channel Server%2 Server%3 Sync%Gateway Channel Channel
  11. 11. Architecture On Premise In the cloud Couchbase%Server Server%1 Sync%Gateway Channel Channel Server%2 Server%3 Sync%Gateway Channel Channel Couchbase%Lite%for%iOS%and%Android
  12. 12. !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
  13. 13. Demo%>%Todo%List%App !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
  14. 14. A%Day%in%the%Life%of%a%Document
  15. 15. Data%Flow Couchbase%Server Server%1 Sync%Gateway Channel Channel Server%2 Server%3 Sync%Gateway Channel Channel Sync%Push Couchbase%Lite%for%iOS%and%Android
  16. 16. Data%Flow Couchbase%Server Server%1 Server%2 Server%3 JavaScript%Sync%FuncEon Sync%Gateway Channel Channel Sync%Gateway Channel Channel Couchbase%Lite%for%iOS%and%Android
  17. 17. Data%Flow Couchbase%Server Server%1 Server%2 Server%3 Store%Data Sync%Gateway Channel Channel Sync%Gateway Channel Channel Couchbase%Lite%for%iOS%and%Android
  18. 18. Data%Flow Couchbase%Server Server%1 Server%2 Server%3 TAP/UPR Sync%Gateway Channel Channel Sync%Gateway Channel Channel Couchbase%Lite%for%iOS%and%Android
  19. 19. Data%Flow Couchbase%Server Server%1 Server%2 Sync%Gateway Channel Channel Server%3 Sync%Gateway Channel Channel HTTP%Changes Couchbase%Lite%for%iOS%and%Android
  20. 20. Embedded%Database
  21. 21. Couchbase%Lite%Components ApplicaHon!API Sync! Engine Query!Engine Map/Reduce View!Indexer KeyAValue JSON! Storage
  22. 22. Couchbase%Lite%Components ApplicaHon!API Sync! Engine Query!Engine Map/Reduce View!Indexer KeyAValue JSON! Storage
  23. 23. Couchbase%Lite%Components ApplicaHon!API Sync! Engine Query!Engine Map/Reduce View!Indexer KeyAValue JSON! Storage
  24. 24. Couchbase%Lite%Components ApplicaHon!API Sync! Engine Query!Engine Map/Reduce View!Indexer KeyAValue JSON! Storage
  25. 25. Couchbase%Lite%Components ApplicaHon!API Sync! Engine Query!Engine Map/Reduce View!Indexer KeyAValue JSON! Storage
  26. 26. Couchbase%Lite%Components ApplicaHon!API Sync! Engine Query!Engine Map/Reduce View!Indexer KeyAValue JSON! Storage
  27. 27. Live%Query ObjecEve>C%code%example
  28. 28. Mobile%ApplicaEon%Process NaHve!ApplicaHon!Logic Sync Couchbase!Lite Storage
  29. 29. PhoneGap%Plugin Web!RunHme PhoneGap! Plugins Camera,!etc JavaScript ApplicaHon!Logic getURL(function(err,0url){ console.log(url) }) XHR!Ajax REST!Connector Couchbase!Lite Storage Sync
  30. 30. Toggle&a&Task&Checkbox&by&upda3ng&the&JSON&Document
  31. 31. REST%to%GET%and%PUT%documents Toggle&a&Task&Checkbox&by&upda3ng&the&JSON&Document
  32. 32. SelecEve%Sync
  33. 33. SelecEve%Sync Couchbase%Server Server%1 Sync%Gateway Channel Channel Server%2 Server%3 Sync%Gateway Channel Channel Sync%Push Couchbase%Lite%for%iOS%and%Android
  34. 34. SelecEve%Sync Couchbase%Server Server%1 Server%2 Server%3 JavaScript%Sync%FuncEon Sync%Gateway Channel Channel Sync%Gateway Channel Channel Couchbase%Lite%for%iOS%and%Android
  35. 35. SelecEve%Sync Couchbase%Server Server%1 Server%2 Server%3 Store%Data Sync%Gateway Channel Channel Sync%Gateway Channel Channel Couchbase%Lite%for%iOS%and%Android
  36. 36. SelecEve%Sync Couchbase%Server Server%1 Server%2 Server%3 TAP/UPR Sync%Gateway Channel Channel Sync%Gateway Channel Channel Couchbase%Lite%for%iOS%and%Android
  37. 37. SelecEve%Sync Couchbase%Server Server%1 Server%2 Sync%Gateway Channel Channel Server%3 Sync%Gateway Channel Channel HTTP%Changes Couchbase%Lite%for%iOS%and%Android
  38. 38. Doc%1 Channel%A
  39. 39. Doc%1 Channel%A Channel%A Doc%2 Channel%B Channel%A%&%B Channel%B
  40. 40. Doc%1 Channel%A Channel%A Doc%2 Channel%B Channel%A%&%B Channel%B
  41. 41. Channel%A Doc%1 Channel%A Doc%2 Channel%B Doc%2 Doc%1 Channel%A%&%B Channel%B
  42. 42. Channel%A Doc%1 Channel%A Doc%2 Channel%B Doc%2 Doc%1 Channel%A%&%B Channel%B
  43. 43. Channel%A Doc%1 Channel%A Doc%2 Channel%B Doc%2 Doc%1 Doc%2 Channel%A%&%B Channel%B
  44. 44. Data Data Data Routing
  45. 45. Data Routing Data Data Data
  46. 46. Data Routing Data Data Data Da ta
  47. 47. Data Routing Data Data a at D Dat a ata D
  48. 48. Data Routing Da ta Data Data Data Dat a a at D
  49. 49. Data Routing Da Data Da ta ta Data Data ta Da
  50. 50. Sync%Gateway
  51. 51. Architecture Couchbase%Server Server%1 Sync%Gateway Channel Channel Server%2 Server%3 Sync%Gateway Channel Channel Couchbase%Lite%for%iOS%and%Android
  52. 52. Sync%Gateway:%App%Logic%&%Storage AuthenHcaHon App’s!Sync! FuncHon Revision/ Conflict! Management Couchbase! Smart!Client to'Couchbase'Server
  53. 53. Sync%Gateway:%App%Logic%&%Storage AuthenHcaHon function(doc,0oldDoc)0{ … requireUser(oldDoc.owner); … channel(doc.channel); … access(doc.members,0doc.roomID); } App’s!Sync! FuncHon Revision/ Conflict! Management Couchbase! Smart!Client to'Couchbase'Server
  54. 54. Sync%Gateway:%App%Logic%&%Storage AuthenHcaHon vali daH function(doc,0oldDoc)0{ on … } requireUser(oldDoc.owner); … channel(doc.channel); … access(doc.members,0doc.roomID); App’s!Sync! FuncHon Revision/ Conflict! Management Couchbase! Smart!Client to'Couchbase'Server
  55. 55. Sync%Gateway:%App%Logic%&%Storage AuthenHcaHon function(doc,0oldDoc)0{ … rou Hng requireUser(oldDoc.owner); … channel(doc.channel); … access(doc.members,0doc.roomID); } App’s!Sync! FuncHon Revision/ Conflict! Management Couchbase! Smart!Client to'Couchbase'Server
  56. 56. Sync%Gateway:%App%Logic%&%Storage AuthenHcaHon function(doc,0oldDoc)0{ … requireUser(oldDoc.owner); … acc ess channel(doc.channel); !ctr l … access(doc.members,0doc.roomID); } App’s!Sync! FuncHon Revision/ Conflict! Management Couchbase! Smart!Client to'Couchbase'Server
  57. 57. Sync%Gateway:%App%Logic%&%Storage AuthenHcaHon App’s!Sync! FuncHon Revision/ Conflict! Management Couchbase! Smart!Client to'Couchbase'Server
  58. 58. Sync%Gateway:%App%Logic%&%Storage AuthenHcaHon App’s!Sync! FuncHon Revision/ Conflict! Management rev 3a rev 1 rev 2 rev 3b Couchbase! Smart!Client to'Couchbase'Server
  59. 59. Sync%Gateway:%App%Logic%&%Storage AuthenHcaHon App’s!Sync! FuncHon Revision/ Conflict! Management Couchbase! Smart!Client to'Couchbase'Server
  60. 60. Programmable Sync
  61. 61. Your%Cloud%in%One%Page%of%Code Programmable Sync • ApplicaEon%logic%run% by%the%Gateway ­ Access%Control ­ Channel%Rou0ng ­ Update%Valida0on
  62. 62. Sync%Gateway%Components Sync REST!API AuthenHcaHon Channel! Change! Tracking App’s!Sync! FuncHon to'client Revision/ Conflict! Management Couchbase! Smart!Client to'Couchbase'Server External!Auth! Services
  63. 63. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  64. 64. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  65. 65. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  66. 66. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  67. 67. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  68. 68. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  69. 69. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  70. 70. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  71. 71. Custom%User%AuthenEcaEon Couchbase!Lite Auth Auth Session!Key! Generator Sync!Gateway LDAP,!etc. Custom!App!Server Back
  72. 72. Data%Structures%for%Conflict% DetecEon%and%Management
  73. 73. Revision%Trees 5 4 4 3 5 4 4 3 5 4 3 4 4 3 3 2 2 2 1 1 1
  74. 74. Get%Started
  75. 75. Get%Started mobile.couchbase.com Sample%App hUps://github.com/couchbaselabs/TodoLite>PhoneGap Couchbase%Cloud hUp://www.couchbasecloud.com
  76. 76. Couchbase%Cloud
  77. 77. Q/A

×