Realms are the core data structure used to organize data in Realm Database. At its core, a realm is a collection of the objects that you use in your application, called Realm objects, as well as additional metadata that describe the objects.
Realm Files
Realm almacena una versión codificada en binario de cada objeto y tipo en un reino en un solo .realm archivo. El archivo se encuentra en una ruta específica que usted define al abrir el reino.
Tip
Implemente la compactación en su aplicación de producción
Cada aplicación de producción debe implementar una función de retorno shouldCompactOnLaunch para reducir periódicamente el tamaño del archivo Realm.
Archivos auxiliares
Realm crea archivos adicionales para cada realm:
archivos realm, con el sufijo "realm", por ejemplo,
default.realm: contiene datos de objetos.lock files, suffixed with "lock", e.g.
default.realm.lock: keep track of which versions of data in a realm are actively in use. This prevents realm from reclaiming storage space that is still used by a client application.note files, suffixed with "note", e.g.
default.realm.note: enable inter-thread and inter-process notifications.archivos de gestión, con el sufijo "gestión", por
default.realm.managementejemplo: gestión del estado interno.
If you delete a realm file or any of its auxiliary files while one or more instances of the realm are open, you might corrupt the realm or disrupt sync.
You may safely delete these files when all instances of a realm are closed. Before you delete a realm file, make sure that you back up any important objects as you will lose all unsynced data in the realm.
Dominios en memoria
You can also open a realm entirely in memory, which will not create a .realm file or its associated auxiliary files. Instead the SDK stores objects in memory while the realm is open and discards them immediately when all instances are closed.