java

Validation with Bean Validation API

Bean Validation (JSR 380) validates objects using annotations. Common constraints include @NotNull, @NotBlank, @Size, @Email, @Min, @Max, and @Pattern. I apply annotations to fields, methods, or parameters. @Valid triggers validation in Spring control

Scheduled tasks with @Scheduled

Spring's @Scheduled annotation enables method execution on fixed intervals or cron expressions. @EnableScheduling activates scheduling infrastructure. Fixed delay waits after completion, fixed rate executes at intervals regardless of duration. Cron ex

Database transactions and isolation levels

Spring's @Transactional manages database transactions declaratively. Transaction propagation controls behavior when methods call other transactional methods—REQUIRED, REQUIRESNEW, NESTED. Isolation levels prevent concurrent access issues—READUNCOMMITT

Feature flags for gradual rollouts

Feature flags (feature toggles) enable/disable functionality without code deployment. I use libraries like Togglz or FF4J for flag management. Flags support A/B testing, canary releases, and emergency kill switches. Strategy pattern determines flag st

Batch processing with Spring Batch

Spring Batch handles large-scale batch processing—ETL, data migration, report generation. Jobs contain steps; steps have readers, processors, and writers. Chunk-oriented processing reads, processes, and writes data in configurable batches. ItemReader

CORS configuration for cross-origin requests

CORS (Cross-Origin Resource Sharing) controls which domains can access APIs. Browsers enforce same-origin policy by default. I configure allowed origins, methods, headers, and credentials. @CrossOrigin enables CORS per controller or method. Global con

Docker containerization for Spring Boot

Docker packages Spring Boot applications with dependencies into portable containers. Multi-stage builds optimize image size—build stage compiles code, runtime stage contains only necessities. I use official OpenJDK base images. Layered JARs improve ca

Rate limiting and API throttling

Rate limiting prevents API abuse and ensures fair resource usage. I implement rate limiting using Bucket4j for token bucket algorithm or Redis for distributed scenarios. Limits apply per user, IP, or API key. HTTP 429 (Too Many Requests) indicates lim

Actuator for production monitoring

Spring Boot Actuator provides production-ready features—health checks, metrics, info endpoints. /actuator/health shows application status for load balancers. /actuator/metrics exposes JVM metrics, HTTP stats, custom metrics. /actuator/info displays ap

Microservices with Spring Cloud

Spring Cloud provides tools for building distributed microservices. I use Spring Cloud Netflix Eureka for service discovery—services register themselves and discover others dynamically. Ribbon enables client-side load balancing. Feign creates declarat

Record types for immutable data

Java Records (JDK 14+) provide concise syntax for immutable data carriers. Records automatically generate constructor, getters, equals, hashCode, and toString. I use records for DTOs, value objects, and API responses. Records are final and all fields

Pagination and sorting with Spring Data

Spring Data provides elegant pagination and sorting mechanisms. Pageable interface defines page number, size, and sort parameters. Page wraps results with metadata—total elements, total pages, current page. Sort defines ordering by multiple properties