Skip to content

A high-performance NoSQL database for Flutter and Dart applications, combining LSM Tree and B+ Tree architectures with advanced caching, encryption, and ACID transaction support.

License

Notifications You must be signed in to change notification settings

dvillegastech/ReaxBD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ReaxDB

pub package GitHub stars Dart

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');

Why ReaxDB?

โœ… 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

Installation

dependencies:
  reaxdb_dart: ^1.4.0

Quick Start

1. Basic Usage (90% of use cases)

import '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();

2. Real-time Updates

// 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'});

3. Batch Operations (faster for multiple items)

// 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']);

When to Use ReaxDB

Perfect for:

  • ๐Ÿ“ฑ 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

ReaxDB vs Others:

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 โš ๏ธ Extension โœ… Yes
Advanced queries โœ… Yes โŒ Limited โœ… SQL โœ… Yes
Active development โœ… Yes โš ๏ธ Deprecated โœ… Yes โœ… Yes

Need More Power?

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.

Examples

Todo App

// 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);

User Settings

// 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';

Shopping Cart

// 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'];
});

Performance

  • 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

Resources

Documentation

Examples

Support

License

MIT License - see LICENSE file for details.


Ready to build something amazing? Start with ReaxDB.simple() and scale when you need to! ๐Ÿš€

About

A high-performance NoSQL database for Flutter and Dart applications, combining LSM Tree and B+ Tree architectures with advanced caching, encryption, and ACID transaction support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •