Monday, September 24

On Rocks and Sand

Shaun's PlanetPostgreSQL
When working with database capacity planning, there are a lot of variables to consider, and Postgres is no different in this regard. One of the elements which requires management is storage. However, there's an aspect of storage that escapes inspection almost without exception, and it's hiding in the shadows between the columns themselves. Alignment Basics In most low-level computer languages like C, in which the venerable Postgres is written, data types are addressed by their maximum size, regardless of how large they actually are. Thus a standard 32-bit integer which can store a value of just over 2-billion, must be read as a whole unit. This means even the value of 0 requires 4 bytes of storage. Further, Postgres is designed such that its own internal natural alignment is 8 bytes, (more…)

Partitioning Improvements in PostgreSQL 11

Alvaro's PlanetPostgreSQL, PostgreSQL
A partitioning system in PostgreSQL was first added in PostgreSQL 8.1 by 2ndQuadrant founder Simon Riggs. It was based on relation inheritance and used a novel technique to exclude tables from being scanned by a query, called “constraint exclusion”. While it was a huge step forward at the time, it is nowadays seen as cumbersome to use as well as slow, and thus needing replacement. In version 10, it was replaced thanks to heroic efforts by Amit Langote with modern-style “declarative partitioning”. This new tech meant you no longer needed to write code manually to route tuples to their correct partitions, and no longer needed to manually declare correct constraints for each partition: the system did those things automatically for you. Sadly, in PostgreSQL 10 that's pretty much (more…)

Webinar : Database Security in PostgreSQL [Follow Up]

Liaqat's PlanetPostgreSQL, Webinars
Database security is an increasingly critical topic for any business handling personal data. Data breach can have serious ramifications for an organization, especially if the proper security protocols are not in place. There are many ways to harden your database. As an example PostgreSQL addresses security using firewalls, encryption and authentication levels among other ways. 2ndQuadrant hosted a webinar on Database Security in PostgreSQL to highlight security concepts, features and architecture. The webinar was presented by Kirk Roybal, Principal Consultant at 2ndQuadrant - the recording is now available here. Some of the questions that Kirk responded to are listed below: Q1: What are your thoughts on performance of row-level security vs. doing that filtering via WHERE at (more…)

PostgreSQL for IoT Data Retention and Archiving

Haroon's PlanetPostgreSQL, Internet of Things
We do understand that IoT revolution is resulting in enormous amounts of data. With brisk data growth where data is mostly time series append-only, relational databases and DBAs have a rather tough task to store, maintain, archive and in some cases get rid of the old data in an efficient manner. In my previous posts, I talked about various strategies and techniques around better scalability for data storage using PostgreSQL and Postgres-BDR extension. Data retention is becoming ever so important. So let’s see what PostgreSQL 10 and above have to offer to efficiently manage your data retention needs. PostgreSQL has supported time based partitioning in some form for quite some time. However, it wasn’t part of the core PostgreSQL. PostgreSQL 10 made a major improvement in this area by (more…)

Upgrading to PostgreSQL 11 with Logical Replication

2ndQuadrant, Eisentraut's PlanetPostgreSQL, PostgreSQL
It's time. About a year ago, we published PostgreSQL 10 with support for native logical replication. One of the uses of logical replication is to allow low- or no-downtime upgrading between PostgreSQL major versions. Until now, PostgreSQL 10 was the only PostgreSQL release with native logical replication, so there weren't many opportunities for upgrading in this way. (Logical replication can also be used for moving data between instances on different operating systems or CPU architectures or with different low-level configuration settings such as block size or locale -- sidegrading if you will.) Now that PostgreSQL 11 is near, there will be more reasons to make use of this functionality. Let's first compare the three main ways to upgrade a PostgreSQL installation: pg_dump and (more…)

PostgreSQL installer by 2ndQuadrant – now supports OmniDB!

2ndQuadrant, Marriya's PlanetPostgreSQL, OmniDB, PGInstaller
PostgreSQL installer or PGInstaller - is a user-friendly, graphical installation and configuration tool for PostgreSQL. With just a few clicks you can install PostgreSQL - version 9.5, 9.6, 10 and 11(beta) - on Windows, Linux and macOS. The latest PGInstaller release includes support for OmniDB - an interactive and user-friendly database management tool to manage multiple databases in a unified workspace. Using utilities bundled with PostgreSQL, the only means to connect to the database is via psql. Psql works via the command line, which can be fairly tricky for new users especially if they are migrating from another database and are not used to the interface. PGInstaller makes the connection process easier with OmniDB. PGInstaller comes bundled with OmniDB, as an optional (more…)

[Video] Data Integration with PostgreSQL

PostgreSQL, Shaun's PlanetPostgreSQL
Just in case you missed the live broadcast, the video of my presentation below covers various topics around integration of PostgreSQL with other data sources and database technologies. This presentation covers the following topics: What is a Foreign Data Wrapper? How to query MySQL, a Flat file, a Python script, a REST interface and a different Postgres Node Perform all of the above simultaneously Take snapshots of this data for fast access Tweak remote systems for better performance Package as an API for distribution Stream to Kafka Write data to... MongoDB!? What does all of this have in common? It's an exciting topic, and I hope more developers and admins begin to see Postgres as the global integration system it really is (more…)

PostgreSQL and IoT Data Localization, Integration, and Write Scalability

Haroon's PlanetPostgreSQL, Internet of Things
In my previous post we looked at various partitioning techniques in PostgreSQL for efficient IoT data management using IoT Solution. We do understand that the basic objective behind time based partitions is to achieve better performance, especially in IoT environments, where active data is usually the most recent data. New data is usually append only and it can grow pretty quickly depending on the frequency of the data points. Some might argue on why to have multiple write nodes (as would be inherently needed in a BDR cluster) when a single node can effectively handle incoming IoT data utilizing features such as time based partitioning. Gartner estimated 8.4 billion connected devices in 2017, and it expects that this number will grow to over 20 billion by 2020. The scale at which (more…)

Talk slides: Partitioning Improvements in PostgreSQL 11

Alvaro's PlanetPostgreSQL, PostgreSQL
I spent a couple of days in São Paulo, Brazil last week, for the top-notch PGConf.Brazil 2018 experience. This year I gave a talk about improvements in the declarative partitioning area in the upcoming PostgreSQL 11 release — a huge step forward from what PostgreSQL 10 offers. We have some new features, some DDL handling enhancements, and some performance improvements, all worth checking out. I'm told that the organization is going to publish video recordings at some point; for the time being, here's my talk slides. I'm very happy that they invited me to talk once again in Brazil. I had a great time there, even if they won't allow me to give my talk in Spanish! Like every time I go there, I regret it once it's time to come home, because it's so easy to feel at home with the (more…)

PostgreSQL Time-based Partitioning for IoT Data using pg_partman

Haroon's PlanetPostgreSQL, Internet of Things
This blog continues the discussion from my previous post on IoT Solution's scalability for IoT workloads where I discussed how declarative partitioning in PostgreSQL 10 can help achieve scalability. While native declarative partitioning is a good start, the experience of creating and maintaining the same partitions I did in my last post becomes much more fun with pg_partman. pg_partman is an extension to create and manage both time-based and serial-based table partition sets. Native partitioning in PostgreSQL 10 is supported as of pg_partman v3.0.1. It is important to note that all the features of trigger-based partitioning are not yet supported in native, but performance in both reads and writes is significantly better. Since Postgres-BDR runs as an extension on PostgreSQL, we can (more…)