Skip to content

Commit

Permalink
Release for PostgresOpen 2019.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsteele committed Sep 13, 2019
0 parents commit 99c5e68
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
.vagrant
/slides/tmp
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Title: Evolving towards PostgreSQL

Abstract:

pgBackRest is one of many tools in the PostgreSQL ecosystem. These mutualistic projects provide numerous benefits but integrating with PostgreSQL and interfacing with the community can be challenging.

In this talk we'll discuss what is involved in maintaining a project in cooperation with PostgreSQL, what that means for each, and how we can make both better in the process.

Bio:

David Steele is Principal Architect at Crunchy Data, the Trusted Open Source Enterprise PostgreSQL Leader. He has been actively developing with PostgreSQL since 1999.

David loves taking on big data challenges. Before taking a position with Crunchy Data he was Data Architect at Resonate, an online media company using PostgreSQL to drive its transactional and data warehousing databases. Before that, he helped drive global mobile text messaging at Sybase365.

David's current project is pgBackRest, which provides the inspiration for this talk.
25 changes: 25 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-16.04"

config.vm.provider :virtualbox do |vb|
vb.name = "hp-pgbackrest-ubuntu-16.04"
end

# Provision the VM
config.vm.provision "shell", inline: <<-SHELL
# Update apt repository
sudo apt-get update
# Install texlive and beamer for building slides
apt-get install -y texlive texlive-latex-extra
SHELL

# Don't share the default vagrant folder
config.vm.synced_folder ".", "/vagrant", disabled: true

# Mount slides path for building slides
config.vm.synced_folder ".", "/talk"

# Mount Crunchy slide template
config.vm.synced_folder "../template", "/template"
end
Binary file added slides/slides-present.pdf
Binary file not shown.
Binary file added slides/slides.pdf
Binary file not shown.
219 changes: 219 additions & 0 deletions slides/slides.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
% ----------------------------------------------------------------------------------------------------------------------------------
% Evolving towards Postgres
%
% Build from the Vagrant VM:
% cd /talk/slides && make -f /template/Makefile
% ----------------------------------------------------------------------------------------------------------------------------------
\def\mytitle{Evolving towards Postgres}
\def\mysubject{}
\def\myevent{PostgresOpen}
\def\myauthor{David Steele}
\def\myemail{}
\def\mydate{September 13, 2019}

% Suppres navigation bars
\def\mysuppressnav{}

% Include Crunchy template
\def\mytemplatepath{/template/}
\input{\mytemplatepath crunchy-template.tex}

% Agenda
\begin{frame}
\frametitle{Agenda}
\tableofcontents
\end{frame}

\section{Introduction}

\begin{frame}
\frametitle{About the Speaker}

\begin{itemize}
\item Principal Architect at Crunchy Data, the Trusted Open Source Enterprise PostgreSQL Leader.
\item Actively developing with PostgreSQL since 1999.
\item Primary author of pgBackRest and co-author of pgAudit.
\item PostgreSQL Contributor.
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{What is pgBackRest?}

pgBackRest aims to be a simple, reliable backup and restore system that can seamlessly scale up to the largest databases and workloads.\vspace{1em}
\end{frame}

\section{What is the PostgreSQL Ecosystem?}

\begin{frame}
\frametitle{What is the PostgreSQL Ecosystem?}

The PostgreSQL ecosystem describes the software products and services that use or work with PostgreSQL.\pause \\
\vspace{1em}
Some examples:
\vspace{1em}
\begin{itemize}
\item pgAdmin - Graphical administration\pause
\item PostGIS - GIS functions\pause
\item check\_postgres - Monitoring plugin for Nagios\pause
\item pg\_partman - Automated partitioning\pause
\item PgBouncer - Connection pooler\pause
\item pgBackRest - Backup \& restore\pause
\end{itemize}
\vspace{1em}
And many, many more.
\end{frame}

