Loading...
Hot Topic

SMEs, Steer Clear of Microservices!

Architecture
April 15, 2024
Read article

Latest Posts

Spring August 23, 2023

Spring MVC: How to Use a Custom Converter for Type Safety in Controllers

Are your controllers constantly filled with primitives? In ArticleController, the first line of every method is: articleRepository.findById(articleId). We keep making the same conversions. I hardly observe as many primitives in any other layer as in the API layer. This leads to much boilerplate. The code becomes harder to test. And it’s harder to read. Yet we know how much easier it is when we work with type safety. In this article, I will show you how to use the Converter Interface to automatically convert your primitives into the correct type.


Spring August 16, 2023

Avoiding Static Access to SecurityContext with @AuthenticationPrincipal in Spring

In almost every web application, logic related to the user must be executed. To access this, his data is assigned based on his authentication. With Spring Security, the authentication framework in the Spring stack, we have various ways to accomplish this essential task. Static Access and its Drawbacks In many applications and examples, it is common to statically retrieve the SecurityContext in Spring to access the current UserDetails. However, this has some disadvantages:


Performance August 9, 2023

The Optimal Thread-Pool Size in Java: Explaining the Formula

Determining the optimal size of a thread pool in Java is crucial to maximizing CPU and resource utilization. This decision depends on many factors. Here, we’ll show you how to use the famous formula from Brian Goetz’s “Java Concurrency in Practice.” We’ll give you a practical example of how to calculate the ratio of wait time to compute time (W/C). The Formula The formula for the optimal size of a thread pool is:


JPA August 2, 2023

Avoid these 5 Common Performance Pitfalls in Spring Data JPA: Practical Solutions and Tips

In the world of JVM backend development, Spring Data JPA is an indispensable tool. It provides a convenient and powerful way to manage and manipulate data. However, like any powerful tool, there are pitfalls that can affect performance. In this article, we will explore five common performance pitfalls in Spring Data JPA and present solutions to avoid them. 1. Index Definition with Spring Data JPA One commonly overlooked aspect when working with Spring Data JPA is the proper definition of indexes.


JPA July 26, 2023

Efficient Data Queries with Spring Data JPA Projections

In the world of JVM Backend Development, efficient data processing is a crucial concern. One of the main strengths of Spring Data JPA lies in its ability to simplify and optimize interaction with the persistence layer. A particularly powerful feature provided by Spring Data JPA is the use of projections. They offer an excellent way to make data queries more efficient and improve system performance. What are Spring Data JPA Projections?


Top