https://github.com/bygui86/spring-redis
Spring Boot Redis sample project
https://github.com/bygui86/spring-redis
lombok-maven mavenw messaging redis-cache redis-database redis-db spring-boot-2 spring-boot-2-1 spring-data spring-data-redis spring-redis
Last synced: about 1 month ago
JSON representation
Spring Boot Redis sample project
- Host: GitHub
- URL: https://github.com/bygui86/spring-redis
- Owner: bygui86
- License: apache-2.0
- Created: 2019-02-03T16:58:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-25T19:11:45.000Z (about 6 years ago)
- Last Synced: 2025-04-09T11:11:08.259Z (2 months ago)
- Topics: lombok-maven, mavenw, messaging, redis-cache, redis-database, redis-db, spring-boot-2, spring-boot-2-1, spring-data, spring-data-redis, spring-redis
- Language: Java
- Size: 65.4 KB
- Stars: 2
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring Boot Redis sample project
## Sub-projects
Spring Boot Redis sample projects:
* Redis as DB - Spring Data Redis
* Redis for caching - Spring Caching
* Messaging with Redis - Spring Data Redis---
## Prerequisites
* docker
* curl / httpie / postman---
## Run sample
Start Redis
```
docker run -d --rm --name redis -p 6379:6379 redis:alpine redis-server --appendonly yes
```Start application
```
cd /
mvnw clean package spring-boot:run
```Now you can call the exposed endpoints.
`PLEASE NOTE: A bench of sample data are loading automatically in the DB.`
---
## Exposed endpoints
* Redis as DB
* GET /posts --> Get all posts
* GET /posts/{id} --> Get post by id
* POST /posts --> Insert new post
* PUT /posts --> Update existing post
* DELETE /posts --> Delete all posts
* DELETE /posts/{id} --> Delete post by id* Redis for caching
* GET /posts --> Get all posts
* GET /posts/{id} --> Get post by id
* POST /posts --> Insert new post
* PUT /posts --> Update existing post
* DELETE /posts --> Delete all posts
* DELETE /posts/{id} --> Delete post by id
* GET /cache --> Get all cache keys
* GET /cache/{key} --> Get cache by key
* DELETE /cache --> Evict whole cache
* DELETE /cache/{key} --> Evict cache by key`PLEASE NOTE: URL root http://localhost:8080`
`PLEASE NOTE: Messaging with Redis does not expose any endpoint, it's a simple batch application`---
## Links
### Redis as DB
* https://www.baeldung.com/spring-data-redis-tutorial
### Redis for caching
* https://medium.com/@MatthewFTech/spring-boot-cache-with-redis-56026f7da83a
* https://www.baeldung.com/spring-boot-evict-cache
* https://www.baeldung.com/spring-cache-tutorial### Messaging with Redis
* https://spring.io/guides/gs/messaging-redis/
* https://dzone.com/articles/intro-to-redis-with-spring-boot
* https://www.baeldung.com/spring-data-redis-pub-sub### Redis
* https://blog.serverdensity.com/monitor-redis/
* https://dzone.com/articles/6-crucial-redis-monitoring-metrics-you-need-to-wat### Others
* https://docs.spring.io/spring-boot/docs/current/reference/html/howto-database-initialization.html
* https://www.baeldung.com/spring-boot-data-sql-and-schema-sql