'php artisan down': 2 Tricks for Maintenance Mode #laravel

preview_player
Показать описание
Support the channel by checking out my products:

Other places to follow:
Рекомендации по теме
Комментарии
Автор

Nice trik! Maintenance Mode always required for:
1. Data Center to maintenance UPS, Power Plant, etc
2. Upgrade capacity
3. Migrate to NVME
4. Replace broken MB, RAM, etc

HomeEarth
Автор

Btw u need —force for migrate command cuz your app is in production mode ^^

Engazan
Автор

This is very nice to have, in any case. I wouldn't ever use the --refresh in production though, especially in big applications.

If you can't use a tool like Laravel Forge/Cloud, or Ploi; (for "zero downtime" and rollbacks) at least use Deployer - thank me later.

Xewl
Автор

You should not need to use maintenance mode for normal deployments. Pretty much any deployment tool will install your code in a new folder and then just switch a symlink to make that the current release.

Even with larger migrations between hosting providers it is pretty easy to avoid this type of downtime in most cases. In some cases it can be a bit more complex, for example if you have a huge database. Then you can do it with data replication for a while and then switch over. A good way to get around DNS delays is to setup the old site as a reverse proxy that sends the traffic to the new server for a few days.

I have used Laravel for 10 years and I have never use maintenance mode.

Pekzr
Автор

this is okay if u are manually deploying but if u want less down time and more automated approach a "blue/green" deployment with CI/CD Pipeline would be the choice. but hey thats nice vid.

wenhammond
Автор

Blue - green deployment need to be standard

djordje
Автор

Bad practice. Only not on the production server you can have fun like that "down time".

I won't tell you anything new that the author doesn't know, it's not my invention. Use Jenkins, or something similar. Or write a script yourself that places the new version in a new folder and after the deployment is complete, the "server" switches to the new folder. There won't be any "down time".

And unless the migrations involve any significant changes to the DB structure, you can always switch back to the previous folder/version, "calmly" fix it, and run a new deployment again, without any "down time".

Andris_Briedis
visit shbcf.ru