Isar: The Lightning-Fast NoSQL Database for Flutter

Published on by Flutter News Hub

Isar: The Lightning-Fast NoSQL Database for Flutter

Isar is a blazing-fast and feature-rich NoSQL database designed specifically for Flutter applications. With its intuitive syntax, seamless integration, and robust capabilities, Isar empowers developers to create scalable and performant apps.

Key Features

  • Asynchronous: Parallel query operations and multi-isolate support for optimal performance.
  • Feature-Rich: Composite and multi-entry indexes, query modifiers, and JSON support.
  • Easy Integration: Zero configuration and boilerplate, making it a breeze to use with existing Flutter projects.
  • Scalable: No limits on data size or query complexity, ensuring scalability for growing databases.
  • Open Source: Free and open-source, offering complete control and transparency.

Quickstart

  1. Add Isar to your pubspec.yaml file:
dependencies:
  isar: any
  isar_flutter_libs: any
  1. Annotate your data classes with @collection:
@collection
class Email {
  Id id = Isar.autoIncrement;
  String? title;
  List? recipients;
}
  1. Open a database instance:
final isar = await Isar.open([EmailSchema]);
  1. Perform queries using the IsarCollection:
final emails = await isar.emails
  .filter()
  .titleContains('awesome')
  .sortByStatusDesc()
  .limit(10)
  .findAll();

Database Queries

Isar offers a powerful query language that enables complex data retrieval:

  • Index Usage: Utilize indexes for blazing-fast filtering and sorting.
  • Query Modifiers: Use and(), or(), and xor() to create sophisticated query conditions.
  • Embedded Object Queries: Query properties of embedded objects.
  • Link Queries: Connect tables and fetch related data seamlessly.

Database Watchers

Stay notified of database changes in real-time with Isar watch streams:

Stream collectionStream = isar.emails.watchLazy();
Stream queryStream = importantEmails.watch();

Benchmarks

Isar shines in performance benchmarks, outperforming other popular databases:

  • Insert (1M records): 4.3 seconds with Isar vs. 20 seconds with another database
  • Query (1M records): 0.2 seconds with Isar vs. 2.1 seconds with another database
  • Update (1M records): 0.3 seconds with Isar vs. 2.2 seconds with another database

Documentation and Support

Isar provides comprehensive documentation, detailed tutorials, and an active community forum for support:

Conclusion

Isar database empowers Flutter developers with its unmatched speed, ease of use, and scalability. Its feature-rich API and robust query capabilities make it the ideal choice for building high-performance and data-intensive apps. Join the Isar community and elevate your database game today!

Flutter News Hub