Today we’re announcing the general availability of Couchbase Mobile 2.7. Coming in a few months after Couchbase Mobile 2.6, this release continues to deliver on our goal of releasing high-priority features in a timely fashion. In this release we’ve introduced support for Java (non-Android) in Couchbase Lite and implemented a series of architectural enhancements that vastly improve the write scalability of Sync Gateway, making it well-suited to address the growing needs of large mobile deployments. In addition, the Predictive Queries feature is now GA!  Introduced as a Developer Preview feature in Couchbase Mobile 2.5, the Predictive Queries API allows mobile applications to leverage pretrained machine learning models to run predictive queries against your database in a convenient, fast, and always available way.

Couchbase Mobile extends the power of Couchbase to the edge, securely managing and syncing data from any cloud to edge devices or directly between edge devices. In this post, I discuss the main features in the Couchbase Lite and Sync Gateway platforms. In addition, there are a number of bug fixes and minor enhancements that are discussed in the platform-specific release notes.

Couchbase Lite

Java Support

In 2.7, we’re introducing support for Java (non-Android) for use in desktop and server applications. With the new Java API, you can use Couchbase Lite as an embedded database to enable offline-first support within your Java desktop application built with a UI framework such as Swing UI. You can also embed Couchbase Lite within your Java servlet running within the context of a web container such as Tomcat or Jetty. In the latter case, your Java-based web server can expose a suitable RESTful interface that will allow it to serve other external clients. 

Couchbase Lite, running within the context of the web service, can now be used as a shared data store by multiple external clients and applications. This is particularly relevant in the context of edge computing, which is growing in relevance as businesses seek to bring compute and storage closer to the edge for High Availability, improved response times, reduced bandwidth costs, and adherence to data privacy restrictions.

With the exception of the init function, the API between the Android and non-Android versions of Couchbase Lite is identical. So if you’re already working with Android-based apps powered by Couchbase Lite, the new Java platform API should feel second nature. By aligning the APIs, you can also reuse the data access object (DAO) layer across your Android and non-Android Java apps, which vastly simplifies development.

With the addition of the new Java platform, we continue to make it easier for developers to build applications with offline-first support for a wide range of platforms spanning mobile (iOS, Android, Windows), desktop (.NET, Java, C), and cross-platform/hybrid environments (Xamarin, Ionic, Cordova, Electron).

Of course, the best way to get a feel for the new API is to try it out. So head over to our Java documentation for a detailed description of the new platform API with informative code snippets.

General Availability of the Predictive Queries API

In Couchbase Lite 2.5 we released a Developer Preview version of the Predictive Queries API. With 2.7, we’re happy to announce the general availability of the API. The Predictive API allows mobile applications to leverage pretrained mobile-optimized machine learning models to run predictive queries against data in your database in combination with predictions made on real-time data. To do this, you register a pretrained machine learning model through the Predictive API and Couchbase Lite uses the registered model to run the predictions. By building a cache of prediction results, Couchbase Lite Predictive Queries deliver consistent response times even as the size of the dataset grows. You can learn more about the API in an upcoming blog post.

Sync Gateway

Write Scaling

In 2.7, we introduce some key architectural enhancements in the Sync Gateway that will significantly improve the throughput of writes. We’ve also improved horizontal scalability to address the growing demands of deployments with tens or thousands of concurrent writes per second. This includes the processing of mutations that come in from Couchbase Lite clients replicating with the Sync Gateway, as well as writes that are made via the Sync Gateway REST API.

In our internal tests, we’ve observed up to 2x improvement in per-node write throughput. While the default configuration should work for most deployments, we also support advanced configuration options that allow you to fine-tune for optimal performance. You can read more about the write scale enhancements in our documentation.

Import Scaling

In addition to the write scale enhancements discussed above, we’ve also significantly improved the performance of writes coming in from Couchbase Server that are imported by the Sync Gateway (aka “import processing” or “shared bucket access”). The improvement in import throughput makes server data available to be synced to the clients much sooner. This is particularly important for the high volume import of data during initial startup or the periodic maintenance phase.

In addition to increasing the per-node import throughput, the enhancements also enable the ability to scale linearly with a number of nodes. In our internal tests, we observed up to 4x improvement in per-node import throughput that also scales linearly. This implies that you would see a 10x improvement in import throughput for a 3 node cluster in 2.7 compared to earlier versions. While the default configuration should work for most deployments, we also support advanced configuration options that allow you to fine-tune for optimal performance. You can read more about the write scale enhancements in our documentation.

High Availability of Import Processing

Until now, we recommended that deployments designate exactly one Sync Gateway node in the cluster for import processing. This was to avoid the overhead incurred as a result of redundant processing of the imported documents by all the nodes in a cluster. However, this meant there was no failover or high availability (HA) of the import node in a cluster if it went down.

In 2.7, import processing is automatically sharded across all the Sync Gateway nodes in a cluster. That way, even if the import node goes down, the import shard corresponding to the failed node is automatically picked up by other nodes in the cluster. That way, import processing can continue uninterrupted with the other nodes in the cluster. Now your deployments can be truly homogeneous with identical configurations. In addition to HA, the sharding of import processing also results in improvements in write performance as discussed earlier.

The system supports advanced configuration options to control the sharding of the import processing. You can learn more about this in our documentation.

Next Steps

In this post we covered key features in Couchbase Mobile 2.7. Refer to our documentation for a complete listing of all the enhancements and bug fixes. You can download Couchbase Mobile 2.7 today from our downloads page. Our Enterprise Edition is also free to download and use for development purposes. You can learn more in our What’s New page.

Here are some direct links:

If you have questions or feedback, please leave a comment below or feel free to reach out to me via Twitter or email.

Posted by Priya Rajagopal , Principal Product Manager

Priya Rajagopal is a Principal Product Manager for Couchbase focusing on the Couchbase Mobile and IoT platform. She has been professionally developing software for 20 years in several technical leadership positions, with the last 8 years focussed on mobile technologies. She is a co-inventor on 22 patents spanning areas of networking and platform security.

Leave a reply