Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Vaardigheden in dit hoofdstuk
- Databases, caches en queues — 8
PostgreSQL — the default open-source database
psql (with pg_dump / pg_restore) runs SQL, manages roles and makes backups.
psql "host=db1 dbname=shop user=shop sslmode=verify-full"
pg_dump -Fc -d shop -f shop-$(date +%F).dump
pg_restore -d shop --clean --if-exists shop-2026-10-27.dumpSecurity checklist:
- One role per app;
scram-sha-256andhostssllines inpg_hba.conf. - Test restores. On Kubernetes use an operator (CloudNativePG).
MySQL / MariaDB — the web app database
mysql and mysqldump serve WordPress, WooCommerce and many PHP apps.
Redis / Valkey — cache and sessions
redis-cli talks to the in-memory key-value store used for caches, sessions, queues and rate limits.
MongoDB — document database
mongosh queries JSON documents; mongodump / mongorestore back up.
etcd — the brain of Kubernetes
etcdctl checks health and makes snapshots of the store that holds every Kubernetes object; restore with etcdutl. A CKA task.
RabbitMQ — message broker
rabbitmqctl manages users, vhosts, permissions and queues of the AMQP broker that decouples services.
rabbitmqctl list_queues -p shop name messages consumers
rabbitmqctl delete_user guest
rabbitmq-diagnostics check_runningKafka — event streaming
kafka-topics and friends create topics, read and write events and show consumer lag.
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic shop.orders
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group invoice-serviceSecurity checklist:
- TLS + SASL + ACLs; alert on consumer lag.
MinIO — S3 object storage
mc works with MinIO and any S3-compatible storage: buckets, mirrors, lifecycle, users and policies.
Follow the 3-2-1 backup rule
For every data service: 3 copies, on 2 kinds of storage, 1 off-site (and one offline or immutable). Then test the restore every month and write down how long it took.
| Service | Backup tool | Restore test |
|---|---|---|
| PostgreSQL | pg_dump / WAL archiving | pg_restore into a test DB |
| MySQL | mysqldump --single-transaction | import into a test DB |
| MongoDB | mongodump | mongorestore into a test DB |
| etcd | etcdctl snapshot save | etcdutl snapshot restore on a lab cluster |
| Files | tar + age + mc mirror | restore one folder |