
Vlad Mihalcea Blog
1,797 FOLLOWERS
On Vlad Mihalcea's blog, you can find a lot of articles about Hibernate, Relational Databases, No SQL, Spring, Caching, and other Enterprise-related topics. Vlad is the author of High-Performance Java Persistence https://t.co/QeuIiJjLbQ
Vlad Mihalcea Blog
5d ago
Introduction If your application uses MySQL and you’re interested in getting the best out of it via performance tuning and monitoring, then Releem is a very nice tool that can assist you in your endeavor. I discovered Releem from Roman Agabekov’s posts on social media. Roman is the founder of this tool, and since his posts about MySQL performance tuning are very insightful, I decided to give it a try and see what it has to offer. Installing Releem Releem uses a client-server architecture. The server aggregates data received from the client... Read More
The post MySQL Performance Tuning with Re ..read more
Vlad Mihalcea Blog
1M ago
Introduction In this article, I’m going to explain you should use compact table columns when designing your database schema. By using compact table columns, you can cache more table records and index entries and, therefore, speed up your SQL queries. Database caching As I explained in this article, relational database systems cache the pages that are loaded from the disk in the Buffer Pool (e.g., shared buffers in PostgreSQL) so that the next time the same page is requested by an SQL query execution, the page will be served from the memory... Read More
The post Why you should use compact table ..read more
Vlad Mihalcea Blog
2M ago
Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this series of articles from Franck Pachot about Amazon Aurora Limitless, a PostgreSQL-compatible database that provides automatic sharding. While the solution lacks several features, it’s good to keep an eye on it as it may become a valid alternative to Amazon Aurora. If you are using JPA and... Read More
The post ..read more
Vlad Mihalcea Blog
2M ago
Introduction In this article, we are going to see why there is no benefit in using the Set collection type when mapping a bidirectional JPA OneToMany association. While the @OneToMany annotation can be used to map both unidirectional and bidirectional associations, as I explained this article, you should avoid the unidirectional mapping since it can lead to very inefficient SQL statements. Domain Model The goal of the bidirectional JPA OneToMany association is to map the one-to-many table relationship, which consists of two tables that form a parent-child relationship via a Foreign Key... Read ..read more
Vlad Mihalcea Blog
2M ago
Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about B+Tree indexes, which features a live tool that we can use to see the downsides of using a random key with a B+Tree index. Speaking of indexing, while the SQL Standard offers support for Top-N and Next-N queries, the OFFSET clause may not benefit from... Read More
The post High-Performance Java P ..read more
Vlad Mihalcea Blog
3M ago
Introduction In this article, we are going to analyze how the JTA transaction type works. Since this is the default transaction type when using Jakarta EE or Java EE applications, it’s very important to understand how JTA transactions work, especially since Spring Boot or Spring applications use RESOURCE_LOCAL transactions instead. JTA Transaction Type When using the JTA transaction type, you can operate modifications across multiple data sources in an atomic global transaction that either commits all changes or rolls them back. To understand how JTA transactions work, consider the following d ..read more
Vlad Mihalcea Blog
3M ago
Introduction In this article, we are going to see the best way to determine the optimal connection pool size using the FlexyPool auto-incrementing pool strategy. If you are unfamiliar with the reason why database applications need a connection pool, then check out this article first. Now, according to the Universal Scalability Law, the maximum throughput of a database system is achieved for a limited number of database connections. If we increase the number of connections above that particular number, the throughput will get worse. So, with that in mind, our goal is... Read More
The post The b ..read more
Vlad Mihalcea Blog
3M ago
Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles The pick of this week is this article about data alignment in PostgreSQL tables and indexes. By properly designing your tables and indexes, you can end up saving 10 or 20% of disk and in-memory space. Another good read was this series of articles about how Serializable transactions work in a relational database. If... Read More
The post Hi ..read more
Vlad Mihalcea Blog
4M ago
Introduction In this article, we are going to see how we can use the LazyConnectionDataSourceProxy with Spring Data JPA to acquire the database connection as late as possible and, therefore, reduce transaction response time. For an introduction to how Spring transactions manage database connections, check out this article as well. Service Layer Connection Management Let’s consider we have the following getAsCurrency service method: Because the getAsCurrency service method is annotated with the @Transactional(readOnly = true) annotation, Spring is going to acquire the database connection eagerl ..read more
Vlad Mihalcea Blog
4M ago
Introduction In this article, we are going to analyze how the RESOURCE_LOCAL JPA transaction type works. Since this is the default transaction type when using Spring Boot or Spring Data JPA, it’s very important to understand how transactions are managed when using the RESOURCE_LOCAL mode. JPA Transaction Types When the JPA 1.0 specification was released, there were two transaction types you could choose from: JTA and RESOURCE_LOCAL. JTA (Jakarta Transactions, formerly known as Java Transaction API) is a specification that allows us to use global transactions to apply modifications on multiple ..read more