Book Description:

PostgreSQL offers a comprehensive set of replication related features, which can be used to make your database servers more robust and way more scalable. Unleashing the power of PostgreSQL provides the user with countless opportunities and a competitive advantage over other database systems. To make things more powerful, PostgreSQL can be used in conjunction with a handful of sophisticated tools serving various different needs such as queuing, logical replication, or simplified transaction log handling.

“PostgreSQL Replication” is a practical, hands-on guide to PostgreSQL replication. It will provide you with the theoretical background as well as simple examples showing you how to make replication work on your system. A broad toolchain will be presented along with mature PostgreSQL-core technology.

“PostgreSQL Replication” starts with an introduction to replication concepts as well as the physical limitations of different replication solutions. You will be guided through various techniques such as Point-In-Time-Recovery, transaction-log-based replication and you will be introduced to a set of replication-related tools. In the final chapter you will learn to scale PostgreSQL to many different servers using PL/Proxy.

You will learn how to reset PostgreSQL to a certain point in time and figure out how to replicate data in many ways. You will deal with both synchronous as well as asynchronous replication. In addition to that, the book covers important topics, such as Slony, and upgrades with virtually no downtime. We will also cover important performance-related topics to make sure your database setups will provide you with high speed AND high availability.

“PostgreSQL Replication” contains all the information you need to design and operate replicated setups. You will learn everything you need to know for your daily work and a lot more.

What you will learn from this book

  • Recover a PostgreSQL database to a certain point in time
  • Set up asynchronous and synchronous streaming replication
  • Handle transaction log files efficiently
  • Learn about Linux High Availability
  • Get to grips with Slony replication
  • Get PL/Proxy to scale infinitely
  • Understand pgpool and pgbouncer to improve speed and reliability
  • Perform fast on-the-fly backups
  • Increase reliability and throughput
  • Improve data security and geographically distribute data

Approach

This book has a chapter dedicated to each aspect of replication. The new features of PostgreSQL 9 are introduced and there are lots of practical examples and screenshots.

Book Description:

Key Features Create a PostgreSQL cluster that stays online even when disaster strikes Avoid costly downtime and data loss that can ruin your business Updated to include the newest features introduced in PostgreSQL 9.6 with hands-on industry-driven recipes Book Description Databases are nothing without the data they store. In the event of a failure – catastrophic or otherwise – immediate recovery is essential. By carefully combining multiple servers, it’s even possible to hide the fact a failure occurred at all. From hardware selection to software stacks and horizontal scalability, this book will help you build a versatile PostgreSQL cluster that will survive crashes, resist data corruption, and grow smoothly with customer demand. It all begins with hardware selection for the skeleton of an efficient PostgreSQL database cluster. Then it’s on to preventing downtime as well as troubleshooting some real life problems that administrators commonly face. Next, we add database monitoring to the stack, using collectd, Nagios, and Graphite. And no stack is complete without replication using multiple internal and external tools, including the newly released pglogical extension. Pacemaker or Raft consensus tools are the final piece to grant the cluster the ability to heal itself. We even round off by tackling the complex problem of data scalability. This book exploits many new features introduced in PostgreSQL 9.6 to make the database more efficient and adaptive, and most importantly, keep it running. What you will learn Protect your data with PostgreSQL replication and management tools such as Slony, Bucardo, pglogical, and WAL-E Hardware planning to help your database run efficiently Prepare for catastrophes and prevent them before they happen Reduce database resource contention with connection pooling using pgpool and PgBouncer Automate monitoring and alerts to visualize cluster activity using Nagios and collected Construct

Develop programmatic functions to create powerful database applications

Book Description:

PostgreSQL is the most advanced open source database in the world. It is easy to install, configure, and maintain by following the documentation; however, it’s difficult to develop applications using programming languages and design databases accordingly. This book is what you need to get the most out of PostgreSQL

You will begin with advanced SQL topics such as views, materialized views, and cursors, and learn about performing data type conversions. You will then perform trigger operations and use trigger functions in PostgreSQL. Next we walk through data modeling, normalization concepts, and the effect of transactions and locking on the database.

The next half of the book covers the types of indexes, constrains, and the concepts of table partitioning, as well as the different mechanisms and approaches available to write efficient queries or code. Later, we explore PostgreSQL Extensions and Large Object Support in PostgreSQL. Finally, you will perform database operations in PostgreSQL using PHP and Java. By the end of this book, you will have mastered all the aspects of PostgreSQL development. You will be able to build efficient enterprise-grade applications with PostgreSQL by making use of these concepts

Who This Book Is For

If you are a PostgreSQL developer with a basic knowledge of PostgreSQL development and you’re want deeper knowledge to develop applications, then this book is for you. As this book does not cover basic installation and configurations, you should have PostgreSQL installed on your machine as a prerequisite.

What You Will Learn

  • Write more complex queries with advanced SQL queries
  • Design a database that works with the application exactly the way you want
  • Make the database work in extreme conditions by tuning, optimizing, partitioning, and indexing
  • Develop applications in other programming languages such as Java and PHP
  • Use extensions to get extra benefits in terms of functionality and performance
  • Build an application that does not get locked by data manipulation
  • Explore in-built db functions and data type conversions