Integrate persistent database functionality with Realm

As your application becomes more and more complex, you will come to the point where you need to store data on the device. This could be business data, such as user lists, to avoid having to make expensive network connections to a Remote API. Maybe you don't have an API at all and your application works as a self-sufficient entity. Regardless of the situation, you may benefit from leveraging a database to store your data. There are several options on the React Native front:

  • You can use AsyncStorage (we cover this in the Storing and retrieving data locally recipe)
  • SQLite, or you can write an adapter to an OS-specific data provider, such as CoreData, or use a mobile database such as Realm

Realm ...

Get React Native Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.