Best of Spring Boot — June 2024
- 1
- 2
Community Picks·2y
10 Spring Boot Performance Best Practices
Spring Boot, a popular framework in the Java ecosystem, simplifies application development but sometimes needs optimization for performance. Key practices to enhance performance include using the latest versions of Spring Boot and JVM, enabling virtual threads, leveraging Spring AOT with GraalVM Native Image for faster startup times and reduced memory usage, and employing JVM features like Checkpoint Restore and Class Data Sharing. Configuring threads efficiently for both MVC and database access layers, using effective caching strategies, adopting resiliency patterns like circuit breakers, and incorporating thorough monitoring and profiling are also critical. Tools like Digma can further help by providing performance insights during development.
- 3
Community Picks·2y
What's Your Go-To Java Framework
Choosing the right Java framework is crucial for project success. This post discusses preferred frameworks like Quarkus and Spring Boot, highlighting the advantages of using Java 21 with features like virtual threads. It also explores tools like Maven and PostgreSQL, emphasizing their benefits for developers. Observability tools like Digma and OpenTelemetry for Quarkus are also covered, demonstrating their importance in monitoring and improving application performance.
- 4
Baeldung·2y
Vertical Slice Architecture
Learn about Vertical Slice Architecture and how it addresses the limitations of Layered Architecture by organizing code by business capabilities. This approach improves code expressiveness, coupling, and cohesion, while providing flexibility for diverse design paradigms. Examples using Spring Boot demonstrate the application of this architecture.
- 5
Community Picks·2y
How to profile a performance issue using Spring Boot profiling tools
This post explores the importance of profiling performance issues in Spring Boot applications and highlights the scenarios where profiling is crucial. It also discusses the built-in monitoring and observability tools in Spring Boot and introduces Digma as a tool for early detection and profiling of performance issues.
- 6
Awesome Java Newsletter·2y
Why are my JAVA virtual threads slower than the platform threads?
Exploring the performance differences between Java virtual threads and platform threads, the post highlights how virtual threads can enhance service performance by avoiding idle time during I/O operations. It covers enabling virtual threads in Spring Boot, building a test API for comparison, and performance comparisons using Apache HTTP server benchmarking. The author identifies pinning as the reason for unexpected slowdowns and concludes with strategies for overcoming limitations using MySQL Connector/J.
- 7
Baeldung·2y
HTTP Request and Response Logging Using Logbook in Spring
Logbook is an extensible Java library that enables complete request and response logging for various technologies. By adding a Logbook Maven dependency and configuring logback-spring.xml and application.properties files, HTTP requests and responses can be logged in a Spring Boot application. The library supports filtering and formatting logs, and provides different sinks like the ChunkingSink and LogstashLogbackSink for advanced logging needs. Custom sink implementations and JSON formatting are also possible.
- 8
Reflectoring·2y
Getting started with Spring Security and JWT
Spring Security offers robust security features for Java applications, including session management, authentication, and protection against common threats like CSRF. This guide covers the implementation of JWT (JSON Web Token) for secure communication between two parties. JWTs are versatile and can be used for single sign-on, API authentication, stateless sessions, and microservices. It covers the creation, structure, common use cases, and potential drawbacks of JWTs, as well as a step-by-step guide to implement JWT for authentication in a Spring Boot application.
- 9
- 10
Vaadin·2y
Building AI-Powered Java Applications
Java developers are keen on integrating AI into their applications but often find it challenging due to time constraints and the steep learning curve. Enterprise applications benefit greatly from AI, as it can automate complex workflows. To help developers, the author created two application starters: a RAG-based business context-aware chatbot and a sentiment analysis tool for customer feedback, both built with Flow, LangChain4j, and Spring Boot. Ideas for further AI applications are welcomed.
- 11
Community Picks·2y
Efficient containers with Spring Boot 3, Java 21 and CDS by Sébastien Deleuze @ Spring I/O 2024
Sébastien Deleuze explains how to enhance runtime efficiency in Spring Boot applications using Spring Boot 3, Java 21, and Class Data Sharing (CDS). Key focuses include minimizing startup time, reducing memory consumption, and optimizing container deployments. Deleuze introduces features such as native image support, ahead-of-time (AOT) optimizations, and virtual threads, which collectively improve application performance and scalability. He also highlights improvements in developer experience with Spring Boot 3.1 and the integration of CDS in Spring Boot 3.3, demonstrating practical steps and benchmarking results to showcase these optimizations.
- 12
Javarevisited·2y
Let’s get Authenticated — Google Sign In
This post provides a full-stack solution for implementing Google Sign In using React.js and Spring Boot. It covers configuring Google APIs and Services, setting up the front-end using React.js, and implementing authentication in the back-end using Spring Boot.
- 13
Javarevisited·2y
WSLing Spring Boot with IDEA
Developing Spring Boot applications on Windows can be challenging, but upgrading to IntelliJ IDEA 2024.1.3 has significantly improved the experience. The post provides a comprehensive guide on setting up a self-contained WSL environment for Java development, installing IntelliJ IDEA on Windows, and configuring it to work seamlessly with WSL. The post also compares WSL with Dev Containers, highlighting the space and memory usage considerations for an optimized development setup.