DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Picking a Database for Embedded Systems
ObjectBox.io for ObjectBox

Posted on • Updated on

Picking a Database for Embedded Systems

Exploring Today's Embedded Database Marketplace

With the increasing demand for higher computing capabilities, embedded databases are becoming more important in today's technological landscape. The market for embedded systems is expected to grow from USD 100.33 billion in 2020 to USD 137.7 billion by 2028.

"Embedded" in the database world

The term "embedded" can have two different meanings when talking about databases:

  1. "Embedded database" means that the database is deeply integrated into the software and does not require a server. Also known as an "embedded database management system”( or embedded DBMS for short)

  2. A "database for embedded systems" is a database designed specifically for use in embedded systems. These are systems made up of tightly integrated hardware and software, such as electronic control units (ECUs), Internet of Things (IoT) devices, or smartphones. A database for such systems must be small and optimised to run on low-resource hardware (e.g. restricted CPU, memory, battery). In these use cases, a high-performance database is usually a top priority to get the most out of these restricted devices.

The fact that these terms are used interchangeably may cause some confusion. Not all embedded databases are appropriate for use in embedded systems, and databases used in embedded systems are not necessarily embedded in software. Maintaining a clear distinction between these terms is therefore important.


So, What is an Embedded System Exactly?

Embedded systems are ubiquitous today. They are used in most industries, ranging from manufacturing and healthcare, to automotive and consumer electronics. An embedded system is essentially a collection of hardware and software components that are designed to process and control the system's specific tasks. These components include processors, controllers, input-output devices, outer peripheral devices, and many others. Embedded systems are typically limited in terms of CPU, power, memory, and connectivity (WiFi, Bluetooth, ZigBee, and so on). The definition, however, is not linked to hardware constraints, and the landscape is generally heterogeneous.

Embedded systems are frequently components of larger systems, and each embedded system performs a limited number of specific functions within the larger system. Embedded systems, in essence, form a complex decentralised system. ECUs (in cars)smartphones, microcontrollers, cameras, smart watches, ATMs, robots, sensors and many more are examples of embedded systems.


Edge Databases: β€œEmbedded Database” AND β€œDatabase for Embedded Systems”

Because embedded systems frequently have limited resources and are often found in decentralised systems with limited bandwidth, or intermittent or no connectivity , the efficiency and footprint of the local storage alongside smart and efficient data synchronisation are critical. These requirements spawned a new market for databases designed specifically for embedded systems. Embedded databases may often be useful in embedded systems due to their light weight and high performance.

Venn Diagram describing the intersecting space Edge Databases are the most impactful

Edge Databases are typically embedded databases optimised for resource efficiency on restricted decentralised devices (typically embedded devices) with limited resources. New Edge databases solve the challenge of an insanely growing number of decentralised embedded devices, both in the professional / industrial as well as the consumer world. Edge Databases solve data synchronisation out-of-the-box, making the data from these devices easily and efficiently accessible.


Why Would You Use an Edge Database in an Embedded System?

To begin with, local data storage enabled by embedded databases is a significant benefit for typical embedded systems that frequently face connectivity issues (due to device, use case, data protection needs, location, or costs) or operate in real-time scenarios (e.g., on the factory floor or in the car). Because of the limited connectivity or real-time requirements that these systems frequently face, they cannot always be relied on to retrieve data from the cloud. Instead, a clever solution is to keep data on the device locally and only sync it with other parts of the system when necessary and possible.

In addition to handling a lot of data, embedded systems frequently operate with erratic or intermittent connections. So, an effective synchronisation solution should not only sync data whenever a connection is available but empower the developers to choose which data to synchronise when and, moreover, do so as efficiently as possible (minimising data traversal, enhancing speed). For instance, differential sync is effective because it reduces network costs and unnecessary energy use (and thus CO2 emissions) by only sending changes to the server.

The two most important features of databases in embedded systems are performance and reliability. A database designed for use in embedded systems should perform well on devices with limited CPU and memory. This is why embedded databases may perform well in embedded systems; they are largely designed to function in such environments. Because some of them are truly tiny, they thrive in small applications. While improving performance helps to eliminate some risks, it does not help with unexpected power outages. Therefore, a good data recovery procedure is also important.