\begin{frame}
\frametitle{Why aren't they built into PostgreSQL?}

There are many possible approaches to a single problem, so the general idea is to have multiple solutions, each tailored to a specific approach. \\
\vspace{1em}
This is predicted by Conway's Law, i.e. the community is free to pursue their own ideas, therefore there will be mutliple solutions. \\
\vspace{1em}
Over time the best ideas can be integrated into PostgreSQL core, though this process is slow and uncertain.

% The messaging could stand to be tweaked, but that’s what you get with this governance structure, which for the most part works very well. - Peter G.
%
% Conway's Law -- i.e., the community is free to pursue their own idea, therefore the solution will be multi-part. (https://en.wikipedia.org/wiki/Conway%27s_law)
%
% Evidence in support of Conway's law has been published by a team of Massachusetts Institute of Technology (MIT) and Harvard Business School researchers who, using "the mirroring hypothesis" as an equivalent term for Conway's law, found "strong evidence to support [the] mirroring hypothesis", and that "significant differences in [product] modularity" were "consistent with a view that distributed teams tend to develop more modular products".
\end{frame}

\section{Ignoring PostgreSQL}

\begin{frame}
\frametitle{Ignoring PostgreSQL}

It is possible to develop software in the PostgreSQL ecosystem without ever interacting with the PostgreSQL community. \\
\vspace{1em}
The pgBackRest project did this for several years. \\
\vspace{1em}
For many projects this model may work for a long time or indefinitely.
\end{frame}

\section{Contributing to PostgreSQL}

\begin{frame}
\frametitle{Contributing to PostgreSQL}

So why did we start contributing to PostgreSQL?
\end{frame}

\begin{frame}
\frametitle{Reviewing Useful Features}

\texttt{- Implement backup API functions for non-exclusive backups} \\
\texttt{Magnus Hagander, PostgreSQL 9.6} \\
\vspace{1em}
This patch allowed any external tool to run a non-exclusive backup, which had previously only been possible for the internal \texttt{pg\_basebackup} tool. \\
\vspace{1em}
A non-exclusive backup does not write \texttt{backup\_label} into \texttt{\$PGDATA} and does not interfere with other backups in progress.
\end{frame}

\begin{frame}
\frametitle{Getting Feedback on pgBackRest Features}

\texttt{- Exclude additional directories in pg\_basebackup} \\
\texttt{- Exclude pg\_internal.init from BASE\_BACKUP} \\
\texttt{- Exclude unlogged tables from base backups} \\
\texttt{- Exclude temp tables from base backups} \\
\texttt{David Steele, PostgreSQL 10-11} \\
\vspace{1em}
These exclusions were all researched and developed for pgBackRest originally. By contributing them to \texttt{pg\_basebackup} we were able to get a lot of review of the changes.
\end{frame}

\begin{frame}
\frametitle{Adding a New Feature}

\texttt{- Allow group access on PGDATA} \\
\texttt{David Steele, PostgreSQL 11} \\
\vspace{1em}
Allows \texttt{\$PGDATA} to have group read permissions so backup can be performed by an unprivileged user. This was not workable without changes to core. \\
\vspace{1em}
This commit depended on: \\
\vspace{1em}
\texttt{- Refactor dir/file permissions} \\
\texttt{David Steele and Adam Brightwell, PostgreSQL 11} \\
\vspace{1em}
\texttt{- Refactor new file permission handling} \\
\texttt{David Steele, PostgreSQL 11} \\
\end{frame}

\section{Choosing a Language}

\begin{frame}
\frametitle{Choosing a Language}

pgBackRest was originally written in Perl but we are migrating to C. Why?\pause \\
\vspace{1em}
\begin{itemize}
\item Speed (mostly startup speed)\pause
\item Simplified deployment\pause
\item Ability to use code and data structures from PostgreSQL\pause

\begin{itemize}
\item Page Checkums\pause
\item pg\_control structures\pause
\item WAL structures\pause
\item Portability
\end{itemize}
\end{itemize}
\end{frame}

\section{Challenges}

\begin{frame}
\frametitle{Challenge - Removing Exclusive Backup}

There are a number of reasons why using exclusive backup is not a good idea, but there is a lot of resistance to removing it. A better alternative (non-exclusive mode) has been available since 9.6.\pause \\
\vspace{1em}
Opinions on the patch fell primarily into three (nearly equal) groups:\pause
\begin{itemize}
\item No -- it would break too many existing scripts.\pause
\item Yes -- but not now.\pause
\item Yes -- we should do this now because a better method has been available for some time.
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Challenge - Improving Backup Documentation}

In many cases the PostgreSQL backup/archiving documentation is over-simplistic or simply gives bad advice, i.e. using \texttt{cp} for archiving or using exclusive mode backup. \\
\vspace{1em}
Updating this documentation with better instructions and discouraging users from using the deprecated exclusive mode backup has been a multi-year process. \\
\vspace{1em}
\texttt{- Improve low-level backup documentation.} \\
\texttt{David Steele, PostgreSQL 11} \\
\vspace{1em}
\texttt{- Warn more strongly about the dangers of exclusive backup mode.} \\
\texttt{David Steele and Robert Haas, PostgreSQL 12}
\end{frame}

\section{Conclusion}

\begin{frame}
\frametitle{Conclusion}

Is it worth it? \pause \\
\vspace{1em}
Yes. Working with the community can be challenging but there are many benefits to both projects.
\end{frame}

\section{Questions?}

\begin{frame}
\frametitle{Questions?}

website: \url{http://www.pgbackrest.org}\\
\vspace{1em}
email: \href{mailto:[email protected]}{[email protected]} \\
email: \href{mailto:[email protected]}{[email protected]}\\
\vspace{1em}
releases: \url{https://github.com/pgbackrest/pgbackrest/releases}\\
\vspace{1em}
slides: \url{https://github.com/dwsteele/conference/releases}\\
\end{frame}

% End document
\end{document}

0 comments on commit 99c5e68

Please sign in to comment.