A schemaless, immutable, hosted database.
Store Clojure data, JSON or Python values exactly as written, keep every transaction, and fork a database as of any point in time. There are no servers to run.
- Schemaless. Any row takes any attribute. Indexes are added per attribute while the database runs.
- Immutable. Nothing is overwritten: read a database's history, or fork it as of any transaction.
- Hosted. An HTTP API with API keys, and clients for JavaScript, Python and ClojureScript.
The free plan: 3 databases, 1 GB, 100,000 transactions and 300,000 queries a month. No card needed.
Clients
Each client is one file with no dependencies beyond its language's standard library
(the ClojureScript one uses transit-cljs). Make an API key on the dashboard and set it as
STRATUS_KEY; a new key starts working within a minute or two.
JavaScript (Node 20+ or a browser)
npm install stratus-db
import { connect, squuid, kw } from "stratus-db";
const s = connect({ url: "https://api.stratus-db.com", apiKey: process.env.STRATUS_KEY });
const { id } = await s.createDb({ name: "orders", primaryKey: "order/id" });
await s.transact(id, { tx: [{ "order/id": squuid(), "order/status": kw("status/open") }] });
await s.requestIndex(id, "order/status");
await s.awaitIndex(id, "order/status");
const { rows } = await s.query(id, { where: ["=", "order/status", kw("status/open")] });
stratus-db on npm: the README there lists every call and how values map.
Python 3.9+
pip install stratus-db
import os
from stratus_db import connect, squuid, kw
s = connect("https://api.stratus-db.com", api_key=os.environ["STRATUS_KEY"])
db = s.create_db(primary_key="order/id", name="orders")["id"]
s.transact(db, tx=[{"order/id": squuid(), "order/status": kw("status/open")}])
s.request_index(db, "order/status")
s.await_index(db, "order/status")
rows = s.query(db, where=["=", "order/status", kw("status/open")])["rows"]
stratus-db on PyPI: the README there lists every call and how values map.
ClojureScript
com.stratus-db/client {:mvn/version "0.2.1"}
(ns my.app (:require [stratus-db.client :as client]))
(def conn (client/connect "https://api.stratus-db.com"
{:api-key (.-STRATUS_KEY js/process.env)}))
(-> (client/create-db! conn {:name "orders" :primary-key :order/id})
(.then (fn [{:keys [id]}]
(client/transact! conn id {:tx [{:order/id (client/squuid)
:order/status :status/open}]}))))
com.stratus-db/client on Clojars: the README there lists every call and how values map.