This project demonstrates a Spring Boot application with PostgreSQL as the database. It supports both read and write operations and integrates with Prometheus for metrics collection. Additionally, the application can be containerized using Docker.
- Spring Boot with PostgreSQL: Provides a structured way to interact with relational databases.
- Read and Write Operations: Optimized for efficient data access.
- Prometheus Metrics: Collects and exposes application metrics for monitoring.
- Docker Support: Easily deployable with Docker Hub integration.
The application is configured to expose metrics in a Prometheus-compatible format. These metrics help in monitoring database connections, query performance, and overall application health.
The application is available on Docker Hub: Docker Hub - Demo App
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Spring Boot Testcontainers support
- Testcontainers Postgres Module Reference Guide
- Spring Data JDBC
- Spring Data JPA
- JDBC API
- Spring REST Docs
- Testcontainers
- Spring Web
- Spring Web Services
The following guides illustrate how to use some features concretely:
- Using Spring Data JDBC
- Accessing Data with JPA
- Accessing Relational Data using JDBC with Spring
- Managing Transactions
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
- Producing a SOAP web service
This project uses Testcontainers at development time.
Testcontainers has been configured to use the following Docker images:
Please review the tags of the used images and set them to the same as you're running in production.
Due to Maven's design, elements are inherited from the parent POM to the project POM. While most of the inheritance is fine, it also inherits unwanted elements like <license> and <developers> from the parent. To prevent this, the project POM contains empty overrides for these elements. If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.