PostgreSQLMySQLRedis
Databases and data
Run Postgres, MySQL and Redis safely: users, backups, restores and upgrades.
- 8 lessons
- 3h 10m estimated time
- 2 hands-on labs
- 2 animated diagrams
- 8 quizzes
3 beginner, 5 intermediate. Start at the top or pick a chapter below.
0 of 8 done
Saved in this browser as you finish lessons.
Postgres first steps
Install it, create roles and read a connection string.
01 Up next Install Postgres and connect with psql on Ubuntu or Docker Install Postgres either by running the official Docker image with a named volume or with apt, then open a psql session to list, create and enter databases. 20 min Beginner Lab 02 Up next Postgres roles and permissions for an app user and a read-only user A Postgres role is a login or a group that owns objects and holds privileges, so you create a limited role per app with GRANT instead of letting the app use the superuser. 25 min Intermediate Lab Diagram 03 Up next Database connection strings explained for Postgres, MySQL and Redis A connection string is a single URL that packs the scheme, user, password, host, port, database name and options an app needs to reach a database. 15 min Beginner
Keep data safe
Backups you have restored, and upgrades you can survive.
04 Up next Postgres backup and restore with pg_dump and pg_restore pg_dump writes a consistent copy of one database to a file, and pg_restore or psql loads that file into a database, so you can back up, move or rebuild Postgres data. 25 min Intermediate 05 Up next Upgrade Postgres to a new major version safely A major Postgres upgrade changes the on-disk data format, so you move data with dump and restore or pg_upgrade instead of just installing or starting a newer version. 30 min Intermediate
Other stores and scale
MySQL, Redis and connection limits.
06 Up next MySQL and MariaDB basics on Ubuntu: install, users, backups MySQL and MariaDB are related open source relational databases that you install with apt or Docker, secure, then use through a limited user, mysqldump backups and a localhost-only bind address. 25 min Beginner 07 Up next Redis basics, persistence and security on a server Redis is an in-memory key-value store that keeps data in RAM and saves it to disk with RDB snapshots, an append-only file or both, and it must be bound to localhost and password protected. 25 min Intermediate Diagram 08 Up next Database connection pooling and max connections for Postgres and MySQL Every database connection uses server resources, so you cap them with max_connections, size each app's pool so the total fits under it, and add a pooler such as PgBouncer when many clients share few queries. 25 min Intermediate