Skip to content
— SQL and dataframes for JavaScriptv0.1.0 · open source · MIT

Vectro.js: SQL and dataframes for JavaScript, on every core

An analytics engine you import into your JavaScript app. Load millions of rows, then filter, group, join and run SQL on them, using every core of the machine.

Get started ↗

What it does

Ask questions of your data inside your app.

Most apps send their data to a database or a warehouse to add it up, group it or search it. Vectro does that work where the data already is: in your Node server, or in your user's browser. There is no server to run and nothing native to install.

  1. 01

    Install

    One package, no dependencies.

    npm i vectrojs
  2. 02

    Load your data

    CSV, JSON, Arrow, plain arrays, or files bigger than memory.

    engine.readCSV('orders.csv')
  3. 03

    Ask

    In SQL, or in JavaScript with filter, groupBy and join.

    sql('SELECT …', { orders })

Your code

import { Engine, sql } from 'vectrojs';

const engine = new Engine();   // uses every core
const orders = engine.table({
  region: ['EU', 'US', 'EU', 'APAC', 'US', 'EU'],
  price:  [120, 80, 45, 300, 99, 15],
  qty:    [2, 1, 4, 1, 3, 10],
});

sql(`SELECT region, COUNT(*) AS orders, SUM(price * qty) AS revenue
     FROM orders GROUP BY region ORDER BY revenue DESC`, { orders }).toRows();

What you get back

regionordersrevenue
EU3570
US2377
APAC1300

Rows as plain objects. The same code runs on six rows or sixty million.

Why Vectro

Fast, small, and it runs anywhere.

20/20

SQL queries faster than DuckDB, the best-known embedded analytics database, on 10 million rows, with the same answers.

The benchmarks ↗

0.37 GB

of memory to query a billion rows from a file on disk. DuckDB used 6.6 GB for the same file.

Bigger than memory ↗

3

places it runs: Node servers, web browsers and edge runtimes like Cloudflare Workers. Pure JavaScript and WebAssembly.

In the browser ↗

Running in this tab, right now

0.0ms

to group 1,000,000 rows by 100,000 customers, on your own computer.

The details

For the curious

A billion rows on disk · the top 10 rows by price

11 ms

Vectro

827 ms

DuckDB 2.0

Every block of rows keeps its smallest and largest values, so Vectro skips the blocks that can't hold a winning row. Level or faster on 7 of 8 queries at this size.

Ten million orders, same SQL · ms

group by region7.8 / 30.7
top 10 customers12.9 / 42.5
CASE inside SUM7.6 / 35.2
correlated subquery16 / 50.6
top 3 per region (RANK)35.9 / 118.6
FULL JOIN + count16.9 / 25.5

Vectro DuckDB

BI tools

Serve tables over the PostgreSQL protocol and open them in Power BI, Tableau, Metabase or Grafana.

How ↗

Streams and vectors

Live windows over a stream of rows, and nearest-neighbour search over embeddings, on every core.

Streams ↗

AI assistants

An MCP server lets Claude and other assistants load your files and answer questions about them with SQL.

Set it up ↗

Try it in a minute.

Quick start ↗Contact us