dart_db 0.1.0 copy "dart_db: ^0.1.0" to clipboard
dart_db: ^0.1.0 copied to clipboard

High-performance embedded key-value database for pure Dart backend applications. Built on LMDB with Rust FFI for persistence.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased #

Added #

  • Initial project setup and documentation

0.1.0 - 2025-01-26 #

Added #

  • Initial release of DartDB
  • High-performance embedded key-value database for pure Dart backend applications
  • Built on LMDB (Lightning Memory-Mapped Database) with Rust FFI integration
  • Core database operations:
    • set(key, value) - Store data with any JSON-serializable type
    • get<T>(key) - Retrieve data with optional type casting
    • get<T>(key, defaultValue) - Retrieve data with default fallback
    • exists(key) - Check if key exists
    • delete(key) - Remove data
    • keys() - Get all keys
    • keys(pattern) - Get keys matching pattern
  • Batch operations:
    • setMultiple(Map<String, dynamic>) - Set multiple values at once
    • getMultiple(List<String>) - Get multiple values at once
    • deleteMultiple(List<String>) - Delete multiple keys at once
  • Advanced operations:
    • increment(key, by) - Increment numeric values
    • decrement(key, by) - Decrement numeric values
    • setWithTTL(key, value, duration) - Set with expiration time
    • stats() - Get database statistics
  • Transaction support:
    • transaction((txn) async { ... }) - Execute write operations in transaction
    • readTransaction((txn) async { ... }) - Execute read-only transaction
  • Configurable database options:
    • Maximum database size configuration
    • Read-only mode support
    • Custom sync modes (full, lazy, none)
    • Compression settings with LZ4 algorithm
    • Maximum readers configuration
  • Cross-platform support for Linux, macOS, and Windows
  • ACID compliance with full transaction support
  • Memory-efficient operation with memory-mapped files
  • Redis-like API for familiar key-value operations
  • Comprehensive error handling and type safety
  • Built-in logging with configurable log levels
  • Environment variable configuration support
  • In-memory database option (:memory:) for testing
  • Full JSON serialization support for complex Dart objects
  • Performance optimizations:
    • Up to 1M+ read operations per second
    • Up to 100K+ write operations per second
    • Microsecond-level latency for basic operations
    • Efficient batch operations for bulk data handling
    • Low memory footprint with memory-mapped storage
  • Complete test suite with comprehensive coverage
  • Extensive documentation with practical examples:
    • Web API caching implementation
    • Session storage system
    • Configuration management
    • Troubleshooting guide
    • Performance benchmarks
  • MIT License for open source usage
  • Ready for pub.flutter-io.cn publication

Technical Details #

  • Built with Dart SDK 3.0.0+ compatibility
  • FFI integration with Rust for native performance
  • LMDB engine for proven reliability and speed
  • Memory-mapped file I/O for optimal performance
  • Multi-reader, single-writer concurrency model
  • Crash-safe operation with automatic recovery
  • Flexible data serialization supporting all JSON-compatible types

Use Cases #

  • Caching layer for backend applications
  • Session storage with persistence
  • Configuration and metadata storage
  • Job queue and task scheduling
  • Metrics collection and analytics
  • Embedded analytics and data processing
  • High-performance key-value operations in pure Dart environments
1
likes
160
points
29
downloads

Publisher

verified publisherjhonacode.com

Weekly Downloads

High-performance embedded key-value database for pure Dart backend applications. Built on LMDB with Rust FFI for persistence.

Repository (GitHub)
View/report issues

Topics

#embedded #key-value #lmdb #backend #ffi

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

ffi

More

Packages that depend on dart_db