# spring-boot
26 posts
MongoDB Indexes — Types, Compound Indexes, Covered Queries & explain() Analysis
Understand MongoDB index types, the ESR rule for compound indexes, covered queries, and how to use explain() to analyze query performance in Spring Boot applications.
Spring Boot Profiles Done Right — Config, Activation & Secrets
Master Spring Boot profiles — profile-specific configuration files, conditional beans, type-safe @ConfigurationProperties, and secrets management across environments.
Migrating a Spring Boot Service from Java to Kotlin — A Practical Guide
A step-by-step guide to migrating a Spring Boot application from Java to Kotlin — migration order, build setup, interop gotchas, JPA concerns, and testing with MockK.
Spring Boot 4 + MongoDB — Aggregations, Schema Evolution & Repository Patterns
Build a Spring Boot 4 application with MongoDB — document modeling in Kotlin, Spring Data repositories, MongoTemplate queries, aggregation pipelines, and schema evolution strategies.
Deploying Spring Boot to Railway/Fly.io with Docker & GitHub Actions
Deploy a Spring Boot application with Docker — multi-stage builds, Railway and Fly.io deployment, GitHub Actions CI/CD pipeline, and production configuration.
Multi-Module Spring Boot Project with Gradle Version Catalog
Structure a multi-module Spring Boot project with Gradle — shared dependencies via version catalogs (libs.versions.toml), module boundaries, and build optimization.
Rate Limiting & Circuit Breakers with Resilience4j
Add resilience to Spring Boot 4 services with Resilience4j — circuit breakers, retries, rate limiters, bulkheads, and how to configure them for production.
Spring Boot Actuator & OpenTelemetry — Production Monitoring
Set up Spring Boot Actuator for health checks and metrics, integrate OpenTelemetry for distributed tracing, and export to Prometheus and Grafana.
Spring Boot + Kafka — Producer, Consumer & Dead Letter Topics
Integrate Apache Kafka with Spring Boot 4 — producer configuration, consumer groups, error handling, dead letter topics, and JSON serialization.
CSRF, XSS & SQL Injection — Practical Prevention in Spring Boot
Understand CSRF, XSS, and SQL injection attacks — what they are, how they exploit web applications, and how to prevent each one in Spring Boot with practical examples.
Testing Spring Boot — Unit, Integration & Testcontainers
A practical guide to testing Spring Boot 4 applications — unit tests, MockMvc, @DataJpaTest, Testcontainers for PostgreSQL, and @ServiceConnection.
Spring Security — Role-Based Access Control (RBAC)
Implement role-based access control in Spring Boot 4 — roles vs authorities, @PreAuthorize, method-level security, hierarchical roles, and database-backed permissions.
Spring Security — JWT Authentication from Scratch
Implement JWT authentication in Spring Boot 4 with Spring Security 7 — login endpoint, token generation, validation, refresh tokens, and protected routes.
API Versioning — URL, Header & Content Negotiation Strategies
Compare API versioning strategies — URL path, custom header, and content negotiation. Includes Spring Boot 4 built-in versioning support and decision framework.
Spring Data JPA with PostgreSQL — Repository Pattern Done Right
Set up Spring Data JPA with PostgreSQL in Spring Boot 4 — entities, repositories, custom queries, pagination, and database migrations with Flyway.
REST API Design in Spring Boot 4 — Validation, Error Handling & DTOs
Design production-ready REST APIs in Spring Boot 4 — request validation with Bean Validation, structured error responses, DTO patterns, and API best practices.
Spring Boot 4 Starter — Project Setup, Structure & First API
Set up a Spring Boot 4 project from scratch — project structure, REST controller, configuration, profiles, and your first working API endpoint.
API Rate Limiting & Abuse Prevention
Implement API rate limiting — token bucket, sliding window, per-user and per-IP limits, Spring Boot implementation with Bucket4j, and abuse prevention strategies.
CORS Explained — Why Your API Rejects Frontend Requests
Understand CORS from the ground up — what it is, why browsers enforce it, preflight requests, how to configure it in Spring Boot, and common debugging tips.
CQRS with Spring Boot, Kafka & MongoDB — Part 5: Putting It All Together
Docker Compose setup, end-to-end flow walkthrough, integration tests with Testcontainers, and a production readiness checklist for the complete CQRS system.
CQRS with Spring Boot, Kafka & MongoDB — Part 4: The Hard Parts
Eventual consistency, idempotent consumers, schema evolution, the outbox problem — the real-world challenges that make CQRS hard and how to handle them.
CQRS with Spring Boot, Kafka & MongoDB — Part 3: Query Side — Reads at Scale
Building the query service — consuming Kafka events, building read-optimized projections, and serving fast queries from MongoDB.
CQRS with Spring Boot, Kafka & MongoDB — Part 2: Command Side — Writes Done Right
Building the command service — accepting orders, validating business rules, persisting to MongoDB, and publishing domain events to Kafka.
CQRS with Spring Boot, Kafka & MongoDB — Part 1: What is CQRS and why you need it
Understanding Command Query Responsibility Segregation, when it makes sense, and how Spring Boot, Kafka, and MongoDB fit together in a CQRS architecture.
Kotlin Multiplatform — Share Code Between Android & Backend
A practical guide to Kotlin Multiplatform (KMP) — share business logic, models, and validation between your Android app and Spring Boot backend without duplicating code.
Kotlin Coroutines — Part 3: Real-World Patterns
Flows, StateFlow, coroutines in Android and Spring Boot, Retrofit, Room, and testing — practical patterns you'll use every day.