Spring Boot Cache Implementation for Database Operations

Cache implementation was done using built-in cache function on spring boot framework.

First, you need to add the following maven dependency:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>

To enable caching, add @EnableCaching annotation on any configuration class, for example the main class (in this case the DemoApplication class).