spring boot tip architecture demo

Multiple Spring Boot applications in the same project

I frequently use the Spring Boot framework in my demos. The latest one is no different. It shows how to achieve CQRS using two different code paths: the command part is implemented via Spring Data JPAthe query part via jOOQ My use case is a banking application that offers a REST layer allowing clients to call any parts. Demoing the query part is easy enough with curl as the URL is not complex: curl localhost:8080/balance/123 (1) 1 Query the balance of the account 123 On the

kubernetes apache web server demo

Port management in your local Kubernetes cluster

Most of my talks contain a demo. A fair share of these demos require multiple 'infrastructure' dependencies: a database (or more), Elasticsearch, you name it. To ease my setup and avoid stuffing my machine, I use either Docker Compose or Kubernetes locally on my Mac. Both rely on Docker Desktop. To expose a cluster Service on my host, I use nodePort. Hence, I set a dedicated node port for each service. I need to remember each of them for each demo. Worse, services might be (are) declared across

graalvm native image micronaut

Native-image with Micronaut

Last week, I wrote a native web app that queried the Marvel API using Spring Boot. This week, I want to do the same with the Micronaut framework. Creating a new project Micronaut offers two options to create a new project: A web UI: As for Spring Initializr, it provides several features: Preview the project before you download itShare the configurationAn API I do like that you can check the impact that the added features have on the POM. A Command-Line Interface: In parallel to the web

graalvm native image spring boot

Native-image with Spring Boot

The Cloud has enabled a lot of new usages that were not possible before. Among them stands Serverless: Serverless computing is a cloud computing execution model in which the cloud provider allocates machine resources on demand, taking care of the servers on behalf of their customers. Serverless computing does not hold resources in volatile memory; computing is rather done in short bursts with the results persisted to storage. When an app is not in use, there are no computing resources allocat

extension API

Extending third-party APIs in different languages

The need for shorter and shorter Time-To-Market requires to integrate more and more third-party libraries. There’s no time for the NIH syndrom anymore if it ever was. While most of the time, the library’s API is ready to use, it happens that one needs to 'adapt' it to the codebase sometimes. How easy the adaptation is depends a lot on the language. For example, in the JVM, there are a couple of Reactive-Programming libraries: RxJava, Project Reactor, Mutiny, and coroutines. You migh

cache cache providers cache vendors comparison analysis

A list of cache providers

Last week, we described several criteria to look at to choose a cache. This week, it’s time to list Java cache providers based on these criteria. Java Caching System Guava Caffeine Ehcache Infinispan Coherence Community Edition Ignite Geode Hazelcast Java Caching System JCS is a distributed caching system written in Java. It is intended to speed up applications by providing a means to manage cached data of various dynamic natures. Like any caching system, JCS is most useful for h

cache

Choosing a cache

Today, I’d like to provide some help on how to choose a cache solution. I will organize it into two parts: In this post, we will list what features a cache must have and which ones it can optionally provide. Most criteria are general and can be used regardless of the tech stack, while a couple is specific to the JVM.In the second part, I’ll list providers and verify their respective capabilities Why cache? First, let’s bust a common myth. Using a cache is not the sign of a b

Kotlin serverless FaaS JVM performance GraalVM native

Kotlin and FaaS, an impossible union?

Some time ago, I read a post describing how to run a serverless Kotlin function on OpenFaaS. While the content is technically correct, I believe the concept itself is very wrong. Such posts can lead people to make ill-advised decisions: 'because we can' is hardly a winning strategy. in this post, I’d like to first explain why the JVM platform is a bad idea for FaaS. Then, I’ll proceed to propose alternatives to use Kotlin nonetheless. I deliberately chose not to link to the original

Maven build performance Maven daemon Docker buildkit

Faster Maven builds in Docker

Last week, I described different techniques to fasten your Maven builds. Today, I’d like to widen the scope and do the same for Maven builds inside Docker. Between each run, we change the source code by adding a single blank line; between each section, we remove all built images, including the intermediate ones that are the results of the multi-stage build. The idea is to avoid reusing a previously built image. Baseline To compute a helpful baseline, we need a sample project. I create