Release 1.0 of Couchbase for mobile was announced in 2014, making it the industry’s first NoSQL mobile database for offline first applications. Offline first is an application development paradigm that ensures that the functionality of the apps is unaffected by the state of network connectivity. In recent years, a distributed computing framework called edge computing has gained a lot of traction with the emergence of real-time business-critical applications and services that must be responsive, resilient to network disruptions, use network bandwidth efficiently, and are required to comply with privacy and regulatory policies. You can learn more about distributed cloud architectures and use cases in this related whitepaper.

If you think about it, the core tenets of edge computing are fundamentally the same as those of offline first business critical mobile apps – speed, availability, scalability, and data privacy and security. Since it was first released several years ago, Couchbase platform has been used in numerous real world production deployments requiring offline first mobile apps, so extending the platform to support edge computing is a natural next step.

Couchbase for Offline First Mobile Apps

In order for users to be able to use mobile apps in offline mode, the data required by those apps needs to be persisted locally instead of on remote cloud servers. This requires local storage that can be embedded within the mobile apps themselves. Couchbase Lite is a full-featured embedded NoSQL JSON database that natively supports all the major mobile platforms, including iOS, Android, and Windows.
In addition to providing local embedded storage, Couchbase Lite also ensures that the data in local storage is consistent with the cloud backend database. The Couchbase Sync Gateway allows secure data routing and data synchronization between Couchbase Lite enabled clients and the backend Couchbase Server database.

With the Couchbase Lite and Sync Gateway products, you can enable both of the core capabilities of offline first apps, local storage and sync.

Couchbase for Edge Computing

Edge computing is a distributed computing framework that distributes data storage and processing, bringing it closer to the apps that generate or consume the data. The storage and processing of data and movement of data between the data storage entities are two key attributes of a solution. A data platform such as Couchbase fits the bill perfectly.

The “edge” in edge computing applications refers to the place where data is generated and processed. As such, the edge is a spectrum. It can be a standalone device such as smartphone, tablet, PoS terminal, laptop, IoT device, etc. Or it can be an aggregation point for data generated and consumed by a number of downstream clients. In the latter case, the edge could be a micro data center. The number of edge data centers required can range from a few hundred to several thousand depending on the application.

Distributed Cloud Architectures

Couchbase is the ideal data platform for supporting cloud-to-edge and distributed cloud architectures because it includes all the required components in one integrated solution. In addition to data storage and flexible deployment capabilities which allow data to be stored and processed on any public/private cloud or on-prem data centers, it also provides sync technology that can scale to hundreds of thousands of concurrent edge clients and edge data centers.

Edge computing deployments can be normalized into three architectures: the edge at the client tier, the edge at the intermediate tier, and a hybrid model that spans both tiers. I’ll discuss all three architectures below.

The Edge at the Client Tier

The simplest model of the “edge” is a standalone device. In this architecture, the data is processed locally by the applications that generate or consume it. As long as the client is up, you get 100% availability because your application is always on, even if the internet connection to the backend cloud data center is disrupted. Since all the data is processed locally, you get real-time responses. Finally, any sensitive data generated by the app never has to leave the client device, which alleviates any privacy concerns.

How does Couchbase fit in?

  • Cloud tier:
    Couchbase Server is deployed in the cloud data center and serves as the elastically scalable, global data storage and processing platform for connected clients.
  • Client tier:
    Couchbase Lite is deployed at the edge and is responsible for local data processing. While Couchbase Lite originally launched as a mobile-first database, it has evolved over the years to support .NET for Windows desktop applications and Java for desktop and web services applications. There is also a community-supported version of C API Bindings. This implies that Couchbase Lite is not restricted to just mobile apps. You can deploy Couchbase Lite on mobile, desktop, or any embedded device that has the resources to locally store and process data.

The Sync Gateway deployed in the cloud data center, securely handles bidirectional data sync between the cloud-based backend Couchbase data store and Couchbase Lite clients.

Edge Computing Couchbase Lite embedded in mobile

Deployment model

A typical deployment looks like this:

Edge Computing Couchbase Lite embedded in mobile

What about the case when clients that do not have resources to handle local storage or data processing? For that, we look at the next model.

The Edge at the Intermediate Tier

