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

Sync-Gateway: Building offline-first and Data-Sensitive apps faster

Sync-Gateway: Building offline-first and Data-Sensitive apps faster

deniswsrosa

June 17, 2020
Tweet

More Decks by deniswsrosa

Other Decks in Technology

Transcript

  1. SYNC GATEWAY Denis Rosa | Developer Advocate @deniswsrosa HOW TO

    BUILD OFFLINE-FIRST & DATA-SENSITIVE APPLICATIONS FASTER
  2. • +15 years as a Developer • NoSQL & Java

    Specialist • OSS contributor Denis Rosa deniswsrosa @deniswsrosa [email protected]
  3. 4 “The app should work offline” means: • Equipment List;

    • Floor layout; • Maintenance history; • Maintenance Plan; • Work Order; • User data; • …
  4. 6 • Collaborative Database of Events; • SaaS • Public

    and Private events; • But … We don’t want others to have access to our private events.
  5. 7 How to solve this issue? • Let them run

    their own instances • The main goal of the project is having a collaborative database of events • Synchronize Databases via XDCR (Federation); • Compromises the scalability of the project, if 200 companies are using it, I will need to allow my database to replicate to all of them. • Store private events locally and public events remotely • A lot of extra coding and complexity. It can also limit some features like reports.
  6. 8

  7. 9

  8. 10

  9. 11 Sync Gateway Synchronization • Synchronize data between Couchbase Lite

    and Couchbase Server • REST, Stream, Batch, and Event APIs • Pluggable authentication • Fine grained user/role-based access control • Elastically scalable in real-time
  10. 12 Lightweight embedded NoSQL database with full CRUD and query

    functionality. Secure web gateway with synchronization, REST, stream, batch and event APIs for accessing and synchronizing data over the web. Highly scalable, highly available, high performance NoSQL database server. Built-in enterprise level security throughout the entire stack includes user authentication, user and role based data access control (RBAC), secure transport (TLS), and 256-bit AES full database encryption. Couchbase Lite Sync Gateway Couchbase Server EMBEDDED DATABASE SYNCHRONIZATION DATABASE SERVER SECURITY
  11. 13 Couchbase Server Database Server • Performance at scale •

    Flexible JSON data model • Scale easily to hundreds of nodes • Multi-Document Transactions • Strong-Consistent
  12. 14 Couchbase Lite Embedded Database • Cross-platform support for all

    major operating systems and platforms • Built native from the ground up • 500kb for most platforms • 256-bit AES full database encryption
  13. 16

  14. 17

  15. 18

  16. 19 Confidential and Proprietary. Do not distribute without Couchbase consent.

    © Couchbase 2017. All rights reserved. Mobile App Couchbase Lite Native API Native Platform Bindings JSON Lite Core Engine Fleece Storage Engine Replication Protocol w/ Sync Gateway
  17. 21

  18. 22

  19. 24 • Web-Sockets while app is active and with connectivity

    • Exponential back off • Silent Notifications / Background App Refresh
  20. 26

  21. 31 • The Sync Function allows you to decide which

    documents should be synchronized; • You can choose the direction of the synchronization: mobile-to- server, server-to-mobile or both
  22. 32

  23. 34 • Authentication/Authorization; • Subscribe to public and private channels;

    • Dynamically add new channels; • Add “Command” documents that will be processed in the backend
  24. 35

  25. 36

  26. 37