Zero-Downtime Safe Updates
- Introduction
- The Update Sequence
- Automated Database Backups
- Executing an Update
- Update Safeguards Configuration
Introduction
Upgrading e-commerce software is historically stressful for engineering teams. Breaking database changes, stale asset caches, and dependency conflicts often result in unexpected downtime.
Reyhan Commerce permanently eliminates update anxiety through an automated, atomic update pipeline triggered via ./reyhan update.
The Update Sequence
Automated Database Backups
Before executing any database migration, Reyhan automatically takes a compressed snapshot of your PostgreSQL database using spatie/laravel-backup. If any schema migration fails, the update process safely halts with zero data loss.
Executing an Update
To update your store:
bash
./reyhan updateThe command performs the following sequence automatically:
- Runs
./reyhan doctorto verify environment stability. - Backs up the database.
- Updates
reyhan-commerce/corevia Composer. - Executes new database migrations.
- Upgrades administrative assets (
php artisan filament:upgrade). - Clears stale application, route, and Redis caches.
- Gracefully reloads worker processes.
Update Safeguards Configuration
You can customize the behavior of the update command in config/reyhan.php:
php
// config/reyhan.php
'updates' => [
'backup_database_before_update' => env('REYHAN_BACKUP_ON_UPDATE', true),
'run_migrations' => true,
'upgrade_filament_assets' => true,
'optimize_caches' => true,
'reload_octane' => true,
],