Database Articles
5 articles about Database. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Connect Spring Boot to MySQL - application.yml Configuration, JDBC URL Parameters, and Time Zone/Character Encoding Pitfalls
A step-by-step guide to connecting Spring Boot 3.x to MySQL 8, covering Docker Compose startup, application.yml configuration, and connectivity checks. Also covers recommended JDBC URL parameter values and how to fix the Public Key Retrieval error, date/time offsets, and utf8mb4 garbled characters.
-
Database Migration Management with Liquibase in Spring Boot
A guide to introducing Liquibase in Spring Boot, covering XML/YAML/SQL changelog notation, how to write changeSets, executing rollbacks, and comparison and selection criteria against Flyway, complete with implementation code.
-
How to Correctly Configure and Tune the HikariCP Connection Pool in Spring Boot - Why the Default of 10 Isn't Enough
A tuning walkthrough for eliminating "Connection is not available" errors with HikariCP in Spring Boot. Covers the default maximumPoolSize of 10 and the official sizing formula (cores × 2 + 1), reducing connectionTimeout from 30s to 3s, the relationship between maxLifetime and wait_timeout, and leak detection with leakDetectionThreshold, all with implementation examples. Includes comparison data showing the timeout error rate dropping from 40% to 3% after revisiting the configuration.
-
Managing Database Migrations with Flyway in Spring Boot - A Practical Guide from Version Control to Production Deployment
A practical guide to safely versioning your database schema with Flyway in Spring Boot applications. Covers adding spring-boot-starter-flyway, configuring application.properties, how the flyway_schema_history table works, handling existing databases with baseline-on-migrate, and troubleshooting with flywayRepair, all with concrete examples.
-
Introduction to JPA Association Mapping in Spring Boot - How to Use @OneToMany/@ManyToOne/@ManyToMany and mappedBy
A beginner-friendly guide to @OneToMany, @ManyToOne, @ManyToMany, and mappedBy in Spring Boot JPA. Covers bidirectional vs. unidirectional relationships, cascade, FetchType, the N+1 problem, and circular reference handling with code examples to resolve common pitfalls.