A Java Geek weekly 114

Chopping the monolith

If you attend conferences or read technical articles, you could think that microservices are the correct and only way to build a system at the moment. Despite some pushback from cooler heads, the default architecture is microservices. In this post, I’d like to argue why it’s wrong. I’ll first get back to the origin of microservices and the fundamental reason to use them. Then, I’ll describe why microservices don’t fit most organizations' structures. Afterward, I’ll move to detail the root problem to solve. I’ll conclude by proposing an alternative, less-risky approach.

Managing Side Effects: A JavaScript Effect System in 30 Lines or Less

The title is descriptive enough.

What we have built here is essentially a micro-implementation of a classic architectural pattern known as Functional Core, Imperative Shell.

The Country That Broke Kotlin

If you know, you know. But if you don’t, read about it.

Logic vs language: how a Turkish alphabet bug played a years-long game of hide-and-seek inside the Kotlin compiler.

Codex, Opus, Gemini try to build Counter Strike

The experiment is fun, and the results not that bad.

Writing a good CLAUDE.md
  1. CLAUDE.md is for onboarding Claude into your codebase. It should define your project’s WHY, WHAT, and HOW.
  2. Less (instructions) is more. While you shouldn’t omit necessary instructions, you should include as few instructions as reasonably possible in the file.
  3. Keep the contents of your CLAUDE.md concise and universally applicable.
  4. Use Progressive Disclosure - don’t tell Claude all the information you could possibly want it to know. Rather, tell it how to find important information so that it can find and use it, but only when it needs to to avoid bloating your context window or instruction count.
  5. Claude is not a linter. Use linters and code formatters, and use other features like Hooks and Slash Commands as necessary.
  6. CLAUDE.md is the highest leverage point of the harness, so avoid auto-generating it. You should carefully craft its contents for best results.

Time to roll up my sleeves and restart from scratch on my pet project.

You Want Microservices, But Do You Really Need Them?

I have been saying this for years. Read the full piece in Chopping the monolith.

I’m happy the Docker’s blog features stories that provide real-world arguments against microservices.

How revenue decisions shape technical debt

If you need to remember one idea from the post:

Sustainable architectural health depends on how well revenue goals, product needs, and technology strategy align.

Rethinking Spring Application IntegrationTesting
  • When writing integration tests for Spring applications, align them with your functional decomposition approach, because that means you will test more cohesive elements of your code base.
  • That orientation produces tests better aligned with the "Four Pillars of a Good Test" (from "Unit Testing—Principles, Practices, and Patterns") than the traditional, horizontally-sliced approach.
  • Spring Modulith’s https://docs.spring.io/spring-modulith/reference/testing.html@ApplicationModuleTest^] annotation provides first-class support for these kinds of integration tests.
Introducing Mistral 3

For organizations seeking tailored AI solutions, Mistral AI offers custom model training services to fine-tune or fully adapt our models to your specific needs. Whether optimizing for domain-specific tasks, enhancing performance on proprietary datasets, or deploying models in unique environments, our team collaborates with you to build AI systems that align with your goals. For enterprise-grade deployments, custom training ensures your AI solution delivers maximum impact securely, efficiently, and at scale.

Europe is definitely in the AI race.

Duplication Isn’t Always an Anti-Pattern

Let’s remember the Rule of three:

Rule of three ("Three strikes and you refactor") is a code refactoring rule of thumb to decide when similar pieces of code should be refactored to avoid duplication. It states that two instances of similar code do not require refactoring, but when similar code is used three times, it should be extracted into a new procedure. […​]

Duplication is considered a bad practice in programming because it makes the code harder to maintain. When the rule encoded in a replicated piece of code changes, whoever maintains the code will have to change it in all places correctly.

However, choosing an appropriate design to avoid duplication might benefit from more examples to see patterns in. Attempting premature refactoring risks selecting a wrong abstraction, which can result in worse code as new requirements emerge[2] and will eventually need to be refactored again.

The rule implies that the cost of maintenance outweighs the cost of refactoring and potential bad design when there are three copies, and may or may not if there are only two copies.

Sampling in the OpenTelemetry Collector

TIL: the Collector Contrib has a post-sampling feature called tail sampling.

I knew the concept behind post-sampling. In pre-sampling, the decision to keep/discard span is taken on each span individually; in post-sampling, you wait until you get a certain number of spans, and the decision is made based on others. For example, you could keep the spans that are part of the 5 longest traces.

I’m not sure the current capabilities implement such a scenario, but they are promising.

Patterns for Deploying OTel Collector at Scale
  • Load-Balanced/ Gateway Pattern
  • Multi-cluster/ Central Control-Plane Pattern
  • Per Signal Pattern
Nicolas Fränkel

Nicolas Fränkel

Nicolas Fränkel is a technologist focusing on cloud-native technologies, DevOps, CI/CD pipelines, and system observability. His focus revolves around creating technical content, delivering talks, and engaging with developer communities to promote the adoption of modern software practices. With a strong background in software, he has worked extensively with the JVM, applying his expertise across various industries. In addition to his technical work, he is the author of several books and regularly shares insights through his blog and open-source contributions.

Read More
A Java Geek weekly 114
Share this