Lwin Maung Maung

My Notes and Blogs

Home Laravel Linux
<-

Laravel Pennant and Blue-Green Development

Published on  Aug 4th, 2023Updated:  Jun 19th, 2024
2 mins Read

Blue-Green Development is an application release model to avoid bugs and seamless migration. Laravel Pennant is one of the features for Laravel applications to test features on specific persons. When Laravel Pennant is released, it acts as A-B testing among developers. This post mainly focuses on how we use Laravel Pennant on Blue-Green Development.

What is Blue-Green Development?

Blue-Green Development is an application release model. When a new feature is released, a specific ratio of servers with new features is updated, and load balancers or the application itself randomly select the application user to the latest server.

If there have critical bugs in the new update, the application can immediately roll back to the latest working version. If it needs more fixes, we fix it to avoid the whole system blocks or stalls.

Laravel Pennant

Laravel Pennant is a simple and lightweight feature flag package. It will select random users, or 1/100, even 1/1000 use new feature releases. It can get specific persons to use new features if they are willing to join the public beta, according to the Laravel documentation.

With Laravel Pennant, you can define your feature as a PHP class and select random users to force some users to use new feature updates. We can apply it in middleware, Blade and trait, etc.

When Laravel Pennant comes out, I don't even know how to use it properly. I now get the full image of how to use Laravel Pennant for Blue-Green Development. You can also use it for A/B testing, but I am not a big fan of it.

© lwinmaungmaung MMXXIII. All Rights Reserved.