The simplest way to store data in Dart & Flutter. Start with just 3 lines of code, scale to millions of records.
๐ Version 1.4.0: Introducing Simple API - Zero configuration, 3 lines to start! See changelog
// That's it! You're ready to go
final db = await ReaxDB.simple('myapp');
await db.put('user', {'name': 'John', 'age': 30});
final user = await db.get('user');โ
Dead Simple - Start with 3 lines, no configuration needed
โ
Blazing Fast - 21,000+ writes/second, instant cache reads
โ
Scale When Ready - From simple key-value to advanced queries
โ
Pure Dart - Works everywhere: iOS, Android, Web, Desktop, Server
โ
Production Ready - ACID transactions, encryption, real-time sync
dependencies:
reaxdb_dart: ^1.4.0import 'package:reaxdb_dart/reaxdb_dart.dart';
// Open database
final db = await ReaxDB.simple('myapp');
// Store any JSON data
await db.put('user:1', {
'name': 'Alice',
'email': '[email protected]',
'age': 25
});
// Get data
final user = await db.get('user:1');
print(user['name']); // Alice
// Query with patterns
final users = await db.getAll('user:*');
users.forEach((key, value) {
print('$key: ${value['name']}');
});
// Delete data
await db.delete('user:1');
// Close when done
await db.close();// Listen to changes
db.watch('user:*').listen((event) {
print('User ${event.key} changed');
});
// Make changes - listeners are notified automatically
await db.put('user:2', {'name': 'Bob'});// Store multiple items at once
await db.putAll({
'user:1': {'name': 'Alice'},
'user:2': {'name': 'Bob'},
'user:3': {'name': 'Charlie'},
});
// Delete multiple items
await db.deleteAll(['user:1', 'user:2']);- ๐ฑ Mobile apps needing offline-first storage
- ๐ Startups wanting to move fast without database complexity
- ๐ Apps with 100-1M records that need speed
- ๐ Real-time features like live updates, syncing
- ๐ก๏ธ Secure apps needing built-in encryption
| Feature | ReaxDB | Hive | SQLite | Isar |
|---|---|---|---|---|
| Setup complexity | โญ Simple | โญ Simple | โญโญโญ Complex | โญโญ Medium |
| Performance | โก 21k/sec | โก Fast | ๐ข Slower | โก Fast |
| Pure Dart | โ Yes | โ Yes | โ No | โ No |
| Real-time | โ Built-in | โ No | โ No | โ Yes |
| Encryption | โ Built-in | โ Yes | โ Yes | |
| Advanced queries | โ Yes | โ Limited | โ SQL | โ Yes |
| Active development | โ Yes | โ Yes | โ Yes |
ReaxDB grows with your app. When you need advanced features, they're one line away:
// Need transactions? โ
await db.advanced.transaction((txn) async {
// Your atomic operations here
});
// Need indexes for complex queries? โ
await db.advanced.createIndex('users', 'age');
final youngUsers = await db.advanced.collection('users')
.whereBetween('age', 18, 25)
.find();
// Need encryption? โ
final secureDb = await ReaxDB.simple('myapp', encrypted: true);๐ See Advanced Documentation for transactions, indexes, aggregations, and more.
// Store todos
await db.put('todo:1', {
'title': 'Buy milk',
'done': false,
'created': DateTime.now().toIso8601String()
});
// Get all todos
final todos = await db.getAll('todo:*');
// Mark as done
final todo = await db.get('todo:1');
todo['done'] = true;
await db.put('todo:1', todo);// Save settings
await db.put('settings', {
'theme': 'dark',
'notifications': true,
'language': 'en'
});
// Read settings
final settings = await db.get('settings');
final isDark = settings['theme'] == 'dark';// Add to cart
await db.put('cart:product-123', {
'name': 'Flutter Book',
'price': 29.99,
'quantity': 2
});
// Get cart total
final items = await db.getAll('cart:*');
double total = 0;
items.forEach((_, item) {
total += item['price'] * item['quantity'];
});- 21,000+ writes per second
- 333,000+ reads per second from cache
- Handles millions of records efficiently
- 10x faster than SQLite for key-value operations
- ๐ Advanced Documentation - Transactions, indexes, performance tuning
- ๐ Performance Benchmarks - Detailed comparisons with other databases
- ๐ Migration Guide - Moving from Hive/Isar to ReaxDB
- ๐ก Simple Example - Quick start guide
- โ Todo App - Full-featured todo application
- ๐ฌ Chat App - Real-time chat with encryption
- ๐ฎ Flutter Demo - Interactive Flutter demo
- ๐ Report Issues
- โญ Star on GitHub
- โ Support Development
MIT License - see LICENSE file for details.
Ready to build something amazing? Start with ReaxDB.simple() and scale when you need to! ๐