<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Diego Dupin on foojay.io - Friends of OpenJDK</title><link>https://foojayio.github.io/website/today/author/diego-mariadb/</link><description>Articles written by Diego Dupin on foojay.io - Friends of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 23 Jan 2024 13:03:18 +0000</lastBuildDate><atom:link href="https://foojayio.github.io/website/today/author/diego-mariadb/index.xml" rel="self" type="application/rss+xml"/><item><title>MariaDB Java Connector, Benchmark, and Java 21 virtual threads</title><link>https://foojayio.github.io/website/today/benchmark-jdbc-connectors-and-java-21-virtual-threads/</link><pubDate>Tue, 23 Jan 2024 13:03:18 +0000</pubDate><guid>https://foojayio.github.io/website/today/benchmark-jdbc-connectors-and-java-21-virtual-threads/</guid><description>&lt;p&gt;Why should Java and database developers care about Virtual Threads? Developers can write faster and more resource efficient applications without having to refactor synchronous code a.k.a. &amp;ldquo;imperative&amp;rdquo;) JDBC code into asynchronous (a.k.a &amp;ldquo;reactive&amp;rdquo;) code that is hard to create, debug and maintain.&lt;/p&gt;
&lt;p&gt;Writing scalable network code is always difficult. Synchronous APIs can&amp;rsquo;t be scaled beyond a certain point because they can block when performing I/O operations, which in turn block the thread until the operation is ready. For example, if you try to read data from a socket when no data is available, the thread will freeze until data becomes available. Threads are also an expensive resource on the Java platform, so we don&amp;rsquo;t want to force them to wait for I/O operations to complete. To avoid these limitations, we typically use asynchronous or reactive I/O frameworks such as Project Reactor, RxJava, or Vert.x and connectors like R2DBC. These frameworks allow us to write code that doesn&amp;rsquo;t block a thread during an I/O operation, but instead uses a callback or event notification to notify the code when the I/O operation is complete or ready.&lt;/p&gt;</description></item></channel></rss>