Posts - Shaun ThomasRSS

The Cache that Wasn’t: Optimizing Postgres for SELECT Performance

Published: Aug. 2, 2023, 5:19 p.m.

Everyone has a cache for database results, right? Something like redis or memcached to prevent unnecessary and comparatively slow calls to the database. No? Worry not, for with Postgres and some trigger magic, we can produce a cache where there was none before. Don’t let complicated and expensive queries limit your application throughput when you really need to put the pedal to the metal. Let us show you how!

Read more...

Let's Workshop an Unplanned Postgres Outage

Published: July 7, 2023, 11:41 a.m.

Nobody likes it when their database goes down for any reason, especially if it was unintentional. Sometimes companies are open about their experiences and provide post-mortems for the world to see, and we commend them for it. As Postgres experts, we want to take one of these and see what lessons were learned through the process, and how catastrophe may have been averted.

Read more...

The Do's and Don'ts of Postgres High Availability Part 3: Tools Rules

Published: June 22, 2023, 1:43 p.m.

There are some fundamental strategies inherent to deploying a functional and highly available Postgres cluster. In Part 2 of this blog series, we covered our recommendations on what one should and shouldn’t do while building a HA Postgres cluster when it comes to architecture. In Part 3 of this series, we’ll provide tips on establishing your architecture baseline.

Read more...

The Do's and Don'ts of Postgres High Availability Part 2: Architecture Baseline

Published: June 19, 2023, 2:25 p.m.

There are some fundamental strategies inherent to deploying a functional and highly available Postgres cluster. In Part 1 of this blog series, we covered our recommendations on what one should and shouldn’t do while building a HA Postgres cluster when it comes to expectations. In Part 2 of this series, we’ll provide tips on establishing your architecture baseline. 

Architecture


“You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete. ”

– Buckminster Fuller


While discussing architecture, we need to

Read more...

The Do's and Don'ts of Postgres High Availability Part 1: Great Expectations

Published: June 12, 2023, 10:48 a.m.

When it comes to maintaining Postgres high availability, there are some fundamental strategies inherent to deploying a functional and highly available Postgres cluster. In this first blog post of the series, we share recommendations on what one should and shouldn’t do while building a HA Postgres cluster, with tips on setting realistic expectations.

Read more...

Defining Extreme High Availability in a Postgres World

Published: May 15, 2023, 12:09 p.m.

What is “extreme” high availability when we’re talking about Postgres? Is it avoiding outages? Handling failovers? EDB Postgres Distributed defines a new era in high availability that defies description, so we’re going to try our best to define an entirely new level of database durability.

Read more...

PG Phriday: Addressing Demands of Highly Available OLTP Environments

Published: April 17, 2023, 11:36 a.m.

Would you use Postgres in a 1-billion transaction-per-day system? I have! It’s a sobering and rewarding experience that really reveals where Postgres shines. This article will explore a vintage 2011 platform which handled an extremely high transaction volume, and how things may have been done differently today.

Read more...

The Varying Cost of Synchronous Replication

Published: Feb. 23, 2023, 2:57 p.m.

Nobody wants to lose data. Understandably, most companies have a conservatively low Recovery Point Objective (RPO). Sometimes in order to fulfill these requirements, the resulting architecture must incorporate Postgres synchronous replication. What does this mean in terms of performance characteristics? How much does site-to-site latency affect this? Is it possible to overcome these effects? Let’s explore!

Read more...

Listening to Postgres: How LISTEN and NOTIFY Syntax Promote High Availability at the Application Layer

Published: Nov. 8, 2022, 2:34 p.m.

Postgres provides several tools to simplify application development. Triggers, for example, allow one event to automatically invoke subsequent inserts, updates, or deletes to either reinforce business logic, or for auditing purposes. But are they valid for all such scenarios? Are there times when triggers would be detrimental to performance and scalability? What are our alternatives? Well, there’s only one way to find out!

Read more...

Harnessing Shared Buffers - Part 2

Published: Oct. 26, 2022, 12:39 p.m.

In Part 1, we examined how Postgres behaves on older hardware with various allocations of Shared Buffers. This time we repeat those benchmarks on more contemporary hardware equipped with modern SSD storage. The difference this makes is dramatic and has far reaching implications. Join us as we discuss the continuing role of Shared Buffers in modern server deployments!

Read more...

Harnessing Shared Buffers (and Reaping the Performance Benefits) - Part 1

Published: Oct. 7, 2022, 10:56 a.m.

Postgres shared_buffers remains one of the most difficult parameters to configure since its inception. Beyond an initial estimate, query patterns, relative storage performance, available resources, and realistic limits can all influence the final value entered here. This is the first in a two-part series discussing the role of shared buffers in the past, and on more modern systems.

Read more...

PG Phriday: Defining High Availability in a Postgres World

Published: Aug. 26, 2022, 10:29 a.m.

