Open Source has revolutionized IT sector as it harnesses the intelligence and efforts of the community to develop and maintain software faster. Our experts discuss the latest happenings and give their view points on how open source can be leveraged for your organization’s transformation.

« Couchbase Mobile Field Service Solution for a CPG Enterprise | Main

New open source CBLite Tester streamlines data synchronization testing with Couchbase Sync Gateway

Data synchronization - The key to offline-first mobile apps

Data synchronization is critical for enabling offline-first mobile apps. These are apps that regularly require network connectivity but are also usable during poor or no network connectivity. Couchbase Sync Gateway is an internet-facing component that enables secure data synchronization across Couchbase Lite-enabled clients like mobile apps. It provides a mechanism to enforce data routing, access control and authorization so that the right subset of data is synchronized with apps and users that have access to that data. The business logic behind the validation and authorization of document access is provided by the customizable Sync Gateway Sync Function.

In a typical deployment, the end-to-end architecture looks like this:


sync gateway.jpg

Figure 1: End-to-end architecture with Sync Gateway


Development and testing challenges

As you can see in Fig 1, the core component interacting with the Sync Gateway is a mobile app using the Couchbase Lite database. While this makes complete sense in a production environment, testing the data sync requires a fully developed mobile app.  Creating a mobile app is time consuming and is often done by a different set of developers (not those responsible for data sync). Thus, it is not practical to wait until app development has been completed to test data sync functionality. The data sync teams need a robust way to build sync rules and test these without depending on the mobile app development teams. Additionally, there may be a need to create pre-built CBLite database images and deploy them on mobile devices or read data from a CBLite DB file from another device for debugging or testing.

The traditional way to test is by using the CBLite CLI tool from Couchbase labs. However, this tool does not support a Sync Gateway exposed to the internet over an SSL connection. Moreover, teams may find it non-intuitive to work with a CLI tool to manipulate data in the DB and sync it with the server.

 

I have developed CBLite Tester, a new open source tool that provides a simple way to connect to any Couchbase Sync Gateway and replicate data.

 

This tool goes beyond simple data replication and provides several features that development and testing teams will find very useful while working with Couchbase Sync Gateway. 


Using CBLite Tester

CBLite Tester is available in the form of pre-built binaries that can be downloaded from here.

The CBLite Tester documentation provides complete details about setting up the Tester and working with it. View the documentation

 

The following features are currently supported by this tool:

  • Ability to connect to any Couchbase Sync Gateway and sync data with it
  • Support for certificate pinning to sync with Couchbase Sync Gateways with SSL enabled
  • Support for Sync Gateway continuous replication and one-shot replication modes
  • Support for unidirectional (PUSH, PULL) and bidirectional (PUSH/PULL) sync 
  • Ability to view and search documents replicated from Sync Gateway
  • Ability to edit documents and sync them with Couchbase Server
  • Support for selecting specific Sync Gateway channels to sync with
  • Ability to import and use data within a CBLite DB file residing in another device like a mobile client
  • Ability to create pre-built DB images containing the initial data load that can be deployed to mobile devices 


A complete list of features and details on how to use them can be found in the tool documentation. It also includes a future roadmap for features that are in development.

For any questions about the tool or to report any issues or feature enhancements, please create a ticket here.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter


Categories