The Java Cafe

The Java Cafe is a community of amazing users

Java and Cloud content, by the community for the community

Create new account Log in
loading...

How to Build Java Applications Today: May 31, 2021

ksilz profile image Karsten Silz Originally published at bpfnl.substack.com ・9 min read

TL;DR

Microsoft’s OpenJDK builds officially released, new cloud database FaunaDB, continuous testing in Quarkus 2.0, Jakarta EE 9.1, GraalVM 21.1, and Spring Integration for AWS 2.5.


README

This is issue 38 of my weekly newsletter, “How To Build Java Applications Today”. “Java news with a smile”: I read all the Java newsletters, so you don’t have to!

If you like my newsletter, then subscribe to it on Substack, read it on dev.to or the Java Cafe! Even better: Share it with people who may be interested.


Quote of the Week

Reading is to the mind what exercise is to the body.‌
Richard Steele, Irish writer (1672-1729), surely wasn’t talking about Facebook or Twitter.


Stand-Up

It’s Memorial Day in the US and Spring Bank Holiday today. So I hope that you enjoy your day off! Here in Milton Keynes (near London), the temperature is 22 degrees Celsius or 72 degrees Fahrenheit. Or, as it’s known here in the UK: a heatwave. Look, guys, I’m sorry, but where I’m from (Germany), a heatwave starts with 30 degrees Celsius/86 degrees Fahrenheit.

My recent talk at JJUG CCC Spring 2021 is now on YouTube. So in less than 40 minutes (or 20 minutes at double speed), you can find out how we Java developers should build new web applications and native iOS & Android apps today and what we should do on the desktop. If you like what you saw, my talk page has more videos, additional information, and links to get started.

I also found out last week that W-JAX Munich accepted two of my talks. W-JAX is a hybrid conference for Java, architecture, and software innovation (November 8-12). So which talks am I to give? Find out on my blog! Shameless click-baiting, I know…


Bookmarks

Java

Microsoft’s OpenJDK Builds Officially Released

Last week, I wrote about why Microsoft has its own OpenJDK distribution: backports & trust (see the aptly named section “Microsoft’s Reasons For Their Own JDK: Backports & Trust” in issue 37). Now that OpenJDK distribution is out of beta, we can download it at Microsoft for Windows, macOS & Linux. Or we can use the Docker container images.

Microsoft only released Java 11 builds into production for now. Java 16 builds are in early access, with no production release date given. Only time will tell how fast Microsoft will publish their builds after Oracle releases a new Java version (such as the upcoming Java 17).

As I said before, Google’s now the only major cloud vendor without its own Java distribution. It’s unfair to blame them for that, though, as they were embroiled in a Java lawsuit with Oracle until two months ago. But they won (see section “Google Wins Java Court Case Against Oracle” in issue 30). Time will also tell if Google is more interested in inventing new programming languages than “dressing up” existing ones (like Java).

Finally, time will tell for sure that you shouldn’t use the same worn-down phrase twice in the same article.

Announcement blog post


Frameworks & Libraries

FaunaDB - A New “Kitchen-Sink Cloud Database”

When choosing technologies for our Java applications, “Pick something boring” is a good rule of thumb. It means going for established technologies with a broad user base that already went through all the problems that we may experience. You know, so that Google & Stack Overflow can give us answers quickly! And nowhere is that as true as in data storage: If our database corrupts our data, we’re hosed. Fortunately, there’s MySQL and PostgreSQL and a host of NoSQL data stores - and that’s just the open-source side.

So how do you launch a new commercial database into this environment? Let’s look at FaunaDB as an example.

Step one: You throw everything but the kitchen sink into your product: Relational and document storage, ACID transactions and global cloud distribution, triggers and stored procedures, GraphQL, built-in temporal queries for auditing, and built-in multi-tenancy. A big downside: We must use the “FaunaDB Query Language” because SQL didn’t make it into this sink. So what’s FDB like?

Unlike SQL, FQL is not declarative, but “expression-oriented”. A SELECT * FROM dept WHERE deptno = 10; in SQL turns into two FQL expressions. First, we must create an index:

CreateIndex({
  name: "all_depts",
  source: Collection("dept")
})
Enter fullscreen mode Exit fullscreen mode

Then we can query that index:

Map(
  Paginate(
    Match(Index("dept_by_deptno"), 10)
  ),
  Lambda("X", Get(Var("X")))
)
Enter fullscreen mode Exit fullscreen mode

Well, love at first sight, it ain’t. But then I’m an old dog, this is a new trick, and you know what they say about these two.

