Reactive & asynchronous database for powerful React and React Native apps
WatermelonDB is a new way of managing user data in React Native and React web apps, designed for real-world performance. It offers an optimized solution for building complex applications, focusing on fast app launches. By being lazy-loaded and offline-first, WatermelonDB ensures efficient data handling for apps with thousands or tens of thousands of records without compromising speed.
To install WatermelonDB, you can follow these steps:
npm install @nozbe/watermelondb
npm install react-native-sqlite-storage
import { Database } from '@nozbe/watermelondb';
import SQLiteAdapter from '@nozbe/watermelondb/adapters/sqlite';
const adapter = new SQLiteAdapter({
dbName: 'myApp',
schema: mySchema,
});
const database = new Database({
adapter,
modelClasses: [Post, Comment],
actionsEnabled: true,
});
WatermelonDB offers a proactive solution for managing user data in React Native and React web apps, prioritizing fast app launches and efficient data handling. By being lazy-loaded, offline-first, and multiplatform compatible, it provides a reliable and scalable option for building complex applications. With its focus on real-world performance and continuous improvements, WatermelonDB proves to be a promising tool for developers seeking optimal data management solutions in their projects.