Embedded Databases
Embedded databases are lightweight, self-contained databases that run within an application rather than relying on a separate server
SUMMARY
An embedded database is a lightweight, in-process database integrated directly into an application, making it ideal for mobile, always-on, and edge deployments where performance, offline access, and minimal resource use are essential. Unlike traditional databases that run as separate servers, embedded databases operate locally, require no separate installation, and are optimized for single-user or localized environments. Key features include ACID compliance, local data storage, on-device search, and built-in synchronization. Embedded databases are widely used in healthcare, retail, field services, and IoT where connectivity cannot be assumed. Choosing the right one depends on data model, platform compatibility, performance, offline support, sync architecture, and long-term vendor commitment.
What is an embedded database?
An embedded database is a lightweight database that runs in-process within an application on the same device and requires no separate server or network connection. It stores data locally, enabling fast reads and writes, always-on operation, and optional sync with a cloud or server backend when connectivity is available. Embedded databases are commonly used in mobile apps, IoT devices, edge systems, and point-of-sale terminals where connectivity can’t be assumed.
Keep reading to learn how embedded databases compare to traditional databases, how they differ from local and on-device databases, and what to look for when evaluating one, including key features, benefits, and use cases.
- How embedded databases compare to traditional databases
- Embedded, local, and on-device databases: What’s the difference?
- What is an embedded system?
- How embedded systems and embedded databases differ
- What features do embedded databases have?
- What are the benefits of embedded databases?
- How embedded databases power always-on applications
- How sync keeps local data consistent with the cloud
- How embedded databases work at the edge
- What are the use cases for embedded databases?
- How do embedded databases compare?
- How to choose an embedded database
- How Couchbase implements embedded database capabilities
- Key takeaways and related resources
- FAQs
How embedded databases compare to traditional databases
Embedded and traditional databases serve different purposes depending on an application’s needs. Embedded databases are designed for simplicity and local use, while traditional databases are built for larger, multi-user environments with centralized infrastructure.
| Feature | Embedded database | Traditional database |
|---|---|---|
| Integration | Integrated into the application | Runs as a separate server or service |
| Process | In-process (same as app) | Out-of-process (separate from the app) |
| Installation | No separate installation required | Requires separate installation and setup |
| Use case | Mobile, desktop, IoT, local apps | Web apps, enterprise systems, multi-user apps |
| Performance | Fast for local, single-user access | Optimized for high concurrency and large scale |
| Scalability | Limited locally (see note below) | High scalability and concurrency |
| Network access | Not required | Typically accessed over a network |
| Examples | Couchbase, SQLite, LevelDB | MySQL, Oracle, Microsoft SQL Server |
| Data management | Managed by the host application | Managed independently by a database server |
Note on scalability: Limited locally describes single-device capacity, not system-wide scale. Embedded databases extend system scalability through sync to a cloud or edge backend that handles large-scale concurrency and capacity. A single device running an embedded database can support millions of users when combined with a sync architecture.
Embedded, local, and on-device databases: What’s the difference?
The terms embedded, local, and on-device are often used interchangeably, but they describe different things. Understanding the distinction matters when choosing the right architecture for your application.
Embedded describes architecture. An embedded database runs in-process alongside the application with no separate server.
Local and on-device describe where the database and its data run, not how the database is integrated with the application. The data is stored on the same machine or device as the application rather than in the cloud or on a remote server. A local database can be embedded, but it doesn’t have to be. For example, SQLite is a local, embedded database because it runs inside the application. A traditional database server can also run locally on the same machine as the application, but because it runs as a separate server process, it isn’t embedded.
In mobile and edge contexts, the practical question is whether the database runs inside the application’s process, persists data without a network connection, and can sync that data to a backend when connectivity is available. An embedded, local, sync-capable database gives an application all three properties at once.
These distinctions matter when comparing options. SQLite is embedded and local but has no built-in sync. A cloud-hosted database is neither embedded nor local. Couchbase Lite is an embedded NoSQL database for iOS, Android, and JavaScript that stores data locally, supports SQL++ queries and vector search, and syncs automatically with the cloud through Couchbase Mobile.
What is an embedded system?
An embedded system is a specialized computing system designed to perform dedicated functions within a larger device or application. Unlike general-purpose computers, embedded systems are typically resource-constrained and optimized for efficiency, reliability, and real-time performance. They appear in smartphones, medical equipment, industrial machinery, and IoT sensors where they control specific tasks or processes. Because they often operate in environments with limited connectivity and computing power, embedded systems benefit from integrated, lightweight solutions like embedded databases for local data processing and storage.
How embedded systems and embedded databases differ
An embedded system controls hardware or performs a specific function within a device. In a smart thermostat, the embedded system reads temperature sensors, adjusts heating or cooling, and manages the user interface.
An embedded database, by contrast, manages data locally within that embedded system. In the same thermostat, the embedded database could store temperature history, user settings, or usage patterns. It enables fast, lightweight data operations without requiring a network connection or an external database server. This allows the device to work without connectivity, store data persistently, and sync with the cloud when needed.
The embedded system runs the device and manages its behavior. The embedded database handles the data that supports and enhances that behavior.
What features do embedded databases have?
Embedded databases are designed to operate within applications, often in resource-constrained environments or those with intermittent connectivity. Key features include:
- Lightweight architecture – Embedded databases use a lightweight architecture optimized for small footprints and low memory usage, making them ideal for mobile apps, IoT devices, and edge systems.
- ACID compliance – ACID support ensures data remains reliable and consistent even during power loss or system failure.
- Local data storage – Data is stored directly on the device, enabling fast access and always-on functionality without relying on a remote server.
- High-performance read/write operations – Embedded databases are built for speed, delivering low-latency data access for real-time applications.
- Built-in replication and synchronization – Many embedded databases include tools to replicate data across devices or sync with the cloud when connectivity returns.
- Security features – Encryption and authentication options protect sensitive data at rest and in transit, which is critical for healthcare and finance applications.
- On-device search and vector search – Full-text and vector search running locally enable semantic search and AI-powered features without requiring a network connection. This is increasingly important for applications embedding language model capabilities at the edge.
What are the benefits of embedded databases?
Embedded databases offer several advantages that make them well suited for applications that require local data processing, especially in resource-constrained or disconnected environments.
- No external dependencies – Embedded databases run within the host application, removing the need for a separate server or complex infrastructure.
- Always-on functionality – Because data is stored locally, embedded databases enable full application functionality even without network connectivity.
- Faster performance – With data stored and processed on-device, embedded databases offer low-latency read and write operations, ideal for real-time use cases.
- Simplified deployment – Because the database is packaged with the application, you don’t need to install or manage separate database systems.
- Lower resource consumption – Their lightweight design makes embedded databases well suited for devices with limited CPU, memory, or storage capacity.
- Enhanced reliability – Features like ACID transactions and crash recovery help ensure data integrity and consistency even in the event of failure.
- Secure data handling – Many embedded databases support encryption and access control, helping protect sensitive data stored on the device.
How embedded databases power always-on applications
An always-on application reads from and writes to local storage as the primary path, treating network connectivity as an enhancement rather than a dependency. A field technician submitting a work order, a retail associate completing a transaction, or a healthcare worker updating a patient record can all complete their tasks immediately, regardless of whether the network is available.
But local persistence alone isn’t enough. A database that stores data locally when offline and pushes changes to a server when it reconnects will work in the simplest case. However, when two users or two devices edit the same record while both are disconnected, the system needs a strategy for which version wins when they reconnect. This is a conflict-resolution problem, and teams routinely underestimate it as a design decision.
Conflict resolution strategies range from last-write-wins (simple, but can discard valid data) to custom resolution functions (flexible, but require explicit logic per document type). The right strategy depends on the data and the business rules governing it. Choosing an embedded database that supports configurable conflict resolution rather than imposing a fixed strategy gives development teams the flexibility to make the right decision for each collection.
For more on building applications that remain fully functional through network interruptions, see the Couchbase blog on always-on app use cases.
How sync keeps local data consistent with the cloud
Sync is what separates a database that works without connectivity from one that works as part of a distributed system. Local persistence gives the device the data it needs to operate independently. Sync is what brings that data back into consistency with the rest of the system when connectivity is available.
Cloud-to-device sync
The standard path for cloud-to-device sync is for the embedded database on the device to replicate changes to and from a cloud or server backend automatically when connectivity is available. When the device reconnects after a disconnected period, it pushes all local writes to the cloud and pulls all centrally made changes to the device. Conflict resolution is applied automatically based on the configured strategy. This is the model most applications use and the most straightforward to implement.
Peer-to-peer sync
Some applications need devices to stay consistent without routing through the cloud. Peer-to-peer sync allows embedded databases on multiple devices to replicate directly over a local network using automatic discovery over IP or Bluetooth. This is useful in environments like retail back offices, hospital wards, factory floors, or field sites where internet connectivity can’t be assumed, but local network connectivity is available. Couchbase Mobile supports peer-to-peer sync with automatic network switching, which means devices shift between cloud sync and peer-to-peer sync as connectivity changes.
Delta sync
Rather than transmitting full documents on every sync cycle, delta sync transmits only the fields that changed. For metered or constrained connections, this significantly reduces bandwidth consumption. For applications operating in areas with expensive or limited data plans, delta sync can be the difference between a viable application and one that’s too expensive to run in the field.
Hosted vs. self-managed sync
Server-side sync can generally be deployed in two ways. A hosted sync service is operated and maintained by a provider, while a self-managed sync service runs within your own infrastructure and gives you greater control over deployment and data.
Capella App Services is Couchbase’s fully managed sync layer, available as part of Couchbase Capella. It handles the operational burden of running sync at scale. Sync Gateway is the self-managed option for teams that need to run sync within their own infrastructure, such as in air-gapped environments or on-premises deployments with specific data residency requirements. Both support cloud-to-device and peer-to-peer sync, conflict resolution, and fine-grained access control.
How embedded databases work at the edge
Edge deployments share the core requirement of always-on local databases but add the constraints of latency sensitivity, bandwidth cost, and intermittent connectivity. In some cases, data sovereignty requirements may also prevent data from leaving a specific geographic region or physical boundary.
The right database tier for an edge deployment depends on the scale and requirements of the local deployment.
On-device (Couchbase Lite)
An on-device database runs directly on an end device, such as a phone, tablet, kiosk, or IoT sensor. The database is embedded within the application and is well suited for single-device workloads where the application and database run in the same process.
Couchbase Lite is Couchbase’s on-device database offering, designed for applications that need local data access, including mobile apps, wearables, and point-of-sale terminals.
In-store server for multi-terminal locations (Couchbase Edge Server)
An in-store edge server is a lightweight database server deployed on-site, typically on a back-office machine or local server, that serves multiple client devices. This model is useful when several devices at a location need a shared, always-consistent local data layer rather than maintaining separate databases that could diverge.
Couchbase Edge Server is Couchbase’s offering for this type of multi-device edge deployment. It provides a local database layer for environments such as retail locations, manufacturing sites, and hospitals.
Full server at the edge (Couchbase Server)
A full server at the edge is a complete database deployment running at an edge data center or other local facility. It serves large numbers of clients at a single location or across a cluster of locations.
Couchbase Server is Couchbase’s full-featured database platform for these larger edge deployments where the scale and requirements of the workload justify the operational complexity of running a full database server.
Edge AI represents an emerging and increasingly practical use case for embedded databases with vector search. On-device vector search enables RAG pipelines and semantic search features to run locally, using a locally stored embedding index rather than calling a remote API. For more detail, see vector search at the edge with Couchbase Mobile and the edge AI Concepts page.
What are the use cases for embedded databases?
Embedded databases suit applications that need to store and process data locally, often with limited resources or intermittent connectivity.
- IoT devices – Embedded databases store sensor data locally on smart devices such as thermostats, wearables, or industrial monitors, enabling real-time analytics and always-on operation.
- Mobile applications – Apps on smartphones and tablets use embedded databases to cache content, store user data, and maintain full functionality without internet access.
- Edge computing – In edge deployments, embedded databases enable local data processing close to the source, reducing latency and bandwidth usage while improving responsiveness.
- Medical and healthcare devices – Portable diagnostic tools and patient monitoring systems use embedded databases to securely store medical data and maintain reliability in critical environments.
- Retail and point-of-sale systems – Embedded databases power always-on transactions, inventory tracking, and customer data management when network connectivity is limited or unavailable.
- Industrial automation and control systems – Embedded systems in factories or equipment log data, manage configurations, and operate autonomously using on-device databases.
Companies across industries use Couchbase embedded databases to support applications that need reliable data access, even when connectivity is limited or unavailable. For example, PepsiCo uses Couchbase Mobile for frontline sales and supply chain operations across 30,000 users, enabling field representatives to process orders and access product data regardless of connectivity. Carnival Corporation runs on-vessel applications with 100% uptime requirements using an approach that keeps critical guest services and operational systems available even when a ship is outside satellite coverage.
How do embedded databases compare?
Embedded databases differ in data model, platform support, always-on capability, sync, ACID compliance, and long-term vendor commitment. The table below compares six commonly evaluated database options.
| Database | Data model | Platform support | Offline support | Sync capability | ACID compliance | Notable features |
|---|---|---|---|---|---|---|
| Couchbase Lite | Document (JSON) | iOS, Android, Windows, Linux, macOS | Yes | Yes (Sync Gateway / Capella App Services) | Yes | Peer-to-peer sync, vector search, flexible schema, actively developed |
| SQLite | Relational | Cross-platform | Yes | No built-in (see note) | Yes | Lightweight, file-based, widely adopted |
| LevelDB | Key-value | Cross-platform | Yes | No built-in (see note) | No | High performance, simple API |
| Berkeley DB | Key-value | Cross-platform | Yes | No built-in (see note) | Yes | Small footprint, optional SQL interface |
| ObjectBox | Object-oriented | Android, iOS, Linux | Yes | Yes (with Sync add-on) | Yes | High speed, low memory use |
| MongoDB Realm | Document (JSON) | iOS, Android, Windows, Linux, macOS | Yes | Discontinued (support ended Sept 2025) | Yes | End of life (requires migration) |
Note: SQLite, LevelDB, and Berkeley DB can have sync built on top through custom pipelines, but this requires significant engineering investment and ongoing maintenance. Teams evaluating these options should factor in the cost of building and operating that sync layer versus using a platform with sync built in.
For teams migrating from Realm: MongoDB announced the end of life of their Realm mobile database in 2024, with support ending September 2025. If your application relies on Realm for embedded storage and sync, it requires a migration path. See replacing MongoDB Realm With Couchbase Mobile.
How to choose an embedded database
Choosing the right embedded database depends on your application’s specific requirements, environment, and development goals.
Does the data model fit?
Consider whether your application benefits from a relational model or a flexible document or key-value model. Structured data with complex queries often fits best with relational databases, while document or key-value stores offer schema flexibility and faster lookups. For applications that store JSON objects mapping directly to application models, a document database reduces the impedance mismatch between the application and data layers.
Does it support your platforms and languages?
Ensure the database is compatible with your target platforms (iOS, Android, Linux, Windows) and integrates well with your development language and toolchain.
How does it perform under realistic conditions?
Evaluate how the database performs under your expected workload and whether it operates efficiently within the CPU, memory, and storage limits of your environment. Benchmark under realistic conditions, not just synthetic tests.
Does it support always-on operation and sync?
If your application needs to function without connectivity or sync data across distributed devices, look for a database with local storage and built-in sync. Building sync on top of a database that doesn’t include it is a significant ongoing engineering investment.
How does it handle conflict resolution?
For applications that need multi-device or multi-user consistency, evaluate the sync model in detail. How are conflicts detected? What resolution strategies are available? Can resolution logic be customized per document type? Can devices sync directly with each other without routing through the cloud? These questions determine whether the database fits real-world distributed deployments.
Does it meet your security requirements?
Embedded databases in regulated or sensitive environments should support encryption at rest and in transit, plus authentication and role-based access control.
Is the vendor committed to the product long term?
Given recent product discontinuations in this space, evaluate whether the vendor has a clear roadmap, an active community, and a business model that supports long-term investment. A discontinued embedded database creates significant migration cost and risk. MongoDB Realm’s end of life in 2025 is a concrete example of that risk materializing.
How Couchbase implements embedded database capabilities
Couchbase provides a connected data layer across cloud, edge server, and device that addresses the full embedded database requirements of always-on local storage, multi-modal retrieval, low-latency reads and writes, sync with conflict resolution, and security and governance at every tier.
| Requirement | Couchbase capability | Component |
|---|---|---|
| Always-on local storage | Embedded NoSQL database with full CRUD and SQL++ queries | Couchbase Lite |
| On-device vector search | Native vector indexing for RAG and semantic search without network | Couchbase Lite |
| Low-latency reads and writes | Sub-millisecond query latency from embedded storage | Couchbase Lite |
| Cloud-to-device sync | Bidirectional replication with conflict resolution | Couchbase Mobile, Sync Gateway |
| Peer-to-peer sync | Direct device-to-device replication over local network | Couchbase Mobile |
| In-store server tier | Lightweight database server for multi-terminal locations | Couchbase Edge Server |
| Managed cloud backend | Fully managed sync and operational data tier | Couchbase Capella |
| Security and governance | Encryption at rest, fine-grained access control, role-based auth | Couchbase Lite, Couchbase Edge Server, Capella App Services |
Couchbase Lite is an embedded NoSQL database for iOS, Android, JavaScript, Java, .NET, Kotlin, Swift, Objective-C, Flutter/Dart, and C. It stores JSON documents and vector embeddings locally, runs SQL++ queries and similarity searches without a network connection, and supports predictive queries to call local AI models directly.
Couchbase Mobile handles bidirectional sync between Couchbase Lite on devices and the cloud tier, with built-in conflict resolution and peer-to-peer sync support.
Couchbase Edge Server provides a lightweight database server for multi-terminal locations, bridging on-device databases and the cloud.
Couchbase Capella is the fully managed DBaaS available across AWS, Azure, and Google Cloud that serves as the cloud backbone for edge and mobile deployments.
Because Couchbase Lite, Couchbase Edge Server, and Couchbase Capella share the same SQL++ query language and data model, application code is consistent regardless of which deployment tier is used.
Key takeaways and related resources
- An embedded database runs in-process within the host application on the same device, with no separate server required.
- Embedded databases are designed for resource-constrained environments such as mobile apps, IoT devices, and edge computing systems.
- Embedded databases differ from traditional databases because they are in-process, lightweight, and optimized for single-user or localized use cases. Scalability extends through sync to a backend, not through local concurrency.
- ACID compliance and fast performance make embedded databases reliable for real-time applications in demanding environments.
- Embedded systems handle device functionality, while embedded databases manage the local data that supports that functionality.
- Key features include low memory usage, local storage, security options, optional sync capabilities, and on-device vector search for AI-powered features.
- In addition to local storage, always-on applications also require sync with conflict resolution. Two devices editing the same record while disconnected must reconcile correctly when they reconnect.
- On-device vector search enables RAG pipelines and semantic search without network dependency, making embedded databases a practical foundation for edge AI applications.
- Long-term vendor commitment matters. MongoDB Realm’s end of life in 2025 shows that embedded database products can be discontinued with limited notice, creating significant migration costs.
- Couchbase Lite, Couchbase Edge Server, and Couchbase Capella share the same SQL++ language and data model across device, in-store, and cloud tiers, so application code is consistent regardless of deployment.
Related resources:
- Couchbase Lite
- Couchbase Mobile
- Couchbase Edge Server
- Sync Gateway
- What Is Edge AI? Edge Computing Examples and Benefits
- Replacing MongoDB Realm? Offline-First App Use Cases With Couchbase Mobile
- Vector Search at the Edge With Couchbase Mobile
- Mobile Edge Computing (MEC)
FAQs
What is an embedded database? An embedded database is a lightweight database that runs in-process within an application on the same device and requires no separate server or network connection. It stores data locally, enabling fast reads and writes, always-on operation, and optional sync with a cloud or server backend when connectivity is available. Embedded databases are commonly used in mobile apps, IoT devices, edge systems, and point-of-sale terminals where connectivity can’t be assumed.
What’s the difference between an embedded database and a local or mobile database? Embedded describes the architecture. The database runs inside the application’s process with no separate server. Local and on-device describe where data lives, which is on the machine or device rather than in the cloud. A database can be local without being embedded. For example, a full database server running on the same machine as the application is local but not embedded.
Why do always-on apps need a local database? Always-on applications treat local storage as the primary data path, and network connectivity is an enhancement, not a requirement. This allows the application to keep working even when the network is slow or unavailable. However, local storage alone isn’t enough. When two devices change the same record while offline, those changes may conflict when the devices reconnect. An embedded database with built-in sync and configurable conflict resolution handles this situation automatically. With a database that only provides local storage, the application developer must solve the conflict-resolution problem.
How does data sync between an embedded database and the cloud? Sync replicates changes between the embedded database on the device and a server or cloud backend. The three main sync models are: (1) cloud-to-device sync (automatic replication when connectivity is available, with conflict resolution applied), (2) peer-to-peer sync (devices replicate directly with each other over a local network without routing through the cloud), and (3) delta sync (only changed fields are transmitted rather than full documents, reducing bandwidth on constrained connections). Couchbase Mobile supports all three models through Sync Gateway (self-managed) or Capella App Services (fully managed).
What is the best embedded database for mobile apps? The right choice depends on the application’s requirements. For applications that need only simple local storage with no sync, SQLite is lightweight, widely supported, and often sufficient. For applications that need schema flexibility, full-text or vector search, built-in cloud sync, and peer-to-peer sync across devices, Couchbase Lite is purpose-built for those requirements. ObjectBox is a strong option for applications that use an object-oriented data model and have low memory constraints. Teams should also evaluate long-term vendor commitment: MongoDB’s discontinuation of Realm in 2025 showed that embedded database products can be discontinued with limited notice.
What replaced MongoDB Realm? MongoDB discontinued Realm, with support ending in September 2025. Teams migrating from Realm typically move to Couchbase Lite, which provides the same core capabilities. These include an embedded NoSQL database for iOS and Android with local storage, SQL++ queries, and bidirectional sync to a cloud backend. Couchbase Mobile provides the sync layer equivalent to Realm Sync.
Why do edge deployments need embedded databases? Edge deployments face four constraints that make local data persistence essential: (1) latency sensitivity (a cloud round trip adds delay that edge applications cannot afford), (2) bandwidth cost (transmitting all data to and from a central server is expensive at scale), (3) intermittent connectivity (networks at factory floors, retail locations, and field sites are not guaranteed), and in some cases (4) data sovereignty (regulations may prohibit data from leaving a specific region or facility). An embedded database at the edge allows an application to operate fully locally, with sync to a central backend handled automatically when connectivity is available.