DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

Realm


Realm Database is an open-source and cross-platform DBMS. Built from the ground in C++, it could support programming languages including Objective-C, Swift, Java and C#.[04]

Developer
Country of Origin
US
Start Year
2011 [10]
Former Name
tight.db
Project Types
Commercial, Open Source
Written in
C++
Supported Languages
C#, Java, JavaScript, Objective-C, Swift
Operating Systems
Android, iOS, Windows
License
Apache v2

Database Entry

Realm


Realm Database is an open-source and cross-platform DBMS. Built from the ground in C++, it could support programming languages including Objective-C, Swift, Java and C#.[04]

History[04]


Realm Database comes from the YCombinator LLC. which was founded by Alexander Stigsen and Bjarne Christiansen in 2011. They started the project called TightDB in the end of 2010 and renamed it to Realm in September, 2014. Realm was officially announced and open-sourced to the developers from over the world in 2016. Later in January 2017 its first stable version was released.

Checkpoints


Not Supported

Compression[05]


The Realm Database supports the features that optimize the memory usages for some data structures. For example, the database will convert a giant list of strings into enums, which is similar to the tagger pointers in Objective-C, in order for fast lookup. Moreover, the database utilizes integer packing to store the integer with optimized space so that it is not necessary to specify the integer type when declaration.

Concurrency Control[06]


In order to support concurrent read/write operations under the constraint of data consistency, the Realm Database implements Multi-version Concurrency Control based on copy-on-write mechanism. Every time a new transaction begins, the database would create a snapshot of the database and all the following read/write operations will be done on the snapshot without any modification on the existing data. Only when the transaction commits or aborts will the database verify everything and atomically persist the changes into the disk safely based on two-phase commit protocol. Under this architecture, threads that concurrently read/write the data will not be affected by each other and the data in database will be intact even if the write operations are interrupted because of the software failure.

Data Model[07]


Realm Database is an object-oriented database built from scratch instead of using an existing relational database. Application development related to objects will always encounter the mismatch between the object layer and database layer and one of the popular solution to this problem is to utilize the ORM while it is not straightforward and smooth in development experience. In this way, Realm Database provides the developers with an object interface based on object-oriented data model.

Foreign Keys


Not Supported

Hardware Acceleration


No Acceleration

Indexes[07]


Realm is based on B- Tree Structure

Isolation Levels[06]


No objects shared between threads, which means it's literally single-thread.

Joins


It's not relational database

Logging[08]


Realm only maintains the log for the transaction. But it doesn't support the recovery mechanism.

Query Compilation


Query Interface


Realm Database has its own custom APIs.

Storage Architecture[09]


You could configure during run-time.

Storage Model[05]


Properties would be kept contiguously linked at the vertical level.

Storage Organization[05]


Stored Procedures


System Architecture


Realm Database is not a distributed database. It's mainly for the mobile device.

Views


Realm database supports reflective views and imperative views. Essentially they are very similar to materialized views and virtual views.

Revision #8