PostgreSQL

Created: by Pradeep GowdaUpdated:Sep 26, 2024Tagged: postgresql · databases · sql .

PostgreSQL is Enough; and Just Use Postgres for Everything.

Just use Postgres

Learning PostgreSQL

Internals

Articles

Migrating and upgrading PostgreSQL

Tips and tricks

This is one of the things PG does a good job. Keeping notes.

Using PostgreSQL as a queue / Kafka

So that’s what we built: a new queue backed by a single, and surprisingly simple, Postgres table. Our publishers write to it. Our consumers (workers) read from it. We maintain things like queue ordering by adding an ORDER BY clause in the query that consumers use to read from it (groundbreaking, we know). And we guarantee that jobs won’t be picked up by more than one worker through simple read/write row-level locks. The new system is actually kind of absurdly simple when you look at it. And that’s a good thing. It’s also behaved flawlessly so far.

It comes with several, significant upsides for our team. For one, the application state is no longer spread out over two systems (RabbitMQ storage and Postgres). It’s now centralized in our application database. This makes disaster recovery that much easier, and increases the resiliency of the overall system by removing moving pieces.

To make all of this run smoothly, we enqueue and dequeue thousands of jobs every day.

(the load isn’t all that big)


Sequin “A Postgres alternative to Kafka. Get a feature-rich message stream with none of the operational overhead”. See Build your own SQS or Kafka with Postgres blog post.

PostgreSQL and ML

PostgreSQL on MacOS

Installing PostgreSQL on a Mac with Homebrew - Daily Dev Tips – includes tips on how to create a non-postgres user.

PostgreSQL on the cloud

  1. Supabase – “an open source Firebase alternative. Postgres database, Authentication, instant APIs, Edge Functions, Realtime subscriptions, Storage, and Vector embeddings”.
    1. postgres.new: In-browser Postgres with an AI interface by Supabase; HN
  2. Xata – “serverless data platform for PostgreSQL.”
  3. Tembo – “Tembo is the Postgres developer platform for building every data service.”

PostgreSQL-ish databases

Apart from the ones above (“on the cloud”),