Ian WardPublished Oct 17, 2022 • Updated Oct 17, 2022
Rate this article
Realm is a simple, fast, object-oriented database for mobile applications that does not require an ORM layer or any glue code to work with your data layer and is built from the ground up to work cross-platform, making React Native a natural fit. With Realm, working with your data is as simple as interacting with objects from your data model. Any updates to the underlying data store will automatically update your objects as soon as the state on disk has changed, enabling you to automatically refresh the view via React components, hooks, and context.
Build better mobile apps with Atlas Device Sync: Atlas Device Sync is a fully-managed mobile backend-as-a-service. Leverage out-of-the-box infrastructure, data synchronization capabilities, built-in network handling, and much more to quickly launch enterprise-grade mobile apps. Get started now by build: Deploy Sample for Free!
- An object database that infers the schema from the developers’ class structure, making working with objects as easy as interacting with objects in code. No conversion code or ORM necessary.
- Live objects, where the object reference updates as soon as the state changes and the UI refreshes — all built on top of Realm’s React library — enabling easy-to-use context, hooks, and components.
- A columnar store where query results return immediately and integrate with an idiomatic query language that developers are familiar with.
Realm is a fast, easy-to-use alternative to SQLite, that comes with a real-time edge to cloud sync solution out of the box. Written from the ground up in C++, it's not a wrapper around SQLite or any other relational data store and is designed with the mobile environment in mind. It's lightweight and optimizes for constraints like compute, memory, bandwidth, and battery that do not exist on the server side. Realm uses lazy loading and memory mapping. with each object reference pointing directly to the location on disk where the state is stored. This exponentially increases lookup and query speed as it eliminates the loading of state pages from disk into memory to perform calculations. It also reduces the amount of memory pressure on the device while working with the data layer. Realm makes it easy to store, query, and sync your mobile data across a plethora of devices and the back end.
The Realm React library eliminates an incredible amount of boilerplate code that a developer would normally write in order to funnel data from the state store to the UI. With this library, Realm is directly integrated with React and comes with built-in hooks for accessing the query, write, and sync APIs. Previously, React Native developers would need to write this boilerplate themselves. By leveraging the new APIs from our React library, developers can save time and reduce bugs by leaving the Realm centric code to us. We have also added the ability for Realm’s objects to be React component aware, ensuring that re-renders are as efficient as possible in the component tree and freeing the developer from needing to write their own notification code. Lastly, we have harmonized Realm query results and lists with React Native ListView components, ensuring that individual items in lists re-render when they change — enabling a slick user experience.
Give it a try today and let us know what you think! Try out our tutorial, read our docs, and follow our repo.
Continuously Building and Hosting our Swift DocC Documentation using Github Actions and Netlify
May 10, 2022