What does High Availability actually mean when we’re discussing Postgres clusters? Sure, we can set an RPO, RTO, SLA, and other 3-letter acronyms regarding expectations and deliverables, but what are we trying to achieve? Fast failover? No lost transactions? Both? What about time necessary to rebuild or reclaim a former Primary node? How do all of our various replication configurables affect this? Let’s see if we can come up with a definition of High Availability that’s suitable to a Postgres context. This may seem a trivial exercise at first, but there’s a method to our madness.

Read more...

PG Phriday: Do’s and Don’ts of Postgres High Availability Q&A

Published: Aug. 8, 2022, 9 a.m.

As one of the last conferences for this year, Postgres Build 2021 has come and gone. My talk on the Do’s and Don'ts of Postgres High Availability was a kind of catch-all overview of how to avoid the worst-case scenarios we commonly encounter in the field by being proactive. At the end of each Postgres Build session is a short 10-minute Q&A where we try to answer viewer questions. Unfortunately, I had to skip a couple of questions due to time constraints, and others deserved more comprehensive answers. But that’s what blogs are for!

Read more...

PG Phriday: What You Should Know About Basic Postgres Authentication

Published: May 11, 2022, 1:12 p.m.

Frequent participants in the Postgres Discord and Slack servers, mailing lists, IRC chat, and other Postgres hangouts often hear a common refrain: I’ve installed Postgres, so now what? We may be tempted to say “Go forth young one, and explore!” Yet there’s a more fundamental question left unanswered: how do you even connect to explore in any capacity? What does that entail? Let’s explore how to connect to a fresh Postgres installation, and see what a new user really needs to know in order to experiment with Postgres.

Read more...

Steady Storage Stampede

Published: April 21, 2022, 11:55 a.m.

High Availability is more than just choosing the right architecture, replication tools, and failover systems. Storage can play a surprisingly important role in server responsiveness, as can somewhat obscure operating system tuning parameters. This week in PG Phriday, we’re going to examine just how important storage behavior can be to Postgres High Availability.

Read more...

PG Phriday: Tidying Up With VACUUM

Published: April 1, 2022, 11:15 a.m.

Hot on the heels of our discussion on preventing Postgres XID wraparound using basic monitoring, let’s talk about arresting the risk almost entirely through Autovacuum. With a few relatively minor tweaks to our configuration and focusing on the occasional problematic table, we can both increase maintenance throughput, and also reduce impact on client queries. Let’s demystify the art of VACUUM and keep our cluster self-maintaining in the bargain.

Read more...

PG Phriday: Wrapping Transactions Right Round

Published: March 17, 2022, 11:05 a.m.

Since transactions and replication within Postgres are essential to all types of availability, that means keeping the transaction ID state healthy. This Phriday we’ll cover the best configuration settings for avoiding this and take a look at what kind of monitoring we can employ as an early warning system. Don’t let the prospect of Postgres XID wraparound make you dizzy!

Read more...

Replication Revue

Published: Feb. 24, 2022, 11:23 a.m.

The types of Postgres clusters we can build to achieve high availability is highly dependent on the replication technologies we employ, both now, and in the future. Let’s explore how Postgres replication evolved to what it is today, and how it could grow in the future. By understanding this, we can design clusters that take full advantage of the tools Postgres makes available, and be ready for coming enhancements.

Read more...

PG Phriday: Nominally Bidirectional

Published: Feb. 4, 2022, 5:22 p.m.

Join us this week as we share a dire warning against misusing pglogical in an attempt to achieve bidirectional replication. The end result will likely incur data loss, node divergence, system outages, and be far more of a potential liability than many would expect. From additional necessary management scripts to maintain the facade, to unhandled conflicts mixing data, we’ll discuss just a few of the ways this seemingly innocent attempt at innovation can go wrong.

Read more...

PG Phriday: Replication Engine Potpourri

Published: Jan. 28, 2022, 9 a.m.

Given Postgres’ growing reputation as a leading and preferred relational database system among enterprises and hobbyists alike, it has garnered attention within the database tooling space as well. Some of these tools aim to fill a niche for what they perceive as missing Postgres functionality, while others proclaim Postgres compatibility with their pre-existing software. There are essentially dozens of these in the realm of logical replication technology alone, so why not explore a few of them, and see how they compare to native Postgres capabilities?

Read more...

PG Phriday: Isolating Postgres with repmgr

Published: Nov. 19, 2021, 9:55 a.m.

In this weeks PG Phriday, High Availability Architect Shaun Thomas explores some of the more advanced repmgr use cases that will bring your Postgres High Availability game to the next level.

Read more...

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

Published: Nov. 5, 2021, 9:18 a.m.

PG Phriday is back! EDB High Availability Architect Shaun Thomas revives his once infamous blog series to once again tackle technical topics at the tip of the Postgres world, this time with a special focus on High Availability.

Read more...