PgBouncer is a popular proxy and pooling layer for Postgres. It's extremely common to reconfigure PgBouncer with repmgr so it always directs connections to the current primary node. It just so happens our emerging Docker stack could use such a component.In our last article, we combined Postgres with repmgr to build a Docker container that could initialize and maintain a Postgres cluster with automated failover capabilities. Yet there was the lingering issue of connecting to the cluster. It's great that Postgres is always online, but how do we connect to whichever node is the primary?While we could write a layer into our application stack to call repmgr cluster show to find the primary before connecting, that's extremely cumbersome. Besides that, there's a better way. Let's alter our stack (more…)
Building an Immortal ClusterBy now we've learned about basic Postgres Docker usage and rudimentary clustering. For the uninitiated, constructing a Postgres cluster can be a daunting task, and we've greatly simplified the process. So why don't we take the next logical step and use Docker to deploy a cluster that is effectively immortal as well? How is that possible? Why, with repmgr of course! 2ndQuadrant has a tool specifically designed to set up and maintain Postgres clusters. One of the components of repmgr is a daemon that can automatically promote replicas whenever the current primary goes down. Let's leverage that to make something that's always online until every node is stopped.My power is in my own handAs before, we're going to need a few scripts to manage the finer points. We can (more…)
In our last article, we explored how to run Postgres in some very basic Docker scenarios. Based on our experiments back then, we can obtain images, create containers, and mount to various types of storage.Boring!It's not just boring, it's mundane. It doesn't do anything. Sure we can run Postgres in a container, but that's true about a lot of things. You know what's exciting? Setting up Postgres streaming replication between two docker containers.Let's get started.He say "I know you, you know me"The first thing we need to do is create a container that will be our primary host. Postgres requires a user with REPLICATION permission, as well as a special entry in the pg_hba.conf file for the "replication" pseudo-database. We could start a regular Postgres container, connect to it, and set all (more…)
Fans of Rapid Application Development (RAD!) are probably already familiar with Docker, but what does that have to do with Postgres? Database-driven applications are a dime a dozen these days, and a good RAD environment is something of a Holy Grail to coders and QA departments alike. Docker lets us spin up a Postgres instance in seconds, and discard it with a clean conscience.
There have even been some noises within certain circles about using it in a production context. Can we do something like that responsibly? Docker containers are practically guaranteed to be ephemeral, while production data most decidedly isn't. The answer to this is ultimately complex, and something we'll be exploring over the next several weeks.
Let's get started.
Let There Be Light
Since Docker itself is a (more…)
We very often hear about devops culture, lean and agile methodologies, kanban, pair programming, peer review, testing, and many more; but how many of us could effectively put these things into practice?
Did you know - 2ndQuadrant has the largest single, collection of PostgreSQL experts of any company globally?!
With a team of some of the best known developers, they all still actively contribute to the progressive development of PostgreSQL. Would you like to have access to some of the most knowledgeable and experienced people available? The 5432...MeetUs! post-conference training is your chance!
In addition to the Kanban System Design training course with Dragos Dumitriu we mentioned last week, there will be a variety of other training courses in the days following the 5432...MeetUs! conference. When you attend a course with 2ndQuadrant, you learn from experts who understand PostgreSQL, the platforms, programs, and languages at the deepest level.
Learn in depth about the (more…)
If you are eager to learn new competencies or advance your skills in PostgreSQL and other Open Source programs, platforms, and languages, you should join us at the 5432...MeetUs! conference!
Between the workshop track offered during the conference and the optional trainings offered in the two days following the conference, it looks like there will be something for everyone at this conference. There's a chance to be hands-on with different programs, platforms and languages such as Docker, Repmgr and more - we also hear that they will have some Raspberry Pis that you can experiment with.
The workshops are an optional track during the conference (it is required that you register in advance) and the trainings will be held in the days following the conference.
Some of our very (more…)