# Fóir compared with Firebase

Both give you a database, sign-in, files, realtime, hosting and push. Fóir also runs durable app logic, email, content and plans, so your agent configures them instead of connecting another service for each.

## Part by part

| Part | Firebase | Fóir |
| --- | --- | --- |
| Database and API | Built in: Firestore, plus Postgres through SQL Connect. Access is rules and directives you write | A typed API and SDK, with access checked in Postgres on every read |
| SDKs and MCP server | Built in: Platform SDKs, a CLI and an MCP server. SQL Connect generates typed SDKs | A typed SDK, CLI and MCP server for every project, generated from one contract |
| Sign-in | Built in: Firebase Auth, with SAML, OIDC and tenants via Identity Platform. No SCIM | Hosted sign-in on your domain, SAML and SCIM for any organisation, and an audit log each one can read |
| App logic and jobs | Partly: Cloud Functions on events, schedules and queues. Steps and undo are yours to build Most teams add Inngest. | Declared steps with retries and undo, started by calls, schedules or verified webhooks, and run as the caller |
| AI agents and chat | Built in: AI Logic chat with tool calls, plus Genkit agents in beta | Agents with your data as tools, chat streamed to your app, each run in its own sandbox |
| Notifications | Partly: Cloud Messaging push and In-App Messaging. Email isn't included Most teams add Resend. | Email from your own domain, push and in-app, all from one step, with bounces as events |
| Realtime | Built in: Firestore and Realtime Database listeners. SQL Connect adds live query refresh | Every read can be watched |
| Hosting | Built in: Hosting and App Hosting, with a preview channel per pull request | foir.build or your own domain, with a preview for every pull request |
| Files, images and video | Partly: Cloud Storage with security rules. Images aren't transformed and video isn't transcoded Most teams add Cloudinary. | Images as WebP and AVIF, video streaming, and signed links |
| Search | Built in: Full-text and vector search in SQL Connect. Firestore geo search is in preview | Search by meaning and by distance |
| Content and translation | Add a service: Not included Most teams add Contentful. | Drafts, versions, scheduled publishing, and translation into each of your locales |
| Admin and support | Partly: The Firebase console edits users and data. Admin pages are yours to build Most teams add Retool. | Your pages, notes, approvals and impersonation in the console |
| Personalisation | Built in: Remote Config with audience conditions, A/B Testing and personalisation | Variants of any record, field or list item, by audience |
| Plans and entitlements | Add a service: Not included Most teams add Stigg. | Plans that gate any model or logic, granted by a subscription |
| Payments | Add a service: Not included. Firebase Extensions, including Stripe's, shut down in March 2027 Most teams add Stripe. | Your own accounts, connected for you. Fóir turns their events into entitlements and takes no percentage |

## The same app, built on each

### Keeping studios apart

`firestore.rules`

```rules
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    // Every collection a studio owns needs a rule like this one.
    match /studios/{studioId}/bookings/{bookingId} {
      allow read, create: if request.auth != null
        && exists(/databases/$(database)/documents/studios/$(studioId)/members/$(request.auth.uid));
    }
  }
}
```

Then rules for update and delete, and a members collection to keep in step with who belongs where.

`foir.config.ts`

```ts
userRoles: [
  { key: 'owner', name: 'Studio owner', isDefault: false,
    grants: ['records:write:class'] },
  { key: 'member', name: 'Member', isDefault: true,
    grants: ['records:read', 'records:write:booking'] },
],
```

Each studio is an organisation. Postgres checks every read and write against the caller's organisation and role, so no policy is written by hand.

### Holding a place for 15 minutes

`functions/src/holds.ts`

```ts
export const releaseHolds = onSchedule('every 1 minutes', async () => {
  const expired = await db.collectionGroup('bookings')
    .where('status', '==', 'held')
    .where('heldUntil', '<', Timestamp.now())
    .get();
  await Promise.all(expired.docs.map((d) =>
    d.ref.update({ status: 'open', heldUntil: null })));
});
```

Plus a heldUntil field, a function for Stripe's webhook, and another to offer the place to the waitlist. The sweep runs once a minute.

`bookings.reserve`

```ts
const pay = step.first('pay', {
  paid:    step.waitForEvent('paid', 'booking.paid', { match: id }),
  expired: step.sleep('timeout', '15m'),
}, { after: [hold] });

const offer = step.operation('offer', 'waitlist.offer', { bookingId: id },
  { when: rule(pay.winner).eq('expired') });
```

The run waits for whichever comes first and frees the place on time. A deploy or a restart in between changes nothing.

## What each costs

- Firebase: **Free** Spark plan: no-cost quotas, no payment method needed
- Firebase: **Pay as you go** Blaze plan: Spark's free quotas included, then billed by usage; eligible accounts get $300 credit
- Firebase: **Sign-in** Identity Platform free to 50,000 monthly users (50 for SAML or OIDC), then Google Cloud rates

- Fóir: **Free** For one project and 1,000 records
- Fóir: **£0.99** a month for Entry, after a 90-day trial with no card
- Fóir: **£29** a month for Starter, and £99 for Pro. Hosting and sign-in come with every plan

Firebase's prices are from firebase.google.com/pricing, checked on 16 November 2026.

## Start building for free

Production-ready from the first preview.
