Databases and Key-Value Stores

Databases such as PostgreSQL, MySQL, MariaDB, document databases like MongoDB, and key-value stores like Redis need special attention since they store sessions and private data. We need to think in detail about how to keep the databases up-to-date, restrict access to data, create, store, and restore backups, deal with upgrades, and scale.This chapter tries to provide some of the answers for self-hosting the PostgreSQL database and Redis store as examples of popular choices in typical Ruby and Python web applications. We’ll discuss clusters, databases, roles, and data backups.

Table of Contents

Running PostgreSQL

Installation
System Service
Databases
Client Authentication
Secure Connection
Database Roles
Backups
SQL Dumps
Upgrades

Running Redis

Installation
System Service
Databases
Connections
Security
Protecting Redis With a Password
Protected Mode
Renaming and Disabling Commands
Permissions
Backups
Restoring Backups
Performance

Summary

Buy for $50
Rated 36x five stars
Gumroad (as of Aug 3, 2023)
I am using some scripts I downloaded from Josef Strzibny's book that are setting up Ruby on Rails deployment and automatically installing a PostgreSQL server. I am also using Dokku, but I like the idea of controlling what is happening on the server.
Lucian Ghinda, Senior Ruby Developer