Let's have a look at the features of embedded databases that make them a great choice for embedded systems.


The Benefits of Embedded Databases

  1. High performance: True embedded databases benefit from a simpler architecture because they don't require a separate server module. Although the client/server architecture benefits from the server's ability to be installed on a more powerful computer, there is an inherent risk that also rises. By removing the client/server communication layer, you can reduce complexity and improve performance.
  2. Reliability: Because many embedded devices run on battery power, a power outage is a possibility. As a result, the data management solution should be designed to ensure that data is completely recovered in the event of a power outage. This is a popular feature of embedded databases designed specifically for embedded systems.
  3. Ease of use and low maintenance: Another significant advantage of using an embedded database is its ease of implementation and small support requirements. Because designing embedded devices frequently necessitates working under time constraints, choosing an out-of-the-box data persistence solution is the best option for many projects. Because embedded databases are directly embedded in the application, they do not require administration and can manage themselves effectively.
  4. Small footprint: Embedded databases aren't always small, but some are as small as 1 MB, making them ideal for mobile and IoT devices with limited memory.
  5. Scalability: As the number of embedded devices grows, so does the volume of data. A good solution should be able to handle large amounts of data as well as adapt to new device features and easily change to meet the needs of a new device. Rigid database schemas fall short in this regard.

How to Choose an EmbeddedΒ Database

The following are the most important factors to consider when selecting an embedded database: ACID (atomicity, consistency, isolation, durability) compliance, CRUD performance, footprint, and data sync.

An In-Depth Examination of the Embedded Database Market

Database solution Primary model Minimum footprint Sync Languages
Berkeley DB NoSQL database; key-value store <2MB No C++, C#, Java, Perl, PHP, Python, Ruby, Smalltalk and Tcl
Couchbase Lite NoSQL DB; document store 1-5MB Sync needs a Couchbase Server Swift, Objective-C, Java (Android), Java (Non-Android), Kotlin, C#, JavaScript, C
extremeDB In-memory relational DB, hybrid persistence < 1 MB No C, C#, C++, Java, Lua, Python, Rust
LMDB Key-value store <1MB No C++, Java, Python, Lua, Go, Ruby, Objective C, Javascript, C#, Perl, PHP, etc
Mongo Realm Object-oriented NoSQL database 5 MB+ Sync only via Mongo Cloud Swift, Objective-C, Java, Kotlin, C#, and JavaScript
ObjectBox Object-oriented NoSQL database <1MB Offline Sync, on-premise Sync, Cloud Sync, p2p Sync is planned C,C++, Java, Kotlin, Swift, Go, Flutter / Dart, Python
RocksDB Key-value store No C++, C, Java, Python, NodeJS, Go, PHP, Rust, and others
SQLite Relational <1MB No C/C++, Tcl, Python, Java, Go, MATLAB, PHP, and more
UnQLite NoSQL; document & key-value store ~ 1.5 MB No C/C++, Python

Selecting an Embedded Database

Several factors must be considered when selecting a database for an embedded system. On highly restricted devices, even small changes in one of these parameters can have a big impact. Even minor variations in one of these parameters can have a significant impact on highly restricted devices. While developing your own solution with a specific device in mind may be feasible, the additional effort and tight deadlines usually do not justify this decision. This is why we recommend using a database, such as ObjectBox, which is designed for embedded system specifics with the added bonus of an efficient data sync solution.

There are several embedded databases that work well on embedded devices. Each has advantages and disadvantages, so you must decide which is best for your application. However, if you have a use case where performance is especially important, ObjectBox outperforms all competitors across all CRUD operations (Create, Read, Update, Delete). ObjectBox is a next-generation infrastructure software for Edge Computing. In addition to fast local data storage, it enables decentralised secure data flows and combines flexible data management with on-device security. You can assess it for yourself by looking at our GitHub profile and performance benchmarks.

Top comments (0)

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.