JVM

New Projects in JDK, or how Minecraft pushes Java forward – JVM Weekly vol. 171

That’s how it is… always when I’m gone for a week, the topics pile up and the next edition is a waaaay long. Enjoy your reading.

Article cover

1. How does Netflix use Java in 2024?

Are you familiar with ByteByteGo? You probably do, because it’s the most popular Substack newsletter in the world, discussing topics and trends in large-scale system design by the creators of the bestselling System Design Interview book series. Personally, I’m a big fan, not even just because of the knowledge that is presented there (as it covers, however, mostly quite ‘laboratory’ architectural cases), but because of the format. The whole thing is very accessible and strongly visual, and as a result, even on topics I am fairly familiar with I like to take a look at what they have described. That’s why when they published the text Evolution of Java Usage at Netflix I decided that this was the perfect opportunity to share ByteByteGo with you.

While doing so feels tiny as in the above image however.

There have always been a lot of myths floating around about Netflix itself, as arguably in a formative period for many of us it was from their solutions such as RxJava, Nebula and Hystrix that we learned (including from mistakes) how to approach Microservices architecture, I myself remember my fascination with them somewhere around 2016. However, back in May 2022, Paul Bekker was explaining on Twitter that in fact RxJava was already, as I described in JVM Weekly #4 (but that time flies). The same Paul last year at the Spring One and Infoq conferences talked about the evolution of not only the Netflix approach to Java, but also the architecture – you can see the presentation itself here:

Reverting to the publication of ByteByteGo, this one clearly builds on Paul’s presentation, discussing the evolution of Netflix’s approach to Java and demonstrating how the company’s architecture has dynamically changed to meet growing technological and operational demands. Netflix continues to rely firmly on Java, but over the years, the Java stack at Netflix has undergone significant changes, moving away from a monolithic architecture towards a more decentralised and flexible microservices architecture. The article describes the shift from using Groovy scripting as part of the backend to frontend (BFF) pattern – I further remember the days when Netflix promoted its own Falcor solution – to the introduction of GraphQL Federation, a response to the need for more efficient query and data management. This change allowed for a significant reduction in API redundancy and redundant data retrieval, which is crucial when supporting a variety of customer end devices (and Netflix has a plethora of these end devices to handle).

Also, the article touches on the evolution of the Java version at Netflix, moving from Java 8 to newer versions like Java 17 and 21, which has contributed to better CPU utilisation and reduced operating costs – well worth it overall. The company has also standardised around Spring Boot, while leveraging the benefits of a broad open-source community. Overall if you like to make technology decisions based on what BigTechs show at conferences (not recommended) – the whole thing is really interesting. Even if you don’t use the lessons in the text with common sense, the whole thing will show how such an evolution takes place in a large organisation.

And staying on the topic of things Netflix is dropping – I’ll honestly admit that I’m tempted to do a review of what’s going on with RX projects in general after the craze has passed. Maybe at some spare moment I’ll commit to such a special edition.
Discover more IT content selected for you
In Vived, you will find articles handpicked by devs. Download the app and read the good stuff!

phone newsletter image

2. New Projects in JDK, or how Minecraft pushes Java forward

The title of the current section (and the whole edition) may be a tad stilted, but I couldn’t help myself. I grew up believing that Java was in no way suitable for games. That’s why I love any situation where I can make everyone aware that Minecraft, remaining one of the world’s most popular games, runs on JVM. The proud ecosystem takes care of its crown jewel, and it repays it as best it can. But before we get to Minecraft, in this section on new projects, we’ll tackle a serious topic, for serious people – security.

Some context: Java Cryptography Architecture (JCA) and Java Cryptography Extension (JCE) are the two main cryptographic libraries in Java that work together to provide a wide range of cryptographic functionality. JCA, which is part of Java’s Cora API, provides basic cryptographic functionality, while JCE extends these capabilities by introducing advanced cryptographic operations. The latter library used to be subject to US export regulations and so could not become an official part of the JDK, but over time these restrictions have been relaxed, allowing them to be integrated together into Java SE. Because of this, the demarcation between the two is no longer so clear-cut, future changes in regulation could again affect their availability and functionality – and since we live in fairly turbulent times, I would treat this risk as non-zero.

Let’s move on to the main announcement, however. The Brisbane Project, as it is referred to, is an initiative to create a FIPS 140-compliant JCE implementation specifically for regulated environments in the US. The project plans to use the Foreign Function & Memory API to create a rapper over the OpenSSL library, which has been validated against the FIPS 140 standard, ensuring its correct use. Brisbane thus intends to provide a cryptographic solution that meets stringent security requirements while integrating seamlessly with JVM applications.

And we laugh at Python.

FIPS 140 (Federal Information Processing Standard Publication 140) is a US government standard that establishes security requirements for cryptographic modules used in federal information systems. With FIPS 140 compatibility, OpendJDK (because FIPS 140 compatibility was already available previously within Oracle Cloud, among others) will be able to be used in environments requiring the highest level of data protection, such as sensitive government and financial sector operations.

Well, okay, but now it’s time to move on to explain what I mean by the Minecraft reference earlier. The Wakefield project is an initiative to integrate support for the Wayland Linux display server into the JDK. Wayland is intended to replace the outdated X11 desktop display server protocol, developed in the 1980s, with a modern approach that enables client-side rendering and a so-called composite desktop windowing system, becoming the default display server technology on numerous Linux distributions such as RHEL 8, OL 8 and Ubuntu 21.04. The Wakefield project has two main objectives: a short- to medium-term solution for the JDK running on Wayland in X11 compatibility mode, and a medium- to long-term solution of running the JDK as a native Wayland client. The second goal is the main objective of the project, but it is much more complicated and will take many years to achieve, so it is also necessary to achieve the short-term goal.

The importance of Wayland for Java, especially in the context of games, is quite important, as these require robust graphics performance and system compatibility. Minecraft, along with other Java-based games, relies on a stable and efficient display server architecture to ensure adequate fluidity. By porting Java to Wayland’s native environment, developers can take advantage of Wayland’s improved client-side rendering and compositing capabilities, potentially improving graphical performance on Linux systems, which will provide assurances that popular Java applications such as Minecraft will continue to run optimally on these platforms without relying on outdated or less efficient protocols and compatibility layers.

And Minecraft is returning the favour. The introduction of Minecraft’s latest snapshot, numbered 24W14A, introduces significant technical changes that could significantly contribute to the continued popularity of new JDK releases. Indeed, as of the new update, Minecraft (in its Java edition) requires Java 21 to be installed, using the Java distribution from Microsoft (is anyone surprised?). In addition, the game now only supports 64-bit operating systems (because, and as a reminder – the JDK will also soon be out of 32-bit mode).

Może się okazać, że to jedno z największych pojedynczych wydarzeń promujących adopcje nowego LTSa.

Although I’m not a Minecraft fan myself (I’m waiting for my daughter to grow up and play along with her), the holy war over which version of Minecraft is the best has always amused me

Discover more IT content selected for you
In Vived, you will find articles handpicked by devs. Download the app and read the good stuff!

phone newsletter image

3. Release Radar

6-Month Roadmap for Java on Azure Tools

Since it was about Microsoft, we’ll start ourselves off with the publication of the six-month roadmap for Java on Azure Tooling, described by Jialuo Gan. The whole thing gives us an insight into Microsoft’s plans and just highlights how strategic an area Java has become for the company.

Frequent updates include integration with the latest Azure services such as Azure Functions, Azure Web App and Azure Cosmos DB, with specific enhancements such as Flex Consumption support and Java runtime environment version updates. In addition, there is a strong emphasis on building cloud native applications using containerised services such as Azure Container Apps (ACA) and Azure Kubernetes Service (AKS). Further enhancements are planned to help developers build intelligent applications using the Azure OpenAI service, with support for new models such as Completions and DALL-E (no surprises here, I think).

Work is also underway to integrate the Azure SDK Build Tool with the Azure toolkit and the Maven plugin, with the aim of helping developers ensure correct use of the Azure SDK and dependency management, which has not always been so obvious. To the same end, the available authorisation mechanisms have also been improved. In addition to technical improvements, the Azure team has committed to updating documentation and reducing bugs.

Not every hero wears a cape.

Visual Studio Code March Update

In the last edition, I wrote quite extensively about what a useful tool Visual Studio Code has become for Java developers, so let’s take a look at what its developers have in store for Java developers.

The March update of Visual Studio Code for Java introduced a number of new features for Spring Boot. A significant new feature is the refactoring preview option available during version upgrades, which allows projects to automatically upgrade to the latest version of Spring Boot with the ability to preview changes before they are applied. The ability to directly add Spring Boot starters via a pom.xml file has also been added, making dependency management easier. In addition, users can now change login levels on the fly in a running application thanks to a new command in the tools palette, which is only effective during the current run session.

Also new in the stable version of Visual Studio Code is the ability to run tests with coverage – previously only available in the Insider version. This feature, supported by the Jacoco library and the latest test coverage API, allows detailed code coverage analysis directly in the editor. To take advantage of all these new features, you will need to install the latest version of the Extension Pack for Java, and some of the above new features for Spring require a Spring-specific pack to be installed.

And speaking of IDEs…

Intellij Idea 2024.1