Let’s get back to FaunaDB. Step two in their plan for world domination: You declare that your product is in a new category all by itself. Naturally, it’s the best (and only product) in that category and evades immediate comparisons to all that was before: There were relational databases, and the 2010s saw the rise of NoSQL. But now’s the time for FaunaDB, a “cloud-native database” (my words, not theirs). Well, maybe.

Step three: You mention in every second sentence that the people behind FaunaDB worked for Twitter. Seriously, listen to this podcast interview with one of the founders. If my drinking game was downing a shot every time I hear “Twitter”, I’d be wasted halfway through the podcast! But I’d do the same if I was them: They’re selling a new database, man, so they have to “borrow authority” any way they can!

Look, FaunaDB certainly has some enticing features. But it’s the opposite of boring technology. So, should we use it? Generally, no. But in a world of microservices, it certainly is easier to give it a try in a little microservice over there in the corner…

FaunaDB home page


Continuous Testing in Quarkus 2.0

How do you compete with the 800-pound gorilla? That question must be on the minds of the Quarkus team. The “JRebel 2021 Java Technology Report” gave Spring Boot 62% market share - and Quarkus 6% (see the section of that same name in issue 27). And Quarkus’ biggest differentiator - small & fast native images for programs through GraalVM - will probably evaporate this November with Spring Boot 3 (or whatever it’ll be called - see section “The Empire Strikes Back: Spring Native Beta Announced”, also in issue 27).

One answer is “Developer Joy” (listed as reason 3 out of 3 on the Quarkus homepage). Take the time between “I changed my code” and “My changed code runs” as an example. Spring Boot doesn’t give us much joy there: It’s got a hot reload agent, but not a very capable one. So I pay for a JRebel license out of my own pocket because it saves me from a lot of Spring Boot restarts.

Now, did you know that Quarkus can even hot reload inside a Kubernetes pod? That puts Spring Boot to shame! Why doesn’t Quarkus shout that from the mountain tops and its homepage? Beats me.

Now Quarkus gives us developers even more joy. At least the ones who have unit tests. I know, we’re all supposed to have unit tests. We’re also supposed to eat our broccoli and floss every night, but we don’t. Anyhow, if you have unit tests, then Quarkus 2.0 (expected by mid-June) does this: ”Your test suite will be run once at the start, and then continuous testing will run your tests as you are coding, and tell you if your changes will break any tests.” Joy to the world!

I think this is a smart move by Quarkus. They can’t out-integrate Spring Boot because everybody integrates with Spring Boot. So they pick a few things they can do easier in their new code base than Spring Boot can. After all, the Spring framework is 17 years old by now. Good luck, guys! I hope you get Spring Boot to up their game - so that someday, I don’t have to pay for my JRebel license anymore! 😌

Article


Releases

Jakarta EE 9.1

Jakarta EE launched late last year (either November-ish or December 8 - don’t ask). So what’s new in 9.1?

Two words: Java 11. Originally, Jakarta EE 9.0 was to ship with that, but the feature was dropped to release in 2020. See for yourself: The Jakarta EE 9.0 web profile lists identical API versions as the 9.1 web profile.

Dear Jakarta EE team: I know you had your plate full over the last few years. First you fought with Oracle lawyers over the “Java EE” trademark and lost. Then you settled into Eclipse and renamed packages from javax. to jakarta.. And then you got the Java 11 support out of your system. But now I think you finally should add some new features! How else are you going to compete with Spring Boot, Quarkus, and all the other guys? Remember how the “JRebel 2021 Java Technology Report” threw you in the “Other frameworks” bucket (see issue 27)? Ouch! So dust yourself off and deliver! Spring Boot can use some more competition. I probably don’t tell you anything new here, but I just want to be on the safe side.

Article


GraalVM 21.1

This maintenance release has experimental support for Java 16. Node.js is now an optional dependency, bugs were fixed, and things are generally faster and better now. Told you it was just a maintenance release!

Article


Spring Integration for AWS 2.5

This project is not part of Spring Cloud anymore but has its own organization. “awspring.io”? I can’t decide if the new name is cute (“Aw - Spring!”) or a spelling mistake (there are two “s” in “AWS Spring”). The list of changes is really small - the switch to Spring Integration 5.5 being the biggest change.

Announcement


About

Karsten Silz is the author of this newsletter. He is a full-stack web & mobile developer with 22 years of Java experience, author, speaker, and entrepreneur. Karsten got a Master's degree in Computer Science at the Dresden University of Technology (Germany) in 1996.

Karsten co-founded a software product start-up in the US in 2004. He led product development for 13 years and left after the company was sold successfully. He co-founded the UK SaaS start-up "Your Home in Good Hands" as CTO in 2020.

Karsten has this newsletter, a developer website, and a contractor site. He's on LinkedInTwitter, and GitHub. Karsten is an author at InfoQ.

Discussion (0)

pic
Editor guide