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.
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:
- Wide Range of Integrations: Explore different databases (MySQL, PostgreSQL, MongoDB, Oracle), caching with Redis, and advanced topics like multi-tenancy.
- Observability & Monitoring: Many samples include Prometheus, Grafana, or Kibana. They demonstrate setting up and analyzing application performance in real-time.
- Scalability & Resilience Patterns: Investigate Chaos Monkey for injecting controlled failures, or look at multi-database solutions for horizontal scaling.
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. |
| HTTP Proxy Implementation | Implements HTTP proxy functionality for routing and managing HTTP requests. |
| JMH Benchmark | Provides microbenchmarking capabilities using JMH for measuring code performance. |
| Mongodb and Elasticsearch Reactive integration | Illustrates storing data in MongoDB, then retrieving it using reactive Elasticsearch. |
| OpenAPI Implementation | Demonstrates OpenAPI specification generation and documentation using Swagger. |
| 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. |
| RestClient Implementation | Introduces Spring 6's RestClient as a modern alternative to WebClient/RestTemplate. |
| RestTemplate Implementation | Shows how to use Spring's RestTemplate for making HTTP requests to RESTful services. |
| 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. |
| WebClient MVC Implementation | Demonstrates using WebClient with Spring MVC for HTTP operations. |
| WebClient WebFlux Implementation | Shows WebClient usage with WebFlux for reactive HTTP operations. |
| 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 | 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. |
| JNDI Sample | Demonstrates JNDI usage with embedded Tomcat and Hikari DataSource. |
| JPA with JOOQ | Shows how to use both JPA and JOOQ in the same application for database operations. |
| JPA Locks | Demonstrates database locking mechanisms and transaction isolation levels. |
| 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. |
| PostgreSQL Notify/Listen | Shows how to implement PostgreSQL's NOTIFY/LISTEN feature using R2DBC. |
| 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. |
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.
Start Postgres and pgAdmin
docker compose up postgres pgadmin4Clean up everything using
docker system prune -a -f --volumesClaim unused volumes
docker volume pruneRunning container
docker container lsHow to overwrite local changes with git pull
Stash local changes:
git stashPull changes from remote:
git pullHow to revert the changes that are pushed to remove
git revert $hash