Introducing SchemaJS: A database built on top of V8

Introducing SchemaJS: A database built on top of V8

October 16, 2024

SchemaJS is a new database engine written in Rust. Designed to reduce context switching and handle complex queries without the need for extensions, SchemaJS lets developers define table structures, procedures, and queries entirely in JavaScript.

Primary Motivation

SchemaJS draws primary inspiration from Google’s Datastore and Supabase’s Edge Runtime. By combining elements from both technologies, SchemaJS offers a NoSQL database where queries function like serverless processes, enabling non-blocking JavaScript interactions.

Initially, SchemaJS was designed to address the complexity and outdated methods involved in writing SQL procedures.

Procedure Example

The image above shows how using addQuery simplifies much of the complexity typically associated with traditional SQL procedures.

We believe that by improving the developer experience in both writing database scripts and interacting with the database, we can create a scalable, high-performance, open-source system with an almost non-existent learning curve.

Built-in Hooks

Many database systems rely on external wrappers to notify clients when operations like insertions, updates, or deletions occur. SchemaJS simplifies this process by offering built-in, first-class hooks—JavaScript callbacks that trigger automatically on specific database actions.

Hooks Example

Each of these calls is executed in its own thread, with a dedicated JavaScript Isolate assigned to the query. This design enables non-blocking operations, ensuring smooth performance even under heavy workloads.

First-Class ESM Imports

SchemaJS supports writing modular code using ES Modules (ESM) standards, enabling developers to organize and maintain their codebase efficiently.

import * from "./module.ts"

While HTTP imports are not yet available, they are planned for version 0.2.0. Stay tuned for updates on our GitHub repository.

Get Started

You can start using SchemaJS by installing the CLI with the following command:

$ curl -fsSL https://schemajs.com/install.sh | sh

For additional installation options and examples, check out our documentation.

After successfully installing schemajs, navigate to the folder where you’d like to initialize boilerplate code and run the following command:

$ schemajs init