Databases

A Quick Guide to IBM Cloud Databases for PostgreSQL

Share this post:

Introducing Databases for PostgreSQL

As you may have seen, we’re launching a new range of databases called IBM Cloud Databases with Databases for PostgreSQL and Databases for Redis. If not, then let’s get you up to speed by looking at IBM Cloud Databases for PostgreSQL.

What is IBM Cloud Databases?

The experts on the IBM Compose team have been working to deliver databases on a next-generation platform. There were two design criteria. One was to build on a modern, open, cloud management platform—Kubernetes—rather than building one from scratch. The other criteria was that the new service had to integrate with IBM Cloud natively, as a provider and a consumer of services.

From those design criteria came the new architecture, with simpler access to the databases, cleaner high availability, and smoother backup orchestration. It’s all integrated with IBM Identity Access and Management (IAM) and provisioned as a native IBM Cloud service. Underneath that, a consistent system for managing stateful storage and backup storage does the heavy data lifting.

It is onto that solid platform that our developers are bringing battle-tested database configurations. And that’s IBM Cloud Databases.

What’s PostgreSQL?

PostgreSQL is an open source SQL relational database with an extensive set of capabilities. Each yearly release sees new features developed by a global community of companies and independent developers. Those features range from extensive JSON document support to powerful specialized indexes, from parallel query evaluation to full-text search, and all are accessible through a long list of language drivers and powerful administration tools.

What’s in IBM Cloud Databases for PostgreSQL?

A PostgreSQL database deployment is built up of a primary and secondary database server surrounded by a Patroni-based high availability configuration. Accessing the database is managed through a single Kubernetes Nodeport, behind which one or more HAProxy instances handle all the traffic.

So how do I get a PostgreSQL deployment like this?

Go to the IBM Cloud Catalog, look for Databases for PostgreSQL, and create a deployment from there. By default, you’ll be getting PostgreSQL 10, with 1GB of RAM and 5GB of storage allocated to each of the two database members. Click Create and off you go. When it’s all set up, you’ll be at the manage screen, where you can create credentials, set the admin password, and view the state of PostgreSQL.

I like the command line. What tools do you have?

IBM Cloud has an IBM Cloud CLI tool, and once installed, you can use it to provision and deprovision your databases. There’s also an IBM Cloud Databases plugin for it—just an ibmcloud plugin install cloud-databases command away. That then gives you commands to create users, set passwords, get connection strings, and much more.

Set the admin password with ibmcloud cdb user-password admin password. Then, assuming you have the PostgreSQL psql command installed, entering ibmcloud cdb cxn yourdatabasename -s is all you need to do to start an interactive session with the PostgreSQL database.

I like APIs. Where do I get started?

We have an API—the Cloud Databases API. This API gives you all the management features which are also exposed by the CLI. Provisioning and deprovisioning are managed, separately, by the IBM Cloud’s Resource Controller API. API Keys are provisioned through the IBM Cloud’s User API Keys.

How do I scale?

You can use the IBM Cloud Manage page. Go to the Settings view, and you can drag the sliders to as much memory and disk storage as you need. If you want precise control, the Cloud Databases CLI plugin or API are also able to set your scaling. Scaling happens with no disruptions or scheduled maintenance.

What extensions are configured with PostgreSQL?

PostgreSQL’s strength is its ability to be enhanced with extensions. From embedded languages to a respected GIS system, PostgreSQL extensions can improve your development process and let you do more with the database. We deliver Databases for PostgreSQL shipped with many extensions installed, but all but one (PLSQL) turned off. Each of the extensions can be activated with a single SQL command so you get exactly the extension power you need.

Why do you have so many versions of PostgreSQL?

The 9.x versions of PostgreSQL are designed for customers who have existing PostgreSQL databases and want to match version precisely. For all new users, we recommend (and default to) PostgreSQL 10 because it has all the latest features and fixes.

Where do I find out more about PostgreSQL?

The place to start for all things PostgreSQL is the PostgreSQL website and its extensive PostgreSQL manual.

Where do I find out more about IBM Cloud Databases for PostgreSQL?

Head over to the Databases for PostgreSQL documentation first. That covers everything you need to know about running your PostgreSQL on the IBM Cloud.

Compose's Technical Content Curator

More Databases stories
October 15, 2018

A Quick Guide to Redis Lua Scripting

In this post, we'll introduce Lua scripting for Redis, making sure that all the commands work with IBM Cloud Databases for Redis.

Continue reading

October 12, 2018

Querying the IBM Cloud Databases API from the Command Line

Querying APIs can look like a lot of complex and hard work at times. Sometimes the best way to explain things is to show, and in this article, we're going to show the process of querying the API of the just-launched IBM Cloud Databases.

Continue reading

October 10, 2018

A Quick Guide to IBM Cloud Databases for Redis

As you may have seen, we're launching a new range of databases called IBM Cloud Databases with Databases for PostgreSQL and Databases for Redis. If you are not yet familiar, then let's introduce you to IBM Cloud Databases for Redis.

Continue reading