Spring Boot Profiles

Introduction

Regardless of what enterprise application you’re developing, it will have to adapt based on the environment it’s deployed on. . The behavior of the application should change based on the environment in which it is deployed like: Dev | Test | Stage | Prod | UAT / Pre-Prod. Further one of the 12 Factor principles says “Treat backing services like DB or messaging systems as attached resources, not an integral part of our application. So that it can be attached, detached, or changed without disrupting business logic.”

Each environment requires a setting that is specific to them. For example, in DEV, we don’t really need a licensed enterprise-grade database but for UAT, Pre- prod, or prod we definitely need something like Oracle/DB2, etc. The above problem can be solved in many ways without any framework. Here,Spring Boot takes care of boilerplate code and provides box capability.

Let’s try to solve a simple problem: We want our application to run on a different port in a different environment.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy