Skip to content
Valery

Module 10 · Lesson 4 of 6

Databases: Postgres, Supabase and Neon

Tables in plain words, when a spreadsheet stops being enough, Canadian regions, backups and row-level security.

10 min

Most brokerage tools start life in a spreadsheet: a sign-in sheet, a showing log, a list of rental inquiries. That works until a web form needs to write to it, three people edit it at once, or someone asks "who can see this?". At that point the data belongs in a database.

This lesson explains databases in plain words, shows when a spreadsheet stops being enough, and compares the two hosted Postgres services this course uses: Supabase and Neon. It also covers the questions a brokerage must ask about any database: where is the data stored, how is it backed up, and who can read each row.

Tables in plain words

A database holds tables. A table is like a spreadsheet tab with strict rules:

  • Each column has a name and a type: text, number, date and time, true or false. A phone column can't suddenly hold a date.
  • Each row is one record: one visitor, one showing, one lead.
  • Each row has a primary key, a unique ID the database assigns, so two visitors called Sam Lee never get mixed up.
  • Tables can point at each other. A showings row can store the ID of a row in listings, so you record the address once and refer to it everywhere.

Here is a sign-in table for an open house:

ColumnTypeExample (fictional)
idnumber, assigned automatically41
created_atdate and time2026-10-18 14:07
listing_addresstext123 Example Street, Toronto
full_nametextJordan Testcase
emailtext[email protected]
consent_to_contacttrue or falsefalse

You will rarely type into tables directly. Your app writes rows, and you read them through the service's table viewer or your CRM.

When a spreadsheet stops being enough

Move to a database when one or more of these is true:

  • A public form writes to it. Giving a website edit access to a shared spreadsheet is risky and fragile.
  • Several people or tools write at once. Spreadsheets handle this poorly; databases are built for it.
  • Different people should see different rows. Agents see their own leads; the broker sees everything.
  • You need a dependable history and backups. "Someone sorted only one column" should not be a disaster.
  • It's growing. Thousands of rows with formulas get slow and error-prone.

A spreadsheet is still fine for a one-person list that nothing else touches.

Postgres, Supabase and Neon

Postgres (PostgreSQL) is a free, open-source database used by businesses of every size. Supabase and Neon both run Postgres for you, so nobody at the brokerage has to manage a server. Because both use standard Postgres, data and code can move between them, and coding agents know Postgres well.

They differ in what comes with the database.

Supabase or Neon? (as of October 2026)
QuestionSupabaseNeon
What you getPostgres plus built-in sign-in, file storage and an automatic web APIPostgres with branching and scale to zero; sign-in through its managed Better Auth service
Free plan2 active projects, 500 MB database, paused after 1 week without activity, no automatic backups100 projects, 1 GB storage per project, 100 compute-unit hours per project a month, 6-hour restore window
Entry paid planPro from US$25 a month with US$10 compute credit and daily backups kept 7 daysLaunch, pay as you go with no monthly minimum, restore window up to 7 days
Canadian regionYes, Canada (Central)No; nearest regions are in the United States
Good fitA small app that needs sign-in and storage in one place, with data kept in CanadaSeveral small databases, test copies per branch, or a tight budget for light use

Prices and limits change, so confirm both on the vendors' pricing pages (in this module's sources) before you commit a client to one.

Branching, in Neon's sense, means making an instant copy of the database for testing, much like a Git branch for code. A preview deployment can get its own database branch with test data.

Scale to zero means the database sleeps when nobody uses it, which keeps light usage cheap. The first request after a sleep takes a moment longer.

Canadian regions and data residency

When you create a project, you pick a region: the data centre where the data is stored. As of October 2026, Supabase offers a Canada (Central) region (ca-central-1). Neon's regions are in the United States, Europe, Asia-Pacific and South America, with none in Canada.

Does the data have to stay in Canada?

PIPEDA does not ban storing personal information outside Canada, but the brokerage stays accountable for it and should tell people their information may be processed in another country. Quebec's privacy law requires a privacy impact assessment before personal information leaves Quebec. Some clients, franchise agreements and brokerage policies also require Canadian storage. When in doubt, pick a Canadian region for anything with client data. Module 11 covers the rules in detail.