Normally IntelliJ IDEA gets its own section in this review, but as I have already mentioned some of the changes (AI Assistant or K2 Mode) in previous reviews, today will be a little shorter, which does not mean there is nothing interesting to describe. This is because the new version of the IDE environment fully supports the latest features of Java 22, which is described in a whole post dedicated to it. Other Java-specific improvements include the introduction of language injection into string templates, new inspections and quick fixes. Additionally, the UX of working with multi-version JAR libraries has been improved.

For Kotlin and Scala developers, IntelliJ IDEA 2024.1 also introduces significant improvements. The IDE environment includes a new Kotlin K2 mode, using the built-in Kotlin K2 compiler to improve Kotlin code analysis, and uses the official Kotlin style guide as a formatting option by default. For Scala, support for Scala 3 has been improved, including better recognition of mixed modifiers, improved indentation support and improved debugger support. Additionally, IntelliJ IDEA has improved support for static imports in Kotlin and added new capabilities for working with Scala, such as improved Scaladoc and documentation pop-ups.

In addition to language-specific features, IntelliJ IDEA Ultimate 2024.1 offers a number of updates to improve overall user productivity. The IDE has improved the HTTP client, integrates support for OpenRewrite (recently discussed by Adam Bien in his podcast with Jonathan Schneider, recommended) for refactoring, and introduces updates to Terraform support. The database support tools have also been significantly improved with options such as local filtering in the data editor, improved query execution and improved support for Redis modules. In addition, IntelliJ has made improvements to version control systems with new code review modes for GitHub and GitLab and a number of other VCS enhancements.

And as we have already mentioned K2…

Kotlin 2.0 RC

Kotlin 2.0 has just entered the Release Candidate phase, the next iteration of which will gradually allow access to more functionality. I’m letting you know mainly for information, but all indications are that the Kotlin language developers are preparing something special for the upcoming KotlinConf 2024.

Which I am very much looking forward to, as I am going to KotlinConf this year. Expect coverage, and I’d also love to high-five someone who reads these reviews.

JKube 1.16

JKube is a tool that facilitates the integration of Java projects with Kubernetes, automating the process of creating both Dockerfiles and generating the necessary Kubernetes manifests. Integrated with Maven and Gradle, it enables easy deployment, management and debugging of applications in a Kubernetes environment. JKube eliminates the need to manually configure Docker and Kubernetes, supports advanced Kubernetes features like health checks or autoscaling, but also the creation of container images using Docker, S2I or Jib build strategies.

If you are not familiar with JIB, years ago I wrote a post working out how the first version of the project is implemented – if free runs ever come my way I’d love to revisit it.

In the latest version of JKube, 1.16, users got a new strategy for building container images using Cloud Native Buildpacks, which allows source code to be transformed into a ready-to-run application image – I recently mentioned this standard in the context of the new version of GraalVM. A new Helm graph linting feature has also been added, which can be run with a simple Maven or Gradle command to examine the generated Helm graphs for potential issues. Base images have also been updated and recommended Kubernetes labels have been introduced, which together with bug fixes and minor improvements make JKube an even more useful tool…

…especially for people who don’t want to do a PhD on the increasingly complicated new versions of Kubernetes.

JobRunr 7.0

Private opinion: Although Quartz remains perhaps the most popular solution for background task scheduling, my favourite recommended library remains JobRunr, which easily integrates with popular Java frameworks and supports a variety of task persistence management methods. In addition to flexibility and the ability to manage more complex schedules, JobRunr also provides detailed monitoring and management of task states via a comprehensive dashboard (especially in pro version), which is really invaluable with more complex systems. For this reason, the release of its new edition is something I am personally very excited about.

The 7.0.0 version of JobRunr and JobRunr Pro introduces a number of very interesting new features. Let’s start with the base version, which brings support for Virtual Threads and configurable job server shutdown periods. Additional enhancements include optimised job processing using multiple threads, better management of database migrations and better information when it comes to performance bottlenecks. The update also improves system performance by introducing time-based UUIDs for job identification.

Interesting things also appear in the Pro version targeting Enterprise companies, which introduces a mass of new features to the dashboard – OpenId support, or GDPR/HIPAA compliance options to hide sensitive task data. “Professional” users have also been given advanced capabilities to limit task processing bandwidth and the ability to customise task tables with additional columns and configurable visibility, which will come in handy when we want to integrate our scheduling with other company systems.

This is not all the changes, as there are indeed many. So if you’re using JobRunr, I encourage you to take a look at the Release Notes.


PS: Today came out long, but that’s because a week ago I was in the final straight of preparing my new conference talk Digging for Truffles – Unveiling the Mysteries of GraalVM’s Least Understood Component for the Polish 4Developers conference. If I get the chance to narrate it somewhere abroad, I’ll be sure to let you know!