Firebase gives you a fast, proprietary NoSQL backend on Google Cloud. backlex gives you an open-source, SQL-backed backend with dynamic collections you can run anywhere and own end to end.
Firebase is Google's Backend-as-a-Service: a NoSQL document database (Firestore), realtime listeners, auth, and hosting, all managed inside Google Cloud. backlex is an open-source (Apache-2.0) alternative on a relational database (PostgreSQL or SQLite/D1), with dynamic collections, REST + GraphQL, a permissions DSL, realtime, built-in vector search, and a runtime MCP server for AI agents — running on your own server, Cloudflare Workers, Vercel, or Netlify.
| backlex | Firebase | |
|---|---|---|
| License | Apache-2.0 core + managed Cloud | Proprietary (Google) |
| Self-host | Your server, Workers, Vercel, or Netlify | No — Google-hosted only |
| Data model | Relational: PostgreSQL or SQLite / D1 | NoSQL document store (Firestore) |
| Collections / schema | Managed tables (dynamic, additive-only DDL) or adopt existing tables — relational, with relations & constraints | Schemaless document collections |
| Query API | REST + GraphQL, SQL-backed; filter/sort/paginate, nested-relation filters, aggregation | SDK queries against documents |
| Realtime | Live row changes streamed to clients over Server-Sent Events (SSE), permission-filtered | Realtime document listeners |
| Permissions | Role-based DSL: conditions + field-level allow-lists | Security Rules language |
| Vector search | Built in — pgvector or Cloudflare Vectorize; auto-embed on write | Firestore vector search + Genkit (embeddings via extension) |
| Embedding models | OpenAI, Workers AI (bge-m3), or self-hosted TEI/Ollama/vLLM | Gemini / Vertex AI |
| AI agents / MCP | Built-in runtime MCP server — collections, vector & admin to agents, per-key tool allow-lists | MCP via Genkit / Firebase MCP |
| Storage + images | Files with ACLs, signed URLs; image transforms on Bun in-process or the Cloudflare edge | Cloud Storage; image resize via extension |
| Functions | Sandboxed edge functions; http/event/cron triggers | Cloud Functions |
| Flows (automation) | Visual, no-code op-chains on item events | Cloud Functions / Extensions (no visual builder) |
| Auth providers | Email/password, OAuth, magic link, email-OTP, passkeys | Firebase Auth (many providers) |
| SSO | SAML 2.0 + LDAP/AD (per workspace) | SAML / OIDC (Identity Platform) |
| Vendor lock-in | None — open core, portable, multi-runtime | High — tied to Google Cloud |
| Pricing model | Free self-host; flat Cloud plans | Usage-based (reads/writes/egress) |
backlex models data as relational collections. Let it create a managed table (dynamic schema, additive-only DDL that never drops columns) or adopt an existing table with a metadata row — foreign keys are auto-detected and become relations you can filter and expand. That's a different model from Firestore's schemaless documents: you get typed fields, relations, constraints, and SQL queries instead of denormalised document trees.
Semantic search is built into
the data layer: flag a collection's text fields and backlex
auto-embeds on every write and runs ANN search via
pgvector (Postgres)
or Cloudflare Vectorize
(SQLite/D1), with embeddings from OpenAI, Workers AI, or your own model.
The vectors power the Ask-AI / RAG page and the vector.search
MCP tool. Firebase offers Firestore vector search with Genkit, but the
embedding and agent wiring lives in your application code.
See the backlex documentation or the source on GitHub to get started. Self-hosting is free under Apache-2.0; the managed Cloud is optional.