High Availability, PostgreSQL, and More: The Return of PG Phriday

November 05, 2021

I’ve been writing about Postgres in one respect or another since 2010. That was around the time I started working for a high-velocity Options Trading firm that deployed an extremely robust Postgres High Availability stack managed by LifeKeeper, a commercial analog of Pacemaker, a common stack at the time. I had no idea how it worked, and I was in way over my head regarding everything except for Postgres.

The cluster was a collection of four nodes spread evenly across two data centers, with local, off-site, and vaulted backups that went above and beyond most retention policies thanks to SEC guidelines. It would take a concerted effort to permanently knock this Postgres cluster offline, and once we replaced the sluggish spinning rust with top-of-the-line FusionIO NVMe PCIe devices, not even a cold reboot would prevent instantaneous query results.

And it was also the birth of PG Phriday, because things weren’t always so robust.

 

Humble beginnings

It took a lot of work to extricate LifeKeeper and replace it with a combination of Pacemaker and DRBD so we wouldn’t have to rely on SIOS to manage the installation. I presented a truncated version of that cluster architecture at Postgres Open in 2012 in a live demo entitled “High Availability with PostgreSQL and Pacemaker.”

The important part is that I was dropped into a High Availability infrastructure knowing next to nothing about the subject, common software, general techniques, or even most of the standard terminology. It’s an unenviable position to say the least, and while I was confident in my Postgres knowledge, the design of that cluster was a massive learning experience. It taught me not just how all of the software worked and why, but that the topic itself was badly neglected.

I also learned that a lot of the internal developers were more familiar with ORMs and Oracle than they were with Postgres. There are a lot of important topics which are critical regarding optimal interaction with Postgres MVCC, predicates, set theory, and so on. So I made it my mission to help them get just a tiny bit better.

I started bi-weekly classes on Friday for anyone willing to attend. It covered topics from SELECT filters, materialized views, partitions, interpreting EXPLAIN, gotchas associated with certain aggregate functions, and much more. It was a cornucopia of material that fit the general themes of “a dev was having a problem with this recently” and “I audited the database usage and found something we could optimize.”

 

Giving back to the community

At some point I began producing more informal versions of these presentations and posting them on the internal Wiki, while simultaneously posting them (with permission) on my personal blog where they were then syndicated to Planet PostgreSQL. I needed something catchy, and as a child of the 80s, what better than adopting the motif of PG Phriday?

Thus from about March 2015 to the end of April 2017, I made a valiant—if futile—effort to maintain a weekly cadence. By the time I’d transitioned to 2ndQuadrant (now EDB), I was having trouble coming up with material I hadn’t already covered. I despaired for topical content, but kept posting on the company site anyway, just with less frequency.

Part of the issue, as it frequently happens, was that I was simply too busy. Working with customer contracting engagements and the Support team was more juggling than I expected, and I failed to prioritize maintaining the Blog. It was an oversight to be sure, given its relative popularity at the time.

 

An overdue rebirth

So, what now? First things first: PG Phriday is coming back in a slightly altered incarnation. My dual inspiration to both assist internal software devs and the community is unchanged, but it’s also time to address the topic that has since become my raison d'être: High Availability. It’s still an underserved topic with a plethora of concepts, architectures, tools, and techniques yet to see adequate representation.

My Postgres High Availability Cookbook is now in its third edition, and nary a Postgres conference, webinar, User Group meeting, or completely unrelated conversation regarding the flight speed of an unladen swallow, will avoid my unsolicited opinion on the topic. Indeed, PG Phriday has covered High Availability copiously, and it will continue to do so now, only more so.

In the interceding and impromptu sabbatical, I’ve come up with dozens of ideas represented in both the theoretical and practical realms to render Postgres clusters more robust. It’s going to be a reinvention of Postgres High Availability from the ground up, with occasional asides to cover important topics du jour so we don’t get bogged down by arduous hypotheticals.

So please join us over at EDB for a long overdue resurgence of PG Phriday. It will still have the same slightly irreverent approach, complete with silly memes, song lyrics as headings, and an interminable proliferation of awful puns. Just… the worst puns imaginable. But really, what else can you expect from an author who names his Postgres blog serial as a homophone for an old movie?

Hope to see you there!
 

Read moreIntegrating PostgreSQL Part 6: High Availability and Disaster Recovery Tools

Share this

Relevant Blogs

What is pgvector and How Can It Help You?

There are a thousand ways (likely more) you can accelerate Postgres workloads. It all comes down to the way you store data, query data, how big your data is and...
November 03, 2023

More Blogs

pgAdmin CI/CD

Almost exactly three years ago I wrote a blog on my personal page entitled Testing pgAdmin which went into great detail discussing how we test pgAdmin prior to releases. Back...
August 24, 2023