Performance of Realm

Performance of Realm

  • Built-in storage engine written in C: Reduces dependencies and improves query performance.
  • The traditional SQLite with ORM abstraction is leaky because ORM simply converts Objects and their methods into SQL statements. Realm, on the other hand, is an object database, meaning your objects directly reflect your database and it doesn’t convert the objects while doing read/write operations.
  • Zero-copy: The traditional way of reading data from a database leads to unnecessary copying into language level objects. Realm avoids this by mapping the whole data in-memory, using B+ trees and whenever data is queried, Realm simply calculates the offset, reads from the memory mapped region and returns the raw value.
  • Concurrency Control: Realm smoothly handles the concurrency using the MVCC model, which means that multiple read transactions can be done at the same time and reads can also be done while a write transaction is being committed.

Related concepts

Performance of Realm

Performance of Realm — Structure map

Clickable & Draggable!

Performance of Realm — Related pages: