Bean scopes define the lifecycle and visibility of beans.
Spring Boot bean scopes, such as Singleton and Prototype, determine the lifecycle and instantiation strategy of beans. Singleton scope means a single instance is shared across the container, suitable for stateless services. Prototype scope creates a new instance each time a bean is requested, which is useful for stateful components like session data. For instance, in a shopping cart application, a cart bean might be Prototype-scoped to handle individual user sessions.
Additional Notes
Why does bean scopes on Spring Boot application design matter in practice?