Realm vs Core Data
MongoDB's Realm versus Apple's Core Data: object database performance, sync capabilities, learning curve, and which fits your iOS persistence needs.
SQLite's power, Dart's type safety — the natural choice if you know SQL
NoSQL speed and simplicity — but pick the right package first
The short answer: if your data model is relational and your team knows SQL, Drift is the safer bet — version 2.35.0 shipped 2026-09-09, the last commit landed 2026-09-24, and it pulls over 1.3 million monthly downloads. On the Isar side, the one critical rule is to write `isar_community` in your pubspec.yaml; the original `isar` package has been frozen since 2023. The fork is alive and still a reasonable choice for document-like data such as caches or loosely-schemad notes.
| Category | Drift | Isar |
|---|---|---|
| Performance | 8/10 | 8/10 |
| Ease of Learning | 6/10 | 8/10 |
| Ecosystem | 9/10 | 5/10 |
| Community | 8/10 | 5/10 |
| Job Market | 6/10 | 5/10 |
| Future-Proof | 9/10 | 6/10 |
// Drift - Table definition + reactive query (drift.simonbinder.eu/setup/)
import 'package:drift/drift.dart';
import 'package:drift/native.dart';
import 'dart:io';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as p;
part 'database.g.dart';
class Todos extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get title => text().withLength(min: 1, max: 200)();
BoolColumn get isDone => boolean().withDefault(const Constant(false))();
}
@DriftDatabase(tables: [Todos])
class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());
@override
int get schemaVersion => 1;
// Reactive stream: automatically emits whenever the table changes
Stream<List<Todo>> watchPendingTodos() {
return (select(todos)..where((t) => t.isDone.equals(false))).watch();
}
Future<int> addTodo(String title) {
return into(todos).insert(TodosCompanion.insert(title: title));
}
}
LazyDatabase _openConnection() {
return LazyDatabase(() async {
final dbFolder = await getApplicationDocumentsDirectory();
final file = File(p.join(dbFolder.path, 'db.sqlite'));
return NativeDatabase.createInBackground(file);
});
}// isar_community - Collection definition + query (pub.dev/packages/isar_community readme pattern)
import 'package:isar_community/isar.dart';
import 'package:path_provider/path_provider.dart';
part 'todo.g.dart';
@collection
class Todo {
Id id = Isar.autoIncrement;
@Index()
late String title;
bool isDone = false;
}
Future<Isar> openDb() async {
final dir = await getApplicationDocumentsDirectory();
return Isar.open(
[TodoSchema],
directory: dir.path,
);
}
Future<void> addTodo(Isar isar, String title) async {
final todo = Todo()..title = title;
await isar.writeTxn(() async {
await isar.todos.put(todo);
});
}
// Reactive query: automatically emits whenever the collection changes
Stream<List<Todo>> watchPendingTodos(Isar isar) {
return isar.todos.filter().isDoneEqualTo(false).watch(fireImmediately: true);
}The short answer: if your data model is relational and your team knows SQL, Drift is the safer bet — version 2.35.0 shipped 2026-09-09, the last commit landed 2026-09-24, and it pulls over 1.3 million monthly downloads. On the Isar side, the one critical rule is to write `isar_community` in your pubspec.yaml; the original `isar` package has been frozen since 2023. The fork is alive and still a reasonable choice for document-like data such as caches or loosely-schemad notes.
Get Free ConsultationIn a new project, definitely use isar_community. The original isar package hasn't been updated on pub.dev since 2023-04-25, nor on GitHub since 2025-06-14 — it's effectively abandoned. isar_community is the active fork the community took over, and it's the package you should mean today when you say 'Isar'.