Couchbase Workshop�Overview��Introduction to Couchbase Lite
and Couchbase Lite Vector Search
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
1
Data is created at the edge
Phones, sensors and IoT devices constantly generate data at the edge
The global edge computing market is projected to grow from $15.96 billion in 2023 to $216.76 billion by 2032
2
Why process data at the edge?
3
4
Couchbase Mobile: product stack
Cloud to edge to device
Couchbase Server
Scalable, performant
NoSQL data platform
Secure gateway for data �sync and access control
Sync Gateway
Full featured NoSQL
embedded database
Couchbase Lite
Deploy Fully Managed
Deploy Self-Managed
Public Cloud
Private Cloud
Cloud Edge
On Prem
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2024. All rights reserved.
5
Couchbase Mobile | Serve to the Edge
Couchbase Server
Sync Gateway
Mobile App
COUCHBASE LITE
Embedded App
COUCHBASE LITE
Full Featured NoSQL
Embedded Database with CRUD, Query & Search functionality
SYNC GATEWAY
Secure Gateway for Data Sync over the web & Access Control
COUCHBASE SERVER
Highly scalable, available & high-performance NoSQL �database server
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2024. All rights reserved.
6
Couchbase Lite/Mobile features
SQL, Search, Eventing
Peer-to-Peer Synchronization
Efficient Replication Protocol
Predictive Queries
On-Device Encryption
Delta Synchronization
Full Featured Embedded Database
Online and Offline Modes
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
7
Couchbase Sync Gateway
Security & Privacy
Guaranteed High Availability
Bi-directional Replication Protocol
Improved Supportability
Statistics for Monitoring
Unified Web/Mobile
Experiences
Bi-directional Data Sync
Efficient and secure synchronization of data between edge and the cloud
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
8
Couchbase Mobile | Cloud-to-Edge-to-Device
CENTRALIZED
CLOUD
EDGE�DEVICES
ALERT
Tablet
Laptop
Smartphone
Capella/
Couchbase Server
App Services/
Sync Gateway
IoT Device
Couchbase �Server
Couchbase
Sync Gateway
ALERT
Tablet
Laptop
Smartphone
IoT Device
Couchbase �Server
Couchbase
Sync Gateway
Devices running Couchbase Lite (Peer-to-Peer Sync)
Outposts
Wavelength
Local Zones
Azure Public MEC
Azure Private MEC
Google Distributed Cloud Edge
Web App
On Prem,
Private DC
5G edge
EDGE
DATA CENTER
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
9
Edge Architecture Isolates Apps from Outages
CENTRALIZED
CLOUD
EDGE�DEVICES
ALERT
Tablet
Laptop
Smartphone
IoT Device
Couchbase �Server
Couchbase
Sync Gateway
ALERT
Tablet
Smartphone
Couchbase �Server
Couchbase
Sync Gateway
Outposts
Wavelength
Local Zones
Edge Zone
Edge Zone w/ Op
Private Edge Zone
Google Distributed Cloud
Internet or Data
Center Outage
Apps Using Edge DC
Continue To Operate
Laptop
IoT Device
Devices running Couchbase Lite (Peer-to-Peer Sync)
On Prem,
Private DC
5G edge
EDGE
DATA CENTER
Web App
Capella/
Couchbase Server
App Services/
Sync Gateway
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
10
Edge Architecture Isolates Apps from Outages
CENTRALIZED
CLOUD
EDGE�DEVICES
ALERT
Tablet
Laptop
Smartphone
IoT Device
Couchbase �Server
Couchbase
Sync Gateway
ALERT
Tablet
Smartphone
Couchbase �Server
Couchbase
Sync Gateway
Outposts
Wavelength
Local Zones
Edge Zone
Edge Zone w/ Op
Private Edge Zone
Google Distributed Cloud
Internet or Data
Center Outage
Edge Data Center
Outage
Apps With Embedded Database Continue To Operate
Devices running Couchbase Lite (Peer-to-Peer Sync)
On Prem,
Private DC
5G edge
EDGE
DATA CENTER
Web App
Capella/
Couchbase Server
App Services/
Sync Gateway
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
11
Couchbase supports AI from cloud to edge
Cloud
Edge
Edge Data Center
Data Center
Internet
Apps & Services
ISP | 5G | LAN
Personal Area Network
Apps & Services
Architecture
Couchbase
Couchbase
sync
sync
sync
Couchbase Lite
Device
Server
Cloud
Edge
Vector Search
Columnar Analytics
Sync
Hosted
Self-managed
Device
Couchbase Lite
Vector Search
Predictive Query
First in the industry to announce vector search support for all 3 deployments: cloud, on-prem, mobile
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2024. All rights reserved.
12
Advantages to run Vector Search with Couchbase Mobile
AI at the Edge is the only way to scale Gen AI Applications
Architecture to support vector search in edge
image
Media Search Application
| Data engineers employ recommendation algorithms to create embedding models that incorporate both user and product data. |
| Uploads JSON documents (text with embedding vector) to the Data Service to load corpus. The image can be stored as a reference. |
| Search Service receives mutations (upsert or delete) JSON document. maintains indexes across partitions & nodes. |
| Application sends media (in this case an image) to Embedding Model to get vector. |
| Embedding Vector is returned to the application . |
| Embedding Vector is sent to the Search Service as a request to get similar vectors. . |
| Search Service returns top k-NN results of query with returns references to similar images. This ranked as per hybrid search.. |
| Application retrieves images by reference (or id) either from original store or from the Data Service depending on design. |
Couchbase Lite
Search
Data Service
Search Service
Vector
Search
Index
Embedding Model
similar image id(s)
1
2
3
1
image
2
DCP
3
4
5
6
7
image &
vector
Ranked Similar Media Items
7
matching or similar images
images
5
vector
4
vector
6
8
8
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
14
Demo for the rest of the Workshop RAG with Couchbase Lite
| Application creates vector index |
| Application sends documents to embedding model and adds vectors to JSON documents |
| Application creates./updates JSON documents ( text with vector) to Couchbase Lite |
| This triggers update to vector search index on Couchbase Lite that updates index with document. |
| Application sends “query text” to Embedding Model |
| Embedding Model returns embedding Vector |
| Application calls Couchbase Lite Service with a pure Vector search and fetches docs specific to user. |
| Couchbase Lite returns top k-NN results of query with requested fields or objects. |
| Application sends results of query as context to LLM for more accurate responses |
RAG Search Application running on edge device with embedded Couchbase Lite
Couchbase Lite
JSON
Documents
Application Search Feature
Document Storage
Vector Search Index
search query
Embedding Model
1
2
4
3
text*
query
text
5
vector
6
7
text &
vector
0
2
3
4
5
6
7
1
CBL
API
Query
*Can be any media
relevant data
Large Language Models (LLMS)
LLM request
LLM response
8
8
MediaPipe is Google's open source cross-platform framework for building perception pipelines
Widely used at Google in research & products to process and analyze video, audio and sensor data:
Dataset preparation pipelines for ML training
ML inference pipelines
You can now run LLMs like Gemma2 on Android using MediaPipe LLM inference API
You will convert an LLM like Gemma into a Mediapipe format using the MediaPipe toolkit to be able to be supported on running it on Android
Introduction to MediaPipe
Take a base LLM like Gemma
Convert it into a format that can be run on Android using the MediaPipe LLM inference
If you use a model outside of the default models supported by Google Edge AI, you have to use the converter.ConversionConfig method to convert the model in a format supported by MediaPipe LLM inference API
Then call the LLM in Android
Introduction to MediaPipe
Couchbase Sync Gateway
Security & Privacy
Guaranteed High Availability
Bi-directional Replication Protocol
Improved Supportability
Statistics for Monitoring
Unified Web/Mobile
Experiences
Bi-directional Data Sync
Efficient and secure synchronization of data between edge and the cloud
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2023. All rights reserved.
18
Capella App Services
Confident
ial and Propri
etary. Do not distribute without Couchbase consent. © Couchbase 2022. All rights reserved.
33
Scalable, performant NoSQL Data Platform
Couchbase Server Sync Gateway
Secure gateway for data sync and access control
Full Featured NoSQL Embedded Database
Couchbase Lite
Fully managed backend that brings the power of Couchbase Mobile’s industry leading offline-first data sync capability to Capella
FULLY MANAGED
FLEXIBLE DEPLOYMENT
COUCHBASE MOBILE STACK
Public Cloud
Private Cloud
On Prem
Cloud Edge
Capella App Services
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2022. All rights reserved.
DBaaS
App Services
Websockets
REST
Couchbase Lite
Couchbase Lite
Mobile, Desktop, Embedded Apps
OFFLINE FIRST SYNC
Secure Data Sync
Browser, Desktop, Mobile Apps
Couchbase Lite
CLOUD DATA ACCESS
Secure Public Data Access
Mobile, Desktop Apps
Couchbase Lite
Couchbase Lite
PEER-TO-PEER WITH CLOUD SYNC
Secure Data Sync
Sync Gateway
Couchbase Server
20
Demo: How to setup App Services in Capella + Setting up Replication
For reference: https://developer.couchbase.com/android-kotlin-replication-app-services
21