AlaSQL
activeby Andrey Gershun, Mathias Rangel Wulff and contributors · since 2014 · also known as AlaSQL.js, alasql
Pure-JavaScript in-memory SQL engine for browsers and Node.js that queries arrays, JSON, CSV and Excel files.
Overview
AlaSQL is a SQL database engine written entirely in JavaScript that runs in the browser, Node.js and other JS runtimes with no native dependencies. It executes most of SQL-99 (joins, grouping, subqueries, unions) over in-memory tables or plain arrays of objects, adds syntax for nested JSON and simple graph queries, and can read and write CSV, TSV, JSON and Excel (.xls/.xlsx) files, persist to localStorage or IndexedDB, and read SQLite files via SQL.js. It is best treated as a data-wrangling and reporting library inside an app rather than a durable database: transactions are limited and data lives in memory. The project is actively maintained under MIT, with v4.21.0 released in October 2026.
Strengths & trade-offs
Strengths
- +Runs SQL directly over JavaScript arrays and JSON with no server or native code
- +Reads and writes CSV, JSON and Excel (.xls/.xlsx) for import/export and reporting
- +Optional persistence to localStorage or IndexedDB in the browser
- +Wide SQL-99 coverage including joins, GROUP BY and subqueries
- +Mature, MIT-licensed and still actively released
Trade-offs
- −Data lives in memory; not a durable store for large or critical data
- −Transactions are limited (only for the localStorage engine)
- −Interpreted JavaScript is much slower than WASM engines like DuckDB-Wasm or SQLite-Wasm on big datasets
- −Edge-case SQL semantics differ from mainstream databases
Great for
- +Client-side filtering, grouping and joining of JSON API results
- +Exporting app data to Excel or CSV from the browser
- +Quick data transforms in Node.js scripts
- +Prototyping SQL logic without a database server
Think twice for
- −Durable application storage
- −Datasets larger than available memory
- −Analytics where DuckDB-Wasm or SQLite-Wasm are an option
Capabilities
Native or official first-party support · 4 of 25 tracked
Scale & consistency
- Comfortable data size
- Small · ≤ 100 GB
- Horizontal scaling
- None
- Multi-region
- No
- Transactions
- Limited ACID
- Consistency
- Strong
- Schema
- Flexible
- Architecture
- Embedded, In memory
- Query languages
- SQL
Bounded by the JavaScript heap of the browser tab or Node process.
Deployment
Ecosystem
Alternatives to AlaSQL
In-process columnar SQL database: the SQLite of analytics, running inside your app or notebook.
alasql vs duckdb →The in-process SQL engine that ships in every phone, browser and OS: one file, zero servers.
alasql vs sqlite →Real PostgreSQL compiled to WebAssembly: an embeddable Postgres for browsers, Node, Bun and Deno.
alasql vs pglite →In-memory JavaScript document store with indexes and pluggable persistence; no longer maintained.
alasql vs lokijs →The most popular IndexedDB wrapper, with live queries and an optional Dexie Cloud sync service.
alasql vs dexie →Tiny reactive in-memory store for tables and values, with persisters and CRDT sync.
alasql vs tinybase →AlaSQL FAQ
What is AlaSQL?
AlaSQL is a relational database by Andrey Gershun, Mathias Rangel Wulff and contributors, first released in 2014. AlaSQL is a SQL database engine written entirely in JavaScript that runs in the browser, Node.js and other JS runtimes with no native dependencies. It executes most of SQL-99 (joins, grouping, subqueries, unions) over in-memory tables or plain arrays of objects, adds syntax for nested JSON and simple graph queries, and can read and write CSV, TSV, JSON and Excel (.xls/.xlsx) files, persist to localStorage or IndexedDB, and read SQLite files via SQL.js. It is best treated as a data-wrangling and reporting library inside an app rather than a durable database: transactions are limited and data lives in memory. The project is actively maintained under MIT, with v4.21.0 released in October 2026.
Is AlaSQL open source?
Yes. AlaSQL is open source. License: MIT License.
Does AlaSQL support ACID transactions?
Partly. AlaSQL offers limited ACID guarantees (for example, single-record or single-partition transactions), with strong consistency.
Does AlaSQL scale horizontally?
AlaSQL does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).
How can I run AlaSQL?
You can embed it in your application.
What is AlaSQL best for?
AlaSQL is a strong fit for client-side filtering, grouping and joining of JSON API results; exporting app data to Excel or CSV from the browser; and quick data transforms in Node.js scripts. Think twice for durable application storage.
What are the best alternatives to AlaSQL?
Common alternatives to AlaSQL include DuckDB, SQLite, PGlite, LokiJS and Dexie.js. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
How popular is AlaSQL?
AlaSQL ranks #159 of 844 databases on the WhichDB Score (20.2/100), and #52 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.



