NuboDB

Local NoSQL
Reimagined

A NoSQL document database for Node.js. TypeScript-first, MongoDB-like queries, built-in encryption. Built for testing and development.

View on GitHub
Install with npm
$npm install nubodb

Features

Designed for local development and testing workflows

Built-in Encryption

AES-256-CBC or AES-256-GCM at-rest encryption for sensitive data

Schema Validation

Off, warn, or strict mode with field types, constraints, and custom validators

Advanced Querying

MongoDB-like query syntax with QueryBuilder for complex operations

Modular Architecture

Document or collection storage engines, extensible codebase

Transactions

Begin/commit/rollback with timeout and auto-rollback

Type Safety

Full TypeScript support with comprehensive type definitions

Event System

Hooks and EventEmitter for reactive programming patterns

Zero Dependencies

Lightweight and self-contained with no external dependencies

Best for Testing & Development

NuboDB is designed primarily for local development, testing, and prototyping. It is not recommended for production use in large-scale applications. For production workloads, consider established databases that offer better scalability, replication, and tooling.

Alternatives for production: MongoDB for document storage, PostgreSQL for relational data, or other production-grade databases that better suit your scale and requirements.

Get Started

Three simple steps to get up and running

Install NuboDB

Add NuboDB to your project

npm install nubodb

Create Database

Initialize your database instance

import { createDatabase } from 'nubodb'

// Create a database
const db = createDatabase({ path: './my-database' })

// Open the database
await db.open()

// Get a collection (creates it if it doesn't exist)
const users = await db.collection('users')

Start Building

Insert and query your data

// Insert a document
const { document } = await users.insert({
  name: 'Alice',
  email: 'alice@example.com',
  age: 30,
})

// Find documents
const result = await users.find({ age: { $gte: 18 } })

// QueryBuilder
const active = await users
  .query()
  .where('status', 'active')
  .where('age', '$gte', 18)
  .sort({ createdAt: -1 })
  .limit(20)
  .execute()

await db.close()

Use Cases

For testing, prototyping, and local development

Local Development

Mock data and local state for web app development

User profilesForm dataSession state

Desktop Prototypes

Quick local storage for Electron or desktop app prototypes

SettingsOffline cacheUser content

API Testing

Lightweight storage for API and backend testing

REST APIsGraphQLPrototyping

Game Development

Local save data and game state during development

Player progressSettingsSave files

Analytics & Logging

Collect metrics and logs during development

Event trackingError logsDebug data

Configuration

Manage config and feature flags locally

Feature flagsEnv configsA/B testing

FAQ

Common questions about NuboDB