https://github.com/sambit77/redis-caching-spring
Redis cache implementation in Spring boot application
https://github.com/sambit77/redis-caching-spring
java jedis mongodb redis-cache spring-boot
Last synced: 3 months ago
JSON representation
Redis cache implementation in Spring boot application
- Host: GitHub
- URL: https://github.com/sambit77/redis-caching-spring
- Owner: sambit77
- License: other
- Created: 2024-04-07T14:04:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-07T17:24:26.000Z (over 1 year ago)
- Last Synced: 2025-07-11T05:35:31.924Z (3 months ago)
- Topics: java, jedis, mongodb, redis-cache, spring-boot
- Language: Java
- Homepage:
- Size: 92.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Redis-Caching-Spring
## About Application: IF user makes back to back api call within 5 seconds for a particular user Id the response will not be queried from database rather from cache memory
### Step-1 Install and run Redis on your system (OSX)
- `brew install redis`
- `brew services start redis`### Step-2 Run the spring application
- `./gradlew build`
- `./gradlew bootrun`### Step-3 Save a user to Mongo db database
- `curl -X POST \
'http://localhost:8081/adduser' \
--header 'Accept: */*' \
--header 'User-Agent: Thunder Client (https://www.thunderclient.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "Sambit"
}'`- This will create and save user "Sambit" to the database and return the userid as response
### Step-4 Get the user details based on id
- `http://localhost:8081/getbyid/1` : It will return user details for user id 1
- Response for back to back api call (<5 seconds>) for same user id will be returned from cache memory.