Skip to main content
โšก Calmops

BaaS for Startups: Supabase vs Firebase vs Bun vs AppWrite in 2026

Introduction

Backend-as-a-Service (BaaS) platforms let startups ship products faster by handling authentication, databases, and serverless functions. In 2025, the battle between Supabase, Firebase, and newer players like AppWrite has intensified. This guide helps you choose the right BaaS for your startup.


Platform Overview

Comparison Matrix

# BaaS Comparison
platforms:
  - name: "Supabase"
    type: "Open-source"
    database: "PostgreSQL"
    auth: "Yes (built-in)"
    realtime: "Yes"
    storage: "Yes"
    edge_functions: "Yes (Deno)"
    pricing: "Generous free tier"
    
  - name: "Firebase"
    type: "Proprietary"
    database: "Firestore (NoSQL)"
    auth: "Yes (built-in)"
    realtime: "Yes"
    storage: "Yes"
    cloud_functions: "Yes (Node.js)"
    pricing: "Pay-as-you-go"
    
  - name: "AppWrite"
    type: "Open-source"
    database: "PostgreSQL + MongoDB"
    auth: "Yes (built-in)"
    realtime: "Yes"
    storage: "Yes"
    cloud_functions: "Yes (Node.js, Dart)"
    pricing: "Self-host free"
    
  - name: "Convex"
    type: "Proprietary"
    database: "PostgreSQL"
    auth: "Yes (built-in)"
    realtime: "Yes"
    storage: "Yes"
    functions: "Yes (TypeScript)"
    pricing: "Free tier available"

Supabase Deep Dive

Why Startups Choose Supabase

# Quick start with Supabase
npm install @supabase/supabase-js

# Or use Supabase CLI
npm install -g supabase
supabase init
supabase start

Database Features

-- Supabase: PostgreSQL with superpowers

-- 1. Real-time subscriptions
create table public.messages (
  id bigint generated by default as identity primary key,
  content text,
  user_id uuid references auth.users,
  created_at timestamptz default now()
);

-- Enable real-time
alter publication supabase_realtime add table public.messages;

-- 2. Row Level Security (RLS)
create policy "Users can see own messages"
  on messages for select
  to authenticated
  using (auth.uid() = user_id);

-- 3. PostgreSQL functions
create or replace function get_user_messages()
returns setof messages as $$
  select * from messages
  where user_id = auth.uid();
$$ language sql security definer;

-- 4. Triggers
create or replace function handle_new_user()
returns trigger as $$
begin
  insert into public.profiles (id, email)
  values (new.id, new.email);
  return new;
end;
$$ language plpgsql security definer;

create trigger on_auth_user_created
  after insert on auth.users
  for each row execute procedure handle_new_user();

Edge Functions

// supabase/functions/send-welcome-email/index.ts
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'

const corsHeaders = {
  'Access-Control-Allow-Origin': '*',
  'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
}

serve(async (req) => {
  if (req.method === 'OPTIONS') {
    return new Response('ok', { headers: corsHeaders })
  }

  try {
    const supabase = createClient(
      Deno.env.get('SUPABASE_URL')!,
      Deno.env.get('SUPABASE_ANON_KEY')!
    )

    const { user_id, email } = await req.json()

    // Send welcome email (integrate with Resend, SendGrid, etc.)
    console.log(`Sending welcome email to ${email}`)

    return new Response(
      JSON.stringify({ success: true }),
      { headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
    )
  } catch (error) {
    return new Response(JSON.stringify({ error: error.message }), {
      status: 500,
      headers: { ...corsHeaders, 'Content-Type': 'application/json' },
    })
  }
})

Firebase Deep Dive

When Firebase Makes Sense

// Firebase: Great for mobile and real-time apps

// 1. Firestore (NoSQL)
import { initializeApp } from 'firebase/app'
import { getFirestore, collection, addDoc, onSnapshot } from 'firebase/firestore'

const db = getFirestore(app)

// Real-time listener
function setupChatListener(chatId) {
  const messagesRef = collection(db, 'chats', chatId, 'messages')
  
  onSnapshot(messagesRef, (snapshot) => {
    const messages = snapshot.docs.map(doc => ({
      id: doc.id,
      ...doc.data()
    }))
    updateUI(messages)
  })
}

// 2. Authentication
import { getAuth, signInWithEmailAndPassword } from 'firebase/auth'
const auth = getAuth(app)

// 3. Cloud Functions
// functions/index.js
const functions = require('firebase-functions')
exports.onUserSignup = functions.firestore
  .document('users/{userId}')
  .onCreate(async (snap, context) => {
    const user = snap.data()
    // Send welcome email, setup defaults, etc.
  })

AppWrite

Self-Hosted Option

# AppWrite: Great for data privacy
# Can self-host for free

# docker-compose.yml
version: '3.8'
services:
  appwrite:
    image: appwrite/appwrite:1.4.0
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - appwrite:/storage
    environment:
      - _APP_ENV=production
      - _APP_REDIS_DISPLAY=host.docker.internal
      - _APP_DB_HOST=host.docker.internal
      - _APP_DB_PORT=5432
// AppWrite SDK
import { Client, Account, Databases } from 'appwrite'

const client = new Client()
  .setEndpoint('https://cloud.appwrite.io/v1')
  .setProject('[PROJECT_ID]')

const account = new Account(client)
const databases = new Databases(client)

// Auth
account.createEmailSession('email', 'password')

// Database
databases.listDocuments('[DATABASE_ID]', '[COLLECTION_ID]')

Pricing Comparison

Free Tier Limits

# Monthly free tiers (2025)
supabase:
  free:
    database: "500MB"
    api_calls: "Unlimited"
    auth: "50K monthly active users"
    storage: "1GB"
    bandwidth: "5GB"
  pro: "$25/month"
    database: "8GB"
    api_calls: "Unlimited"
    
firebase:
  free:
    firestore: "1GB"
    storage: "1GB"
    auth: "Unlimited"
    hosting: "1GB"
  blaze: "Pay as you go"
    # First $25/month free credit
    
appwrite:
  cloud:
    free: "1 project, 5 team members"
    pro: "$15/month"
  self_hosted:
    free: "Unlimited (your infrastructure)"

Cost at Scale

# Estimated costs at 100K MAU
platform_costs:
  supabase:
    compute: "$50"
    database: "$25"
    storage: "$20"
    total: "~$95/month"
    
  firebase:
    firestore: "$50-100"
    storage: "$30"
    functions: "$20"
    total: "~$100-150/month"
    
  appwrite_cloud:
    base: "$15"
    extra_usage: "~$50"
    total: "~$65/month"

Decision Framework

When to Choose Each

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    BaaS Selection Guide                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                             โ”‚
โ”‚  Choose SUPABASE if:                                       โ”‚
โ”‚  โ€ข You prefer SQL over NoSQL                               โ”‚
โ”‚  โ€ข You want open-source (self-host option)                 โ”‚
โ”‚  โ€ข You need PostgreSQL features (functions, triggers)      โ”‚
โ”‚  โ€ข You value data privacy                                   โ”‚
โ”‚                                                             โ”‚
โ”‚  Choose FIREBASE if:                                       โ”‚
โ”‚  โ€ข Building mobile-first app                               โ”‚
โ”‚  โ€ข Need real-time database with complex queries            โ”‚
โ”‚  โ€ข Already in Google ecosystem                              โ”‚
โ”‚  โ€ข Need ML Kit and other Google services                   โ”‚
โ”‚                                                             โ”‚
โ”‚  Choose APPWRITE if:                                        โ”‚
โ”‚  โ€ข Need complete data ownership (self-host)               โ”‚
โ”‚  โ€ข Team prefers Dart/Flutter                               โ”‚
โ”‚  โ€ข Need simple setup                                       โ”‚
โ”‚                                                             โ”‚
โ”‚  Choose CONVEX if:                                         โ”‚
โ”‚  โ€ข Want simplest possible DX                               โ”‚
โ”‚  โ€ข Need built-in actions (like serverless)                 โ”‚
โ”‚  โ€ข TypeScript-first team                                   โ”‚
โ”‚                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Takeaways

  • Supabase - Best for startups wanting PostgreSQL power with generous free tier
  • Firebase - Best for mobile apps and teams already in Google ecosystem
  • AppWrite - Best for data privacy and self-hosting requirements
  • All three - Can handle startup workloads at under $100/month initially

External Resources

Official Documentation

Comparisons

Comments