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 learn advanced concepts in a unified space.
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 reactive stacks. Many of these samples are production ready, while some are still works-in-progress (WIP) intended for demonstration or experimentation.
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 | Status |
---|---|---|
Spring Batch Implementation | Demonstrates how to use Spring Batch 5 with a straightforward configuration, generate batch tables via Liquibase, and produce an SBOM (Software Bill of Materials). | Completed |
Archunit Implementation | Shows how to enforce architectural constraints in a Spring Boot project using ArchUnit rules. | Completed |
Chaos Engineering Principles | Covers applying Chaos Engineering with Spring Boot, along with performance testing via Gatling to highlight the impact of chaos experiments. | WIP |
Grafana LGTM | Demonstrates an observability stack with Loki, Grafana, Tempo, and Mimir to handle metrics, traces, and logs in a Spring Boot context. | Completed |
Mongodb and Elasticsearch Reactive integration | Illustrates storing data in MongoDB, then retrieving it using reactive ElasticSearch for quick, geospatial, and reactive-based searches. | WIP |
Opensearch Integration | Showcases saving data and performing swift geospatial searches in OpenSearch as an ElasticSearch alternative. | Completed |
Rabbit Mq Implementation | Demonstrates RabbitMQ producer acknowledgments, a Dead Letter Queue setup, and a Thymeleaf-powered UI. | Completed |
Rest API Documentation with examples | Highlights generating PDF documentation of RESTful APIs using Spring REST Docs. | Completed |
Implementation of Strategy Design Pattern | Uses the Strategy Pattern within a Spring application, builds a native image with GraalVM, and provides a main class to launch the application natively. | Completed |
Feature Toggles | Demonstrates toggling specific features on or off at runtime in a Spring Boot project. | Completed |
Ultimate Redis Implementation | Explores multiple Redis usage patterns with varying time-to-live (TTL) settings, including querying data via Spring Data Redis, connecting to Redis-cluster. | Completed |
Graph QL implementation using QueryDSL | Illustrates integrating GraphQL with QueryDSL to interact with a database in a Spring application. | WIP |
Graph QL implementation using webflux | Showcases using GraphQL alongside the reactive WebFlux stack for asynchronous data retrieval. | Completed |
Graph QL implementation using webmvc | Demonstrates applying GraphQL concepts with the traditional Spring MVC for synchronous data handling. | WIP |
Custom SequenceNumber and LazyConnectionDataSourceProxy for db connection improvement | 1. Highlights creating custom sequence generators 2. Optimizing database connections with LazyConnectionDataSourceProxy 3. Observing SQL statements via datasource-proxy , and validating queries in integration tests using SQLStatementCountValidator 4. Dynamic input validation using ValidationGroups |
Completed |
Hibernate Envers Implementation using spring data JPA | Shows how to track entity revisions with Hibernate Envers and monitor system health, triggering alerts on high CPU usage or downtime. | Completed |
Connecting to multiple data sources | Demonstrates configuring multiple SQL databases in a single Spring Boot application, handling connection pools, and running both Liquibase and Flyway migrations. | Completed |
Hibernate 2nd Level Cache Using Redis | Explains configuring Hibernate’s second-level caching via Redis and testing using query counting, with a custom repository approach. | Completed |
Read Replica Postgres with connection optimization | Illustrates writing data to a primary Postgres database, then reading from a replica using LazyConnectionDataSourceProxy for improved performance |
Completed |
KeySet pagination and dynamic search with Blaze | Implements keyset pagination using Blaze Persistence, adding dynamic query filters with specifications. | Completed |
KeySet pagination and dynamic search with sring data jpa | Implements keyset pagination using Spring Data JPA, enabling dynamic queries through JPA specifications. | Completed |
MultiTenancy with multipledatsources | Provides examples of running multi-tenant applications under different strategies, each with its own data source. | Completed |
MultiTenancy DB Based | Demonstrates having each tenant use a separate database (while sharing the same schema design). | Completed |
MultiTenancy Partition Based | Shows how to share a single database and table across tenants using a partition-based approach. (i.e., Shared Database with Shared table) | Completed |
MultiTenancy Schema Based | Demonstrates isolating tenants by allocating a separate schema for each tenant within the same database (i.e., Shared Database with Separate Schema) | Completed |
Reactive SQL With JOOQ | Explains performing reactive CRUD operations in Spring Boot using jOOQ. | Completed |
Reactive Cache with Redis | Demonstrates caching reactive database operations in Redis to boost performance. | Completed |
Reactive Application | Illustrates an end-to-end reactive CRUD workflow in Spring Boot using R2DBC. | Completed |
BackgroundJobs and Scheduling using Jobrunr | Sets up background job scheduling with Jobrunr for asynchronous task execution. | Completed |
Scheduling using Quartz | Showcases the Quartz Scheduler, providing a Thymeleaf UI to pause, resume, create, and delete scheduled tasks. | Completed |
Scheduling using Database Distributed Locks with ShedLock | Demonstrates scheduling while ensuring only one active job running at a time via ShedLock. | Completed |
For More info about this repository, Please visit here
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 pgadmin4
Clean up everything using
docker system prune -a -f --volumes
Claim unused volumes
docker volume prune
Running container
docker container ls
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