New installation & secure baseline
Steps skipped while preparing a newly installed database for production lead to the most expensive failures. Choose the stage you are at and get an ordered checklist for initial configuration, security hardening, durability and monitoring.
Which stage are you at?
Preparing a new installation for production has four stages: initial configuration, security hardening, durability (backup/replication) and monitoring. Which one are you working on now? Going through all of them in order is recommended.
SELECT banner_full FROM v$version; SHOW PARAMETER compatible;- Initial configuration after installation
- Security hardening
- Backup & durability setup
- Monitoring & alerting setup
What is the priority in initial configuration?
Initial configuration splits into two main topics: resource/parameter sizing (memory, connections) and permanent foundations (character set/collation, data directory/file layout). These are the hardest decisions to change later.
SELECT name, setting, unit FROM pg_settings WHERE name IN ('shared_buffers','work_mem','max_connections','wal_level');- Memory / parameter sizing
- Character set, collation and file layout
Which part of durability are you setting up?
Durability stands on two legs: a verified backup strategy (first backup + restore test) and continuity (archive/log mode, replication). Saying 'I have a backup' without testing it is the most common misconception.
SHOW archive_mode; SHOW wal_level;- Backup strategy + first backup + restore test
- Archive/log mode + replication
Initial configuration: Memory and parameter sizing
Defaults are conservative for most engines; size them to the server's RAM and CPU, but avoid over-commit.
Initial configuration: Character set, collation and file layout
Character set/collation and data directory layout are set at installation time; changing them later usually requires a reinstall or migration.
Security hardening
A new installation comes with default accounts, loose network access and open ports. Reducing the attack surface before going to production is mandatory.
Durability: Backup strategy and restore test
A backup is only as good as its ability to be restored. Take the first backup, set up continuity and always perform a restore test.
Durability: Archive/log mode and replication
For point-in-time recovery and high availability, archive/log mode must be enabled and there must be at least one replica.
Monitoring & alerting setup
The last step before production: seeing problems before users do. Set up health checks and alerts with the right thresholds.