Urgent.News

What's breaking now, across thousands of outlets.

Tech

Running Real Postgres Locally Without Docker (with Tinbase)

TL;DR Docker Supabase on an 8 GB laptop: 12 containers, ~1.6 GB RAM idle, 45 s cold boot Tinbase: one ~58 MB binary, real Postgres 17, ~100 MB RAM idle, ~2.5 s cold boot supabase-js works with zero code changes: swap one env var Migrate an existing project with supabase db dump | tinbase import RLS, edge functions, and realtime use the same contract as hosted Supabase Not for you if you live in…

Running Real Postgres Locally Without Docker (with Tinbase)

Docker Supabase on an 8 GB laptop consumes 12 containers and approximately 1.6 GB of RAM at idle, taking 45 seconds to cold boot. Tinbase addresses these issues by providing a single 58 MB binary that runs real Postgres 17 and all Supabase features, such as authentication, real-time updates, and edge functions. This results in a much faster cold boot time of around 2.5 seconds and minimal RAM usage of ~100 MB.

To install Tinbase on macOS or Linux, users can run the following command:

curl -fsSL https://tinbase.dev/install.sh | sh

Then, they can start the server with the command:

tinbase start --data-dir ~/tinbase-data

This command creates a directory to store data and starts the server listening on http://localhost:8080. The boot time is reported as ~2.5 seconds cold, with ~800 milliseconds warm.

Supabase-specific code remains unchanged when using Tinbase. Developers only need to update two environment variables:

SUPABASE_URL=http://localhost:8080

SUPABASE_ANON_KEY=<generated_key>

These variables are typically printed by the tinbase start command. After updating the environment variables, existing Supabase code can be used with Tinbase without any modifications.

To migrate an existing Supabase project to Tinbase, users can first dump the schema and data with the command:

supabase db dump --file dump.sql --data-only = false

Next, they can load the data into Tinbase using:

tinbase import --file dump.sql

After the import, they can verify the data by running:

psql postgresql://postgres@localhost:5432/postgres -c \dt

Tinbase supports various Postgres extensions, such as pgvector for embeddings, pg_trgm for fuzzy text matching, pg_stat_statements for query profiling, and more. Users can enable these extensions manually or let Tinbase do it automatically by running:

tinbase import --file dump.sql

RLS (Row-Level Security) policies, edge functions, and realtime subscriptions behave identically in Tinbase compared to hosted Supabase. Tinbase's RLS policies work exactly as they do in Supabase, ensuring that policies written for Supabase continue to function correctly when migrated to Tinbase.

Edge functions in Tinbase are run in an embedded V8 engine, with a cold start time of about 15 milliseconds. The following example shows a simple edge function written in JavaScript:

// functions/hello.ts

export default async (req : Request) = {

return new Response ( JSON . stringify ({ msg : hi }), { headers : { content-type : application/json }, });

};

Tinbase serves this function with the command:

tinbase functions serve

The function can be accessed at http://localhost:8080/functions/v1/hello, returning the expected output:

{ msg : hi }

Realtime subscriptions in Tinbase work similarly to Supabase. Users can create a channel and subscribe to specific events, such as INSERT operations on the projects table:

supabase . channel ( projects ) . on ( postgres_changes , { event : INSERT , schema : public , table : projects }, ( payload ) = {

// Handle the event

});

This allows developers to build real-time features using the same contract as Supabase.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Pro-Data Center Party Interrupted By Protesters in D.C.

A party was held in D.C. to celebrate data centers, which have become a flashpoint in the debate over AI’s rapid expansion.

  • Pro-data center party held in D.C. amid opposition to construction.
  • Protester interrupts celebration with passionate rant against water usage.
  • Chant of "USA!" persists despite protest during the event.

More from Monday 28 September →