StitchDB vs Firebase: Postgres or Firestore for Your App?
StitchDB vs Firebase comes down to the database. Firebase is built around Firestore, a document store with excellent mobile SDKs, Google's global infrastructure and pay-per-operation pricing. StitchDB is built around a dedicated Postgres database per project with SQL, joins and row level security, flat monthly plans and EU-only hosting. Both include auth, file storage, server functions, push notifications, crash reporting and analytics, so the choice is mostly about data model, pricing style and where your data lives.
#At a glance
| StitchDB | Firebase | |
|---|---|---|
| Database | Postgres, one database per project | Firestore (documents), Realtime Database; Data Connect for Cloud SQL Postgres |
| Query language | SQL, REST and GraphQL from your schema | Firestore SDK queries |
| Access rules | Postgres row level security | Firebase Security Rules |
| Offline | Offline sync for chosen tables, per-table conflict rules | Firestore offline cache |
| Server code | Deno Edge Functions, SQL functions, cron, queues | Cloud Functions (Blaze plan) |
| Files | Storage with policies, image resizing, S3 API | Cloud Storage (Blaze plan) |
| Push | APNs, FCM, Web Push with in-app inbox | Firebase Cloud Messaging |
| Crash reporting, analytics | Built in, stored in your database | Crashlytics, Google Analytics |
| Pricing (as of November 2026) | Free; Pro $15.99/mo; Scale $49/mo; spend cap on by default | Spark free with quotas; Blaze pay as you go |
| Regions | EU only (Germany, Finland) | Google Cloud locations worldwide |
| Open source / self-host | No | No |
| Export | Whole project as pg_dump + files + users | Managed Firestore export to Cloud Storage (Blaze) |
#Data model: documents vs tables
Firestore is fast to start with. You write a document, and the collection exists. The cost comes later, when your data is relational. Say you want each user's open orders with the product names:
// Firebase (modular SDK)
const q = query(collection(db, 'orders'),
where('userId', '==', uid), where('status', '==', 'open'))
const orders = await getDocs(q)
// product names: one more read per product, or copy the name into every orderOn StitchDB, the same screen is one request, because the REST API can embed related tables through foreign keys:
const { data } = await stitchdb
.from('orders')
.select('id, status, order_items(qty, products(name, price))')
.eq('status', 'open')Row level security limits the result to the signed-in user's orders, so the client does not filter by user at all. You also get constraints (a quantity can't be negative, an order must reference a real product) enforced by the database rather than by every client.
Firebase now also offers Data Connect, which uses Cloud SQL for PostgreSQL. On Spark it is a 3-month trial; on Blaze, Cloud SQL is billed starting at about $9.37/month depending on region (as of November 2026). It is a good option if you want SQL while staying on Google Cloud.
#Security Rules vs row level security
Firebase Security Rules live in a separate rules file and guard Firestore and Cloud Storage. StitchDB policies live in the database and apply to REST, GraphQL, Realtime and Storage:
alter table public.orders enable row level security;
create policy "Users see their orders" on public.orders
for select to authenticated
using (user_id = auth.uid());One practical difference: a policy applies everywhere the data goes, including a direct Postgres connection that uses the API roles, realtime subscriptions and files in buckets. One caution: tables you create with SQL start with RLS off, so the data is readable with the anon key until you enable it. Studio's advisors and the exposure check flag this. See row level security.
#Offline
Firestore's offline cache is mature and one of Firebase's best features. StitchDB has offline sync for the tables you choose: reads come from a local copy, writes queue while offline and sync every 30 seconds and on reconnect, and each table has a conflict rule (latest edit wins, server wins, device wins, or your own SQL function). It is available in the JavaScript, Flutter, Swift and Kotlin SDKs. Rows created offline need a client-generated id, so use uuid primary keys.
If your app is offline-first at large scale and you want the longest track record, Firebase has the edge here.
#Pricing
Firebase's Spark plan is free with daily quotas: Firestore includes 1 GiB stored, 50K reads, 20K writes and 20K deletes per day, plus 10 GiB/month of egress. Auth includes 50K MAU. Cloud Functions and Cloud Storage are not available on Spark; since February 3, 2026, Cloud Storage requires the Blaze plan even for existing default buckets. Blaze keeps the free amounts and bills usage beyond them (as of November 2026; see firebase.google.com/pricing).
StitchDB's plans are flat (as of November 2026):
| Free | Pro | Scale | |
|---|---|---|---|
| Price | $0 | $15.99/mo | $49/mo |
| Database per project | 500 MB | 10 GB | 20 GB |
| File storage | 1 GB | 100 GB | 250 GB |
| Egress | 25 GB | 1 TB | 2 TB |
| Monthly active users | 50,000 | 100,000 | 200,000 |
| Edge Function invocations | 500,000 | 2M | 5M |
| Point-in-time recovery | 24 hours | 7 days | 14 days |
Reads and writes are not metered; the limit is requests per second (50 on Free, 1,000 on Pro, 2,000 on Scale). Paid plans start with the spend cap on, so the bill can't exceed the plan price unless you turn it off. See pricing.
The difference matters for read-heavy apps: a feed that loads 50 documents per screen view costs 50 Firestore reads each time. On a flat plan, that is one request.
#Push, crashes and analytics
This is where many Postgres backends fall short of Firebase, and where StitchDB does not. It has push notifications to iOS (APNs), Android (via FCM) and browsers (Web Push) from SQL, functions or your server, with a per-user in-app inbox; crash reporting for web, Node.js, Flutter, Android and iOS; and product analytics with funnels and retention stored in your own database.
Firebase's Crashlytics and Google Analytics are more established and integrate with the wider Google ecosystem (BigQuery, Ads). If you depend on those integrations, that is a reason to stay.
#Lock-in and data location
Neither platform is open source. The difference is the exit. A StitchDB project exports to a single archive on every plan: a pg_dump you can restore into any Postgres 15+, auth users with bcrypt hashes, files by bucket and function source. See export. Firestore exports are in Google's managed export format, which you then need to transform for another database.
On location, StitchDB runs only in EU data centers (Falkenstein and Nuremberg in Germany, Helsinki in Finland). That helps with GDPR, but users in Asia or the Americas will see more latency than with a nearby Google Cloud region.
#Which should you pick?
Pick Firebase if:
- Your app is offline-first mobile and you want the most proven SDKs.
- You need regions close to users worldwide.
- You rely on Google Analytics, BigQuery or other Google Cloud services.
- Your data is naturally document-shaped and you rarely need joins.
Pick StitchDB if:
- Your data is relational: users, teams, orders, comments, permissions.
- You want SQL for reporting and standard Postgres tools.
- You want a flat, capped monthly bill instead of per-operation pricing.
- You want EU data residency and a full export on every plan.
Moving over? Read Firebase to Postgres migration and the wider Firebase alternatives list.
#FAQ
#Is StitchDB a drop-in replacement for Firebase?
No. The SDKs and data model differ, so you rewrite data access. Auth, storage, functions, push and analytics all have equivalents.
#Can I use Firebase Cloud Messaging with StitchDB?
Yes. StitchDB push sends to Android through FCM; you upload your Firebase service account key in Studio.
#Is Firebase cheaper than StitchDB?
For small apps that stay within Spark quotas, Firebase can cost nothing. Read-heavy apps on Blaze often cost more than a flat plan; model your own traffic.
#Does StitchDB have offline support like Firestore?
Yes, through offline sync for selected tables in the JS, Flutter, Swift and Kotlin SDKs, with per-table conflict rules.
Try relational data with Firebase-style app services: create a free StitchDB project.