Engineering With Java: Digest #88
Everything is Simple… Until It Isn’t 😄
👋 Java Devs! Welcome to this week’s addition! I hope you’re all doing great.
This week, we cover essential insights on:
📢 Get actionable Java and Spring Boot insights every week, including practical code tips and real-world, use-case-based interview questions, to help you level up your backend skills—join 7300+ subscribers for hand-crafted, no-fluff content.
First 100 paid subscribers will get the annual membership at $50/year forever that is ~ $4/mo ( 89 already converted to paid, 11 remaining)
Testimonials
Java Records Deserve a Mapper Built for Them : This article explains why traditional Java object mappers don’t fit well with Java Records, since they were built for mutable JavaBeans and setter-based designs.
Prefer constructor-based mapping for Java Records instead of setter-based mappers.
Use records for DTOs to improve immutability and reduce mapping complexity.
Evaluate mapper libraries for native record support before adopting them.
Spring Boot Saga Coordination for Multi-Service Writes : This article explains the Saga pattern in Spring Boot as a way to manage distributed transactions across multiple microservices without relying on traditional ACID transactions.
Use choreography for simple flows, orchestration for complex workflows.
Always design compensating actions for every step.
Ensure idempotent event handlers to safely retry failures.
Introduction to Tactical DDD With Java: Steps to Build Semantic Code
Tactical DDD focuses on turning business concepts into clean, expressive Java code using patterns like entities, value objects, aggregates, repositories, services, and domain events.
Model core business concepts as entities and value objects, not primitives or generic DTOs
Keep aggregates small and enforce invariants inside them, not in services
Use domain events to decouple workflows instead of direct service-to-service calls
“Fat-Free” Lambdas in Java : This article explores how Java’s evolution from anonymous inner classes to lambdas and method references has impacted memory usage and object creation.
Prefer stateless lambdas or method references.
Avoid capturing variables in lambdas when possible.
Use explicit parameters instead of closures.
On Default Values for Primitive-Like Classes : This article explains how objects, fields, and variables behave in memory, especially why instance fields are automatically initialized while local variables are not.
Always initialize local variables explicitly, don’t rely on defaults.
Use constructors/records to make object state predictable.
Be careful with “hidden defaults” when debugging null/0 bugs.
Spring Boot Dockerfile Best Practices: Smaller, Faster, Safer Images : This article explains how to build production-ready Spring Boot Docker images using techniques like multi-stage builds, layered JARs, non-root users, and lightweight base images.
Use multi-stage builds to reduce final image size.
Prefer slim or distroless base images for security.
Run containers as a non-root user.
Enable Spring Boot layered JARs for better caching.
Add a
.dockerignoreto exclude unnecessary files.Scan images regularly for vulnerabilities.
Implementing Soft Deletes in Java : This article explains how to mark records as deleted instead of physically removing them, typically using a deleted_at field or boolean flag.
Add a
deletedAtorisDeletedfield instead of hard deleting rows.Ensure all queries automatically filter out soft-deleted records.
Use ORM-level support (JPA/Hibernate filters) to centralize delete logic.
From Zero (Really Zero) to OpenTelemetry : OpenTelemetry provides a unified way to instrument Java applications for traces, metrics, and logs without changing application code using agents.
Start with the Java OpenTelemetry agent for zero-code setup.
Export telemetry to a backend like a collector or observability tool.
Add custom spans only after basic tracing is working.
Java AOT in Production at Netflix : This talk explains how Netflix uses Project Leyden to drastically improve Java startup time by shifting expensive JVM initialization work (class loading, linking, warmup) into ahead-of-time (AOT) training. Instead of doing this in dev or CI, Netflix captures AOT data during canary deployments because they best match production traffic and environment constraints.
Use canaries for realistic AOT training data.
Ensure exact environment match (JVM, OS, CPU, classpath).
Automate AOT capture in deployment pipelines.
Faster startup = better autoscaling + lower cost.
Java 26: Better Language, Better APIs, Better Runtime :Java 22–26 focuses on making Java faster, simpler, and more cloud-ready. Key themes are better language ergonomics (patterns, simpler syntax), major runtime improvements (startup, GC, virtual threads), and new APIs for modern systems. Project Leyden introduces AOT training to significantly reduce JVM startup time using production-like workloads.
Java upgrades now give real performance gains by default (startup, GC, throughput).
AOT / Leyden improves startup using canary-based training runs.
Virtual threads are production-ready now with reduced pinning issues.
Language is becoming more expressive with pattern matching + simpler constructs.
Java at Spotify: Microservices, MCP & AI Overload : Spotify uses Backstage as a unified internal platform to manage builds, deployments, Kubernetes, logs, and canary releases in one place. It removes the need to jump across multiple DevOps tools and gives engineers a single view of service health and deployment status.
“Single pane of glass” for CI/CD + Kubernetes + monitoring
Reduces tool sprawl and context switching
Essential for fast-moving microservices at scale
Spring Boot + Kafka in Minutes (Your First Message) : Spring Kafka is a simple abstraction over Apache Kafka that turns event streaming into standard Spring Boot code.
Prefer Kafka for event streaming, not simple task queues
Spring Kafka removes boilerplate (polling, serializers, offset handling)
Systems emit events instead of direct service-to-service calls
Partition keys ensure ordering; consumer groups enable scaling
Enables decoupled microservices with replayable event history
Start simple (topic + producer + consumer), then evolve for production
Spring Boot Interview Question — Your API Went Viral Overnight
Java Interview Question - The Hidden Object Construction Bug in Java
Spring Boot Interview Question: Debugging Hidden Side Effects in Stream Pipeline
Thats all for this week friends! Thanks for reading this far. If you liked it please share with your network.
Happy Coding 🚀
Suraj
Subscribe | Sponsor us | LinkedIn | Twitter







