JEXIDB = JavaScript EXtended Intelligent DataBase
The Only Pure JS Database with Smart Disk Persistence & Intelligent Memory Management - Schema-Enforced, Streaming-Ready, No Native Dependencies
β‘ High-Performance β’ πΎ Persistent β’ π§ Memory Efficient β’ π Production Ready
π Documentation β’ π‘ Examples β’ π§ API Reference β’ π Quick Start
- Why Developers Choose JexiDB
- JexiDB vs Other JavaScript Databases
- Performance Benchmarks
- Frequently Asked Questions
- Quick Start - 5 Minutes to Database
- Real-World Use Cases
- Migration Guide
- What's Next - Roadmap
The Only Pure JS Database with Smart Disk Persistence & Intelligent Memory Management
JexiDB stands out among JavaScript databases by combining pure JavaScript simplicity with enterprise-grade data management. While other JS databases offer basic persistence, JexiDB provides intelligent memory management and structured data enforcement that traditional document databases lack.
π Pure JavaScript, No Compromises - 100% JavaScript, no native dependencies, WASM, or compilation required. Compatible with both CommonJS and ESM modules
πΎ Intelligent Disk Persistence - JSONL files with compressed persistent indexes, not memory-only storage
π Schema Enforcement - Structured data model like SQL tables, ensuring data consistency in pure JavaScript
π§ Smart Memory Management - Point reading and streaming operations, handles millions of records without loading everything into RAM
π Advanced Query Optimization - MongoDB-like operators with automatic term mapping for 77% size reduction
β‘ Production-Ready Performance - Compressed indexes, streaming operations, and automatic optimization
π₯οΈ Desktop-First Design - Optimized for Electron, NW.js, and local Node.js applications from the ground up
- Storage Format: JSONL (JSON Lines) with compressed persistent indexes
- Memory Strategy: Point reading + streaming, doesn't require loading entire database
- Query Language: Advanced operators ($in, $or, $and, ranges, regex, case-insensitive)
- Data Types: string, number, boolean, array (with automatic optimization)
- Indexing: Persistent compressed indexes with term mapping for optimal performance
- Transactions: Operation queuing with manual save control (auto-save removed for better control)
- Persistence: Manual save functionality ensures data integrity and performance
- File Size: Typically 25-75% smaller than alternatives for repetitive data
| Database | Pure JS | Disk Persistence | Memory Usage | Data Structure | Best Use Case |
|---|---|---|---|---|---|
| JexiDB | β 100% | β JSONL + Compressed Indexes | π§ Smart (point reading) | π Schema Required | Desktop apps, Node.js with structured data |
| NeDB | β 100% | β JSON files | π High (loads all) | π Document-free | Legacy projects (unmaintained) |
| Lowdb | β 100% | β JSON files | π High (loads all) | π Document-free | Small configs, simple apps |
| LokiJS | β 100% | π High (in-memory primary) | π Document-free | In-memory applications | |
| PouchDB | β 100% | β IndexedDB/WebSQL | π§ Moderate | π Document-free | Offline-first web apps |
| SQLite (WASM) | β WASM required | β SQLite files | π§ Moderate | π SQL Tables | Complex relational data |
Intelligent Memory Management: Unlike other JS databases that load entire files into memory, JexiDB uses point reading and streaming operations for unlimited dataset sizes.
Schema Enforcement: Provides SQL-like data structure and consistency guarantees in pure JavaScript, without the complexity of traditional databases.
Desktop-First Architecture: Built specifically for Electron and NW.js applications, eliminating native dependency issues that complicate desktop deployment.
Enterprise Performance: Combines disk persistence with in-memory query speed through compressed indexes and automatic term mapping optimization.
| Database | Memory Usage | Query Speed | File Size |
|---|---|---|---|
| JexiDB | ~25MB | ~5ms (indexed) | ~15MB (compressed) |
| NeDB | ~80MB | ~20ms | ~45MB |
| Lowdb | ~120MB | ~50ms | ~60MB |
| LokiJS | ~90MB | ~8ms | ~35MB (adapters) |
Benchmarks based on typical e-commerce product catalog with repetitive category/tag data
- Without term mapping: 45MB file size
- With JexiDB term mapping: 15MB file size
- Reduction: Up to 77% for datasets with repetitive strings
Yes, JexiDB is production-ready with features like:
- Automatic data integrity recovery
- Transaction support with operation queuing
- Comprehensive error handling
- Active maintenance and updates
JexiDB uses point reading - it only loads the specific records needed for your query, not the entire database. Combined with streaming operations via iterate() and walk(), it can handle millions of records efficiently.
For many use cases, yes! JexiDB offers:
- β 100% JavaScript (no native SQLite compilation issues)
- β Schema enforcement like SQL tables
- β Advanced queries with operators
- β Better memory efficiency for large datasets
- β Simpler deployment (no native binaries)
Fields define your data structure (schema) - they're required and enforced. Indexes optimize query performance - they're optional and should only be created for fields you query frequently.
JexiDB provides SQL-like structure and data consistency in pure JavaScript, but without the complexity of server setup or native dependencies. It's perfect for applications that need structured data without the overhead of full database systems.
npm install EdenwareApps/jexidbimport { Database } from 'jexidb';
const db = new Database('users.jdb', {
fields: {
id: 'number',
name: 'string',
email: 'string',
role: 'string',
tags: 'array:string'
},
indexes: {
email: 'string', // Fast email lookups
role: 'string', // Filter by role
tags: 'array:string' // Search by tags
}
});
// Initialize and use
await db.init();
// Insert data
await db.insert({
id: 1,
name: 'John Doe',
email: 'john@example.com',
role: 'admin',
tags: ['developer', 'team-lead']
});
// Query data
const users = await db.find({ role: 'admin' });
const devs = await db.find({ tags: 'developer' });
// Save changes
await db.save();That's it! Your data is now persisted to users.jdb file.
// User management in Electron app
const userDb = new Database('users.jdb', {
fields: { id: 'number', email: 'string', profile: 'object' },
indexes: { email: 'string' }
});
// Works offline, no server required
const user = await userDb.findOne({ email: 'user@example.com' });// Configuration storage
const configDb = new Database('config.jdb', {
fields: { key: 'string', value: 'string' },
indexes: { key: 'string' }
});
// Persist app settings locally
await configDb.insert({ key: 'theme', value: 'dark' });// Process large CSV files
const dataDb = new Database('processed.jdb', {
fields: { id: 'number', data: 'object' }
});
// Handle millions of records efficiently
for await (const record of dataDb.iterate({ processed: false })) {
// Process record
record.processed = true;
record.timestamp = Date.now();
}
await dataDb.save();// Product catalog for desktop POS system
const productsDb = new Database('products.jdb', {
fields: {
sku: 'string',
name: 'string',
price: 'number',
category: 'string',
tags: 'array:string'
},
indexes: {
sku: 'string',
category: 'string',
tags: 'array:string'
}
});- Desktop Applications (Electron, NW.js, Tauri) - No native dependency issues
- Local Node.js Applications - Simple deployment without database servers
- Offline-First Apps - Works completely offline with local persistence
- Data Processing Scripts - Handle large datasets with streaming operations
- Configuration Storage - Simple key-value storage with schema validation
- Prototyping - Quick setup with real persistence and advanced queries
- Multi-user web applications - Use database servers instead
- Heavy concurrent writes - JexiDB is single-writer optimized
- Complex relational data - Consider traditional SQL databases
- Browser-only applications - Use IndexedDB/PouchDB for web
The iterate() method provides high-performance bulk update capabilities with streaming support:
// Basic bulk update
for await (const product of db.iterate({ category: 'electronics' })) {
product.price = product.price * 1.1; // 10% increase
product.updatedAt = new Date().toISOString();
}
// With progress tracking
for await (const item of db.iterate(
{ status: 'active' },
{
chunkSize: 1000,
progressCallback: (progress) => {
console.log(`Processed: ${progress.processed}, Modified: ${progress.modified}`);
}
}
)) {
item.processed = true;
}Benefits:
- Streaming Performance: Process large datasets without loading everything into memory
- Bulk Updates: Modify multiple records in a single operation
- Automatic Change Detection: Automatically detects modified records
- Progress Tracking: Optional progress callbacks for long-running operations
// Multiple conditions (automatic AND)
const results = await db.find({
age: { '>': 18, '<': 65 },
status: 'active',
category: { '$in': ['premium', 'vip'] }
});
// Logical operators
const complex = await db.find({
'$or': [
{ type: 'admin' },
{ '$and': [
{ type: 'user' },
{ verified: true }
]}
]
});
// Arrays
const withTags = await db.find({
tags: 'javascript', // Contains 'javascript'
tags: { '$all': ['js', 'node'] } // Contains all values
});
// Coverage analysis with filtering
const liveCoverage = await db.coverage('tags', [
{ terms: ['javascript'], excludes: [] },
{ terms: ['react', 'vue'], excludes: ['angular'] }
], { mediaType: 'live' }) // Only analyze live content
// Multi-value filtering (OR logic)
const multiTypeCoverage = await db.coverage('tags', [
{ terms: ['tutorial'] }
], { mediaType: ['live', 'vod'] }) // Live OR VOD contentJexiDB inclui uma suΓte completa de testes com Jest:
npm test # Executa todos os testes
npm run test:watch # Modo watch para desenvolvimento
npm run test:coverage # RelatΓ³rio de cobertura- π Full Documentation - Complete documentation index
- π§ API Reference - Detailed API documentation
- π‘ Examples - Practical examples and use cases
- π Getting Started - Quick start guide
// Before (NeDB)
const Datastore = require('nedb');
const db = new Datastore({ filename: 'data.db' });
// After (JexiDB)
import { Database } from 'jexidb';
const db = new Database('data.jdb', {
fields: { /* define your schema */ },
indexes: { /* define indexes */ }
});
await db.init(); // Required!// SQLite requires native compilation
const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('data.db');
// JexiDB - pure JavaScript, no compilation
import { Database } from 'jexidb';
const db = new Database('data.jdb', { /* config */ });// Browser storage limitations
localStorage.setItem('data', JSON.stringify(largeDataset));
// JexiDB - true file persistence
const db = new Database('data.jdb', { /* config */ });
await db.insert(largeDataset);
await db.save();- π Full Documentation - Complete guides and API reference
- π¬ GitHub Issues - Bug reports and feature requests
- π‘ Examples - Real-world usage patterns
Found a bug or want to contribute? We welcome pull requests!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see the LICENSE file for details.
- π SQL-like Query Builder - More intuitive query construction
- π Built-in Aggregation Functions - Count, sum, average operations
- π Encryption Support - Optional data encryption at rest
- π± React Native Support - Mobile database capabilities
- π Multi-threading - Better concurrent operation handling
- π Advanced Analytics - Built-in data analysis tools
- β v2.1.0 - Term mapping auto-detection, 77% size reduction
- β Schema Enforcement - Mandatory fields for data consistency
- β Streaming Operations - Memory-efficient bulk operations
- β Compressed Indexes - Persistent indexing with compression
If JexiDB helps your project, consider supporting its development:
- β Star on GitHub - Show your support
- π Report Issues - Help improve stability
- π Donate - PayPal
The Only Pure JS Database with Smart Disk Persistence & Intelligent Memory Management
Built with β€οΈ for the JavaScript community
- π¦ NPM Package: npmjs.com/package/jexidb
- π Documentation: docs/README.md
- π¬ Issues: github.com/EdenwareApps/jexidb/issues