This model extends the previous model by introducing an Intermediate tier between the cloud and client tier. The intermediate tier is on the same local area network (LAN) as the clients. It acts as a data aggregator, and could be a gateway device or a server in an IT closet. With the intermediate tier, the edge is a micro data center, managing data on behalf of a smaller population of downstream clients on the local network.

The client tier doesn’t handle any local data storage or processing. Similar to the edge at the client tier model, this model offers higher guarantees on application availability than a cloud-centric model because the LAN over which clients communicate is inherently more reliable than the internet connection to the cloud data center. Moreover, by pulling down data on behalf of downstream clients, the intermediate tier significantly reduces the load on the network and on the cloud servers by avoiding the need for every downstream client device to pull down the same data.

How does Couchbase fit in this model?

  • Cloud tier:
    As in the previous model, Couchbase Server and Sync Gateway are deployed in the cloud data center.
  • Intermediate tier:
    Here, there are two options:

    • Option 1:
      Couchbase Server and Sync Gateway are deployed at the edge data center. The footprint of the server and gateway are scaled down appropriately to handle the smaller footprint of local clients. The number of data centers can range from a few hundred to thousands. Data is securely synced between the cloud and edge data centers using inter-Sync Gateway replication technology
    Couchbase Lite web server for Edge Computing
    • Option 2:
      Couchbase Lite is embedded in a web services app such as a Java web server. The web services app can implement a RESTful interface that is accessed by the downstream clients. The number of data centers can range from a few hundred to the tens of thousands.

    Data is securely synced between the Couchbase cloud-based backend store and Couchbase Lite clients through the Sync Gateway. This model is similar to the edge at the client tier approach.

    Couchbase Lite web server for Edge Computing

Deployment model

  • Option 1:
    A typical deployment corresponding to Option1 looks like this:
    Micro data center deployment with Couchbase
  • Option 2:
    A typical deployment corresponding to Option2 looks like this:
    Micro data center deployment with Couchbase
  • Client tier:
    There is no Couchbase in this tier. These are apps or clients that don’t support local data storage or processing.

To get the best of both the models, we look at an hybrid approach.

The Hybrid model: Edge Spanning Client and Intermediate Tiers

Architecturally, this model is the same as the previous model in that there’s an intermediate tier between the cloud and client tiers. However, in this model the data is stored and processed both at the client tier and the intermediate tier, giving you the benefits of both the previous models. In fact, the client tier could switch to connecting to the servers in the cloud tier and intermediate tier depending on network conditions.

So how does Couchbase fit in this model?

  • Cloud tier:
    As in the previous models, Couchbase Server and Sync Gateway are deployed in the cloud data center.
  • Intermediate tier:
    Couchbase Server and Sync Gateway are deployed at the edge data center. The footprint of the server and gateway are scaled down appropriately to handle the smaller population of local clients.
  • Client tier:
    Couchbase Lite is deployed at this tier and is responsible for local data processing.

Data is then securely synced between the cloud and the edge data centers using inter-Sync Gateway replication technology. Data is also synced between the Sync Gateway at the edge data center and the downstream Couchbase Lite enabled clients.

Micro data center deployment with Couchbase

Deployment model

A typical deployment looks like this:

Micro data center deployment with Couchbase

Choosing the Right Architecture for Edge Computing

The choice of deployment architecture for your edge computing needs depends on several factors, including the use case, the storage and compute capabilities of the client or the edge data center, and the number of concurrent edge devices or edge data centers.

The following table describes how the three models stack up against the major tenets of Edge computing. This information isn’t intended to be prescriptive, but should be treated as a general guide.

ArchitectureApp availabilityResponsivenessBandwidth usagePrivacy
Edge at the client tier100% as long as client device is upReal time because data is locally stored/processed at clientUpstream bandwidth savings because data is locally processed at clientData doesn’t have to leave the client device
Edge at the intermediate tierAvailable as long as local network is upNear real time with some latency introduced in LANUpstream and downstream bandwidth savings because edge data centers can act as CDNs for downstream clientsData doesn’t have to leave the edge data center
Edge spanning client & intermediate tiers100% as long as client device is upReal time because data can be locally stored/processed at clientUpstream and downstream bandwidth savings as edge data centers can act as CDNs for downstream clientsMultiple levels of security, and data doesn’t have to leave the client device

Resources

Here are a links to some related resources:
Download Couchbase

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