7 min read
Cloud developer learning Supabase: what carries over, what's new, 30-day plan
Practical guide for cloud engineers transitioning to Supabase, covering transferable skills, new concepts, pitfalls, a 30‑day roadmap, and quick FAQ.
What carries over
| Cloud concept | Supabase equivalent | Why it still matters |
|---|---|---|
| Infrastructure as Code (IaC) | supabase projects create via the Supabase CLI, plus Terraform provider for Supabase | You already write Terraform modules or CloudFormation stacks; the same declarative mindset applies when provisioning databases, auth, and storage. |
| SQL‑first mindset | PostgreSQL instance managed by Supabase | Supabase runs on vanilla PostgreSQL, so all your knowledge of schemas, indexes, CTEs, and extensions (e.g., pgcrypto) transfers directly. |
| Environment variables & secret management | .env file for SUPABASE_URL and SUPABASE_ANON_KEY, plus Supabase's built‑in secrets UI | You already inject secrets at deploy time; Supabase expects the same pattern, just with its own naming conventions. |
| Serverless functions / edge compute | Supabase Edge Functions (Node.js runtime) | The idea of stateless functions triggered by HTTP or auth events is identical; only the deployment command changes (supabase functions deploy). |
| Observability | Supabase logs (via the dashboard) and supabase db log CLI | Your habit of tailing logs, setting alerts, and correlating request IDs continues, just with Supabase‑specific endpoints. |
| Role‑based access control (RBAC) | PostgreSQL GRANT statements + Supabase Row Level Security (RLS) policies | You already design least‑privilege roles; Supabase adds a declarative RLS layer that you configure with SQL. |
| CI/CD pipelines | Use the same GitHub Actions or GitLab CI, just add Supabase CLI steps (supabase db push, supabase functions deploy) | The pipeline structure—checkout, test, deploy—remains unchanged. |
| API gateway patterns | Supabase auto‑generates a RESTful endpoint (/rest/v1) and a GraphQL endpoint (/graphql/v1) | If you’re used to API gateways (API Gateway, Azure API Management), you’ll recognize the same request‑routing concepts; Supabase just provides them out of the box. |
What's new
Supabase abstracts a lot of the plumbing you normally provision yourself. Below are two common tasks—creating a table and securing it—with a pure‑cloud approach versus the Supabase approach.
Cloud (manual PostgreSQL + custom auth)
# 1. Create a PostgreSQL instance (e.g., using AWS RDS)
aws rds create-db-instance \
--db-instance-identifier mydb \
--engine postgres \
--master-username admin \
--master-user-password $DB_PASSWORD \
--allocated-storage 20
# 2. Connect and create a table
psql "host=$HOST dbname=postgres user=admin password=$DB_PASSWORD" <<SQL
CREATE TABLE todos (
id SERIAL PRIMARY KEY,
user_id UUID NOT NULL,
title TEXT NOT NULL,
completed BOOLEAN DEFAULT FALSE,
created_at TIMESTAMPTZ DEFAULT now()
);
SQL
# 3. Write a Lambda authorizer to enforce ownership
# (pseudo‑code, language agnostic)
function authorize(event) {
const token = event.headers.Authorization;
const user = verifyJwt(token, JWKS_URL);
// Attach user ID to request context
return { principalId: user.sub };
}
Supabase
# 1. Initialise a Supabase project (CLI)
supabase init
supabase start # runs local Docker containers
# 2. Create the same table via migration
supabase db reset # creates a fresh DB
cat <<SQL > supabase/migrations/20240101_create_todos.sql
create table todos (
id bigint generated by default as identity primary key,
user_id uuid not null,
title text not null,
completed boolean default false,
created_at timestamptz default now()
);
SQL
supabase db push # applies migration
# 3. Enable Row Level Security and a policy
supabase db remote set --project-ref <ref>
psql $SUPABASE_DB_URL <<SQL
alter table todos enable row level security;
create policy "owner can manage own todos"
on todos for all
using (auth.uid() = user_id);
SQL
What changed and why
| Aspect | Cloud | Supabase |
|---|---|---|
| Provisioning | You spin up a DB instance, configure networking, backups, etc. | Supabase spins up a fully managed PostgreSQL cluster; the CLI abstracts the create-db-instance call. |
| Auth integration | You must build or integrate an identity provider and pass the user ID to your services. | Supabase Auth is baked in; auth.uid() is available in RLS policies, eliminating custom token verification. |
| API surface | You expose your own REST/GraphQL layer (e.g., via API Gateway + Lambda). | Supabase auto‑generates /rest/v1 and /graphql/v1 endpoints that respect RLS automatically. |
| Deployment friction | Multiple scripts, IAM roles, and separate CI steps. | Single CLI command (supabase db push) updates schema; functions are deployed with supabase functions deploy. |
Common pitfalls
- Assuming Supabase is “serverless” for everything – Only Edge Functions run serverlessly; the PostgreSQL instance is a managed service, not a stateless function. Heavy batch jobs should still be offloaded to a proper compute service.
- Neglecting RLS – By default, tables are open to anyone with the service key. Forgetting to enable RLS and write policies exposes data. Always
ALTER TABLE … ENABLE ROW LEVEL SECURITYearly in the schema design. - Mixing service role and anon key – The
SUPABASE_SERVICE_ROLE_KEYbypasses RLS. Use it only in trusted back‑ends (e.g., CI jobs). Accidentally using it in a client‑side app grants full admin rights. - Over‑relying on auto‑generated REST – The auto‑generated
/rest/v1endpoint follows PostgREST conventions. Complex queries (joins, aggregates) may require RPC functions or GraphQL; trying to force everything through the generic endpoint can lead to inefficient queries. - Version drift between local and remote –
supabase startruns a local Docker stack. If you manually modify the local DB without a migration,supabase db pushwill fail on remote. Keep every schema change in a migration file. - Ignoring storage bucket CORS – Supabase Storage defaults to a restrictive CORS policy. If your front‑end can’t fetch images, you need to add the appropriate origins via the dashboard or
supabase storage bucket update.
Your 30‑day plan
Week 1 – Foundations
- Install the Supabase CLI, Docker, and set up a local dev environment (
supabase start). - Create a new project on supabase.com, note
SUPABASE_URL,SUPABASE_ANON_KEY, andSUPABASE_SERVICE_ROLE_KEY. - Write your first migration: a
userstable with UUID primary key,email,created_at. - Enable RLS on
usersand add a policy that only the owner can read/write their row. - Mini‑project: Build a simple sign‑up / login flow using Supabase Auth (email‑magic link) and store a profile row linked to the user.
Week 2 – Data access patterns
- Add a
poststable with a foreign key tousers. - Create an RLS policy that allows anyone to read posts but only the author to edit/delete.
- Experiment with the auto‑generated REST endpoint:
GET /rest/v1/posts?select=*. - Write a PostgREST RPC (
create_post) that inserts a post and returns the inserted row. - Mini‑project: Build a tiny “micro‑blog” front‑end that lists posts, lets the logged‑in user create a post, and updates in real time using Supabase Realtime.
Week 3 – Edge Functions & Storage
- Scaffold an Edge Function (
supabase functions new send-welcome-email). - Use the
@supabase/supabase-jsclient inside the function to fetch the new user’s email and send a mock email (log to console). - Deploy the function and hook it to the
auth.sign_upwebhook via the dashboard. - Create a storage bucket
avatars, configure public read CORS for your domain. - Mini‑project: Extend the micro‑blog to allow users to upload an avatar image; display it next to each post.
Week 4 – CI/CD, Monitoring, and Production Prep
- Add Supabase CLI steps to your existing GitHub Actions workflow:
supabase db push,supabase functions deploy. - Enable Supabase logs streaming (
supabase logs tail) and set up a simple alert (e.g., email on function error) using your cloud provider’s alerting service. - Review all RLS policies, run
supabase db reset --skip-seedon a fresh clone to verify migrations are reproducible. - Harden secrets: move
SUPABASE_ANON_KEYandSERVICE_ROLE_KEYto your provider’s secret store; ensure they are never committed. - Capstone project: Deploy the micro‑blog to a production‑like environment (Vercel, Netlify, or static hosting) using the same CI pipeline; verify auth, storage, and edge function work end‑to‑end.
FAQ
How does Supabase Auth differ from Cognito or Azure AD?
Supabase Auth is a lightweight, email‑first system with built‑in JWTs; it lacks the extensive federation and SAML features of Cognito/Azure AD but integrates tightly with Postgres RLS via auth.uid().
Can I use my existing PostgreSQL instance with Supabase features?
Only the managed Supabase Postgres instance supports the built‑in RLS helpers and auto‑generated APIs. You can connect external tools, but you lose the seamless Auth‑RLS integration.
Are Edge Functions the same as AWS Lambda?
Conceptually yes—stateless functions triggered by HTTP or auth events—but they run on Deno (or Node) within Supabase’s infrastructure and are deployed with supabase functions deploy.
Do I still need a separate CDN for static assets?
Supabase Storage can serve public files directly, but for high‑traffic sites a CDN (e.g., Cloudflare) in front of the bucket can improve latency and caching.
Keep going
- See what already transfers: take the free Cloud → Supabase readiness check
- Related: Vue developer learning React: what carries over, what's new, 30-day plan
- Related: Vue developer learning Angular: what carries over, what's new, 30-day plan
#supabase #cloud #onboarding #guide