Skip to content

rajadilipkolli/my-spring-boot-experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open in Gitpod

License: MIT

Spring Boot Integration Experiments

This repository contains a collection of sample projects and experiments showcasing various Spring Boot integrations and features. The goal is to help you explore new possibilities, demonstrate best practices, and provide ready-to-use examples.


Table of Contents


Overview

Each subdirectory in this repository demonstrates a focused aspect of Spring Boot development ranging from database integrations, caching, messaging, and multi-tenancy to advanced topics like Chaos Engineering and observability.

Key Features:

  1. Wide Range of Integrations: Explore different databases (MySQL, PostgreSQL, MongoDB, Oracle), caching with Redis, and advanced topics like multi-tenancy.
  2. Observability & Monitoring: Many samples include Prometheus, Grafana, or Kibana. They demonstrate setting up and analyzing application performance in real-time.
  3. Scalability & Resilience Patterns: Investigate Chaos Monkey for injecting controlled failures, or look at multi-database solutions for horizontal scaling.

Projects

Below is a quick lookup table summarizing each sub-project. For more details, check their individual README.md files.

Name Description
Spring Batch Implementation Demonstrates how to use Spring Batch 5 with a straightforward configuration.
Archunit Implementation Shows how to enforce architectural constraints in a Spring Boot project using ArchUnit.
Chaos Engineering Principles Covers applying Chaos Engineering with Spring Boot, along with performance tests.
Grafana LGTM Demonstrates an observability stack with Loki, Grafana, Tempo, and Mimir.
Mongodb and Elasticsearch Reactive integration Illustrates storing data in MongoDB, then retrieving it using reactive Elasticsearch.
Opensearch Integration Showcases saving data and performing swift geospatial searches in OpenSearch.
Rabbit Mq Implementation Demonstrates RabbitMQ producer acknowledgments, a Dead Letter Queue setup, and more.
Rest API Documentation with examples Highlights generating PDF documentation of RESTful APIs using Spring REST Docs.
Implementation of Strategy Design Pattern Uses the Strategy Pattern within a Spring application, builds a native image.
Feature Toggles Demonstrates toggling specific features on or off at runtime in a Spring Boot application.
Ultimate Redis Implementation Explores multiple Redis usage patterns with varying time-to-live (TTL) settings.
Graph QL implementation using QueryDSL Illustrates integrating GraphQL with QueryDSL to interact with a database.
Graph QL implementation using webflux Showcases using GraphQL alongside the reactive WebFlux stack for asynchronous processing.
Graph QL implementation using webmvc Demonstrates applying GraphQL concepts with the traditional Spring MVC for synchronous processing.
Custom SequenceNumber and LazyConnectionDataSourceProxy for db connection improvement Highlights creating custom sequence generators and optimizing database connections.
Hibernate Envers Implementation using spring data JPA Shows how to track entity revisions with Hibernate Envers and monitor system changes.
Connecting to multiple data sources Demonstrates configuring multiple SQL databases in a single Spring Boot application.
Hibernate 2nd Level Cache Using Redis Explains configuring Hibernate’s second-level caching via Redis and testing it.
Read Replica Postgres with connection optimization Illustrates writing data to a primary Postgres database, then reading from a replica.
KeySet pagination and dynamic search with Blaze Implements keyset pagination using Blaze Persistence, adding dynamic query features.
KeySet pagination and dynamic search with spring data jpa Implements keyset pagination using Spring Data JPA, enabling dynamic queries.
MultiTenancy with multipledatsources Provides examples of running multi-tenant applications under different strategies.
MultiTenancy DB Based Demonstrates having each tenant use a separate database (while sharing the same codebase).
MultiTenancy Partition Based Shows how to share a single database and table across tenants using a partitioning strategy.
MultiTenancy Schema Based Demonstrates isolating tenants by allocating a separate schema for each tenant.
Reactive SQL With JOOQ Explains performing reactive CRUD operations in Spring Boot using jOOQ.
PostgreSQL JSON and ENUM column support using reactive Demonstrates PostgreSQL JSON and ENUM column support in a reactive application.
Reactive Cache with Redis Demonstrates caching reactive database operations in Redis to boost performance.
Reactive Application Illustrates an end-to-end reactive CRUD workflow in Spring Boot using R2DBC.
BackgroundJobs and Scheduling using Jobrunr Sets up background job scheduling with Jobrunr.
Scheduling using Quartz Showcases the Quartz Scheduler, providing job scheduling capabilities.
Scheduling using Database Distributed Locks with ShedLock Demonstrates scheduling while ensuring only one active job running at a time using ShedLock.

For more info about this repository, please visit here.


Tech Stack

This repository leverages a broad stack of technologies, including:

  • Java / JavaScript / SQL for core logic & data.
  • Spring Framework (Boot, Data, Security, etc.) as the key application framework.
  • Project Reactor for reactive data flows and concurrency.
  • QueryDSL, Liquibase, Flyway, JOOQ for advanced database interactions and migrations.
  • Docker, Docker Compose for containerization and multi-service orchestration.
  • RabbitMQ, Redis, Elasticsearch, OpenSearch, MongoDB for messaging, caching, and search.
  • Gradle / Maven for builds and dependency management.
  • GitHub Actions, CircleCI, Jenkins for CI/CD pipelines.

For in-depth version references, visit techstack.md or see individual project READMEs.


Useful Docker Commands

Start Postgres and pgAdmin

docker compose up postgres pgadmin4

Clean up everything using

docker system prune -a -f --volumes

Claim unused volumes

docker volume prune

Running container

docker container ls

Useful git Commands

How to overwrite local changes with git pull

Stash local changes:

git stash

Pull changes from remote:

git pull

How to revert the changes that are pushed to remove

git revert $hash