Skip to content

This project is a demonstration of a CRUD (Create, Read, Update, Delete) application built using Spring Boot, Redis, and PostgreSQL. The application is designed to manage customer data efficiently, leveraging the high-speed caching capabilities of Redis and the robust data management features of PostgreSQL.

Notifications You must be signed in to change notification settings

Mochrks/api-springboot-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot CRUD API - Redis & PostgreSQL Integration

Spring Boot Version Redis Integration PostgreSQL Integration

Tech Stack Icons

Overview

This is a CRUD API built with Spring Boot that integrates Redis for caching and PostgreSQL as the primary database. The API allows creating, reading, updating, and deleting records with caching enabled to enhance performance. Redis is used to cache frequently accessed data, reducing load on the PostgreSQL database.

Features

  • CRUD Operations with Redis caching for enhanced performance
  • Integration with PostgreSQL for persistent storage
  • Spring Data JPA for database operations
  • Spring Cache abstraction for Redis integration
  • RESTful API design with clean architecture
  • Input validation and error handling
  • Swagger UI for API documentation and testing

Tech Stack

  • Spring Boot 2.5.4
  • Redis for caching
  • PostgreSQL as the primary database
  • Spring Data JPA for database interaction
  • Lombok for reducing boilerplate code
  • Swagger for API documentation

Project Structure

api-springboot-redis/
│
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── com/example/redis/  # Source code and main application
│   ├── resources/
│   │   ├── application.properties  # Configuration for PostgreSQL, Redis
│   └── test/
│       └── java/                   # Unit tests for services and controllers
└── pom.xml                         # Project dependencies

Setup & Installation


  • Clone the repository

    git clone https://github.com/mochrks/api-springboot-redis.git
    cd api-springboot-redis
  • Install dependencies

    mvn clean install
  • Set up PostgreSQL and Redis

    • Ensure PostgreSQL and Redis are running locally or provide your connection strings in application.properties.

    • For PostgreSQL, update the following properties in src/main/resources/application.properties:

      spring.datasource.url=jdbc:postgresql://localhost:5432/yourdbname
      spring.datasource.username=yourusername
      spring.datasource.password=yourpassword
    • For Redis, update the following properties:

      spring.redis.host=localhost
      spring.redis.port=6379
  • Run the application

    mvn spring-boot:run

Connect with me:

GitHub YouTube Instagram LinkedIn Behance Dribbble

About

This project is a demonstration of a CRUD (Create, Read, Update, Delete) application built using Spring Boot, Redis, and PostgreSQL. The application is designed to manage customer data efficiently, leveraging the high-speed caching capabilities of Redis and the robust data management features of PostgreSQL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages