PostgreSQL
Created:
Learning PostgreSQL
- DBA Roadmap: Learn to become a database administrator with PostgreSQL
- The Internals of PostgreSQL : Introduction
Articles
- The growing pains of database architecture at Figma. Scaling to $2B business with one RDS instance.
- Working
with PostgreSQL - Zerodha Tech Blog
This post is in the context of the large, data heavy PostgreSQL instances that store historical transactional data and reports, the databases that power Console and its large scale number crunching and reporting. It talks about how we self-host, tune, and manage all our DB instances on bare EC2 instances.
Migrating and upgrading PostgreSQL
Tips and tricks
- Nine
ways to shoot yourself in the foot with PostgreSQL. Discussion on
HN and notes:
seq_page_cost = 1.0 & random_page_cost = 4.0
for rusty disks. therandom_page_cost
can be a bit higher than 1.0 for SSDs.- Configure Vacuum and maintenance_work_mem regularly
- If you are deleting more than large no of rows (say 10,000) frequently, consider partitions
- consider using md5/sha hashes instead of big string indices if the lookup is exact match
- postgres scales well as a queue
- read the postgresql manaul fully!
- understand how EXPLAIN works
- PGTune - calculate configuration for PostgreSQL based on the maximum performance for a given hardware configuration
- Don’t Do This - PostgreSQL wiki
- pgBadger
is a PostgreSQL log analyzer built for speed with fully detailed reports and professional rendering. It outperforms any other PostgreSQL log analyzer.
- Postgres performance at any scale | PostgreSQL Tuning - pganalyze – has paid support at $149/mo for 1 db.
PostgreSQL and Full Text Search
This is one of the things PG does a good job. Keeping notes.
- Postgres Full Text Search vs the rest; HN; Oct 2022.
Using PostgreSQL as a queue
Choose Postgres queue technology :: Adriano Caloiaro’s personal blog
SQL Maxis: Why We Ditched RabbitMQ And Replaced It With A Postgres Queue
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)
PostgreSQL and ML
- Home – PostgresML –
An open source Postgres based platform for your interactive AI powered applications. Instantly scale your workloads with dedicated replicas or our serverless GPU accelerated cloud.
PostgreSQL on MacOS
Installing
PostgreSQL on a Mac with Homebrew - Daily Dev Tips – includes tips
on how to create a non-postgres
user.