slonbase Docs v2.5.1
Compare

slonbase vs PostgREST

PostgREST turns a PostgreSQL schema into a REST API. slonbase is a whole backend platform on PostgreSQL that includes one. They solve different amounts of the problem, so the question is how much you want built in.

#What PostgREST is

A single, very lean program that serves your tables, views and functions as a REST API and checks JWTs, leaving authorization to PostgreSQL's row-level security. You design and migrate the schema yourself. It has no sign-in or user management, no file storage, no realtime and no dashboard.

#What slonbase adds

slonbasePostgREST
REST API over PostgreSQL tablesYes: collections are tablesYes
Sign-in and usersPasswords, OAuth2, one-time codes, MFA, email flowsYou issue the JWTs
Access controlPer-collection rules in one filter languagePostgreSQL row-level security
FilesDisk or S3, thumbnails, protected filesNo
RealtimeEvery change, per-subscriber rulesNo
DashboardRecords, schema, rules, logs, SQL console, many projectsNo
Hooks and extendingJavaScript hooks, cron jobs, Rust libraryPostgreSQL functions
Schema changesFrom the dashboard or migrationsYour SQL migrations
Moving partsOne binary and PostgreSQLOne binary and PostgreSQL

#Speed

Measured on the same machine, the same data and the same HTTP workloads, with PostgREST serving the tables slonbase created (benchmarks): slonbase answered about 2.1 times as many list requests per second (7,814 against 3,733), 3.8 times as many single-record reads and 1.9 times as many creates. PostgREST is much lighter in memory (a 15 MB process against about 40 MB) and smaller to download, since it does much less. PostgREST was run at its defaults with a pool of 16; a tuned PostgREST may do better.

#Which to choose

Choose PostgREST when you already manage your PostgreSQL schema and only need a fast REST layer in front of it, with row-level security, and you handle sign-in, files and realtime elsewhere.

Choose slonbase when you want the rest of the backend too: users and sign-in, rules, files, realtime, hooks and an admin dashboard, in one program.