Avoid "general" or automatic region options for client data. Supabase notes that its general regions may place data outside a particular jurisdiction.

Backups

A backup is a copy you can restore after a mistake: a bad import, a buggy release, an accidental delete. As of October 2026:

  • Supabase's free plan has no automatic backups. Pro keeps daily backups for 7 days.
  • Neon keeps a change history you can restore from: 6 hours on the free plan, up to 7 days on Launch and up to 30 days on Scale.

So a free plan is fine for a lab with fictional data and not for a brokerage's live records. For anything real, use a paid plan, and once a quarter actually test a restore into a test project. A backup nobody has ever restored is a hope, not a plan. Be careful with manual CSV exports as extra backups: each export is another copy of personal information that has to be stored securely and deleted on schedule.

Row-level security

Supabase gives every project an automatic web API, so apps can read and write tables directly from the browser. That is convenient and also the most common way small apps leak data. Supabase's documentation is blunt: a table in an exposed schema without row-level security is readable and writable by any role with a grant on it.

Access to a table is now a deliberate step. New Supabase projects (since 30 May 2026), and every project from 30 October 2026, no longer open new tables to the web API automatically. You add a grant, a one-line SQL permission that lets a role reach a table at all. Row-level security then decides which rows that role sees. The lab uses both.

Row-level security (RLS) is a Postgres feature that attaches rules to a table, checked on every request. A rule might say "an agent can read a lead only if they are the assigned agent" or "website visitors can add a sign-in row but never read any".

Supabase projects have two kinds of key:

  • The publishable key (older projects call it the anon key) is meant for browsers. What it can do depends entirely on your RLS rules. With RLS on and no rules, it can do nothing.
  • The secret key (older projects: service_role) bypasses RLS. It belongs only in server-side code and Vercel environment variables, never in a browser and never with a NEXT_PUBLIC_ name.

Practical rules for a brokerage app:

  1. Turn on RLS for every table, including ones you think are internal.
  2. Write the smallest rules that work, and ask your coding agent to explain each one in plain words.
  3. Where you can, have the browser call your own server code, which uses the secret key, instead of talking to the database directly. That is how this module's lab works.
  4. Test as an outsider: open the site in a private window and confirm you can't read other people's rows.

Neon works differently. Your app connects with a connection string (a URL containing the database password) from server code. Keep that string in a Secret environment variable and never send it to the browser.

In practice

Lakeshore Homes Brokerage's rental team logs showing requests for six fictional units in a shared spreadsheet that a web form writes to. Twice this year someone sorted one column and scrambled the rows, and an agent who left still had the link.

With an integration partner, they move to Supabase in the Canada (Central) region on the Pro plan. The coding agent creates a showing_requests table with RLS on. The website form posts to a server function that inserts rows with the secret key stored in Vercel. Agents sign in and see only requests for their assigned units; the property manager sees all of them. The departed agent's access ends because they no longer have an account. Daily backups run, and the partner adds a calendar reminder to test a restore every quarter.

The spreadsheet is exported one last time, the import is checked, and the old sheet is deleted, including from the drive's trash.

Common mistakes

  • Choosing a region by default and discovering later the data sits outside Canada.
  • Running live client records on a free plan with no backups.
  • Leaving RLS off "until later" on a table the public API can reach.
  • Putting the Supabase secret key or a Neon connection string in browser code.
  • Never testing a restore.

Key takeaways

  • A table is a strict spreadsheet; move to a database when forms, multiple writers, permissions or history matter.
  • Supabase and Neon both run standard Postgres; Supabase adds sign-in and storage and offers a Canadian region, Neon adds branching and scale to zero.
  • Choose the region deliberately and match it to your privacy obligations.
  • Free plans are for learning; live data needs backups you have actually restored.
  • Turn on row-level security everywhere and keep secret keys on the server.

Finished reading? Move on when you're ready.