Member-only story
Redis Setup on Spring Boot Made Easy
INTRODUCTION
Redis (Remote Dictionary Server) is a key-value database that functions as an in-memory data store with high performance. Redis is often used for caching, messaging (publish/subscribe), session storage, and managing data that requires fast access. It also supports various types of data structures such as strings, lists, sets, hashes, and sorted sets.
PREREQUESITE
- JDK 1.8
- IDE : Visual Studio Code
- Docker installed on your machine
- Basic Java & REST API knowladge
PULL REDIS DOCKER IMAGE
Pull the Redis Docker image and then run it, which we will use as the Redis server.
docker pull redis
docker run --name redis-server -p 6379:6379 -d redis
CREATE SPRING BOOT PROJECT
You can create a Spring Boot project through the Spring Initializr website. If you’re using VS Code, you can start by pressing CTRL+SHIFT+P
, then select Spring Initializr : Create Maven Project.
DEPENDENCIES
Add the following dependencies to your pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>…