Spring Tips #2: Layered JARs with Spring Boot 2.3
Sample code referred in this article is available on GitHub. Using Docker containers for deployment of Java applications becomes more and more popular these days. To ship a new version of application you just build a Docker image with new version of JAR file and push it to the repository, so the deployment team can … Continue reading "Spring Tips #2: Layered JARs with Spring Boot 2.3"
Read MoreScaling down microservices
Microservice architecture became very popular in the last years. This approach has a lot of benefits, which are widely praised at conferences. Unfortunately, it is very common to forget about the problems and difficulties we may encounter. Those who know me a little, know that I have always been skeptical of this approach. In this … Continue reading "Scaling down microservices"
Read MoreAnsible – from tasks to roles
In this post I am going to introduce Ansible roles and walk you through a process of iterative refinement of an Ansible project. The goal here will be to automatically deploy and configure a simple repository serving static files. I will start from a playbook with multiple tasks and slowly build towards a better, more … Continue reading "Ansible – from tasks to roles"
Read MoreSpring tips #1: structuring configuration for integration tests
Spring comes with a lot of features which support integration testing. We have MockMvc, TestRestTemplate and many other useful utilities. Nevertheless, building a proper test context for our app rests in our hands, and there are some pitfalls along the road. In today's article I would like to show you how to avoid one of them
Read MoreThe power of Git interactive rebase
Rebasing in Git is a very useful feature which helps to maintain a readable commit history. Interactive mode of the rebasing is one of the most powerful tools which Git provides. In this post I am going to present interactive rebase and show how you can leverage it in daily work with your repository. Git … Continue reading "The power of Git interactive rebase"
Read MoreDecorating Spring @Components
It is a common situation when an existing Spring component requires some extensions. We have to add new functionality to the existing application. I would like to share my experience on how to deal with such situations in order to keep the application code clean and maintainable.
Read MoreIntroduction to automated provisioning and deployment with Ansible
In this post, I am going to introduce one of the tools which we use here at Tratif for automating software installations. Most of our projects written in Java require a lot of third party services to function (e.g. MySQL, RabbitMQ, Redis). This imposes a mandatory installation step to be performed before we deploy our … Continue reading "Introduction to automated provisioning and deployment with Ansible"
Read MoreWhen two beans collide
Today I would like to tell you about one mechanism of Spring IoC container that I think is a bit less known amongst programmers. We were not aware of it and it had caused us a bit of confusion lately. It seemed at first as if one of our beans had somehow disappeared.
Read MoreStorytelling with tests #1: test names and granularity
Very often you can hear that automated tests provide a great documentation of the production code. Such documentation is more fun to write and is always up to date (of course as long as you actually run your tests). A new developer may take a look on the tests to get familiar with the project. … Continue reading "Storytelling with tests #1: test names and granularity"
Read MoreWhen more is less: mind the cacheability
There are many guidelines and patterns for optimizing performance of web applications. I would like to address and confront one of them: minimizing the number of database queries (or web service calls) per request. It sounds like a good heuristic – each network round-trip (e.g. to and from the DB) takes several milliseconds and impacts the overall response time. So having fewer queries is indeed the right approach for many cases. However, I would like to highlight some situations, when better way is to do the opposite.
Read More