Migrating to a Microservice Architecture
Interview with Martin Bundgaard, Chapter Lead at DFDS HQ in Copenhagen, Denmark
How DFDS is using development data to drive and monitor their migration from a monolithic codebase to a microservice architecture
DFDS’s key goals are to limit the impact of activities on the environment, keep people and goods safe with secure jobs and good working conditions. To achieve their goals, one focus area is digital capabilities. For DFDS this is key to future success. Martin Bundgaard, Chapter Lead at DFDS HQ in Copenhagen, told us about their journey from a monolithic architecture to microservices.
Is the architecture aligned with the organization?
DFDS were aware of some problematic parts in their codebase, leading to difficulties when adding new features. Martin explains:
"Often, these files with already problematic code quality slowly increase in size because it is easier to add 20 new lines of code to a 4000-line file than to start a refactoring of the file. With CodeScene we have found it easy to overview if we are moving in the right direction or not."
Acting on these issues is a challenge. DFDS operates large systems that transport thousands of people every day; the company is a critical part of the infrastructure between countries. This means that their systems have to evolve securely without disruptions to their mission of keeping people and goods safe. Progressing by small, incremental and frequent releases is the only choice.
In 2018, with the goal of maintaining a high-performing development team while restructuring, DFDS set out to get teams and microservices organized around their business capabilities. This was a core strategic initiative to have a software architecture that allows for autonomous teams, enabling easy scaling, faster time to market and smooth onboarding of new developers.
Shifting from a monolith into a microservice landscape is a complex task.
Aligning development teams with capabilities is challenging and needs monitoring to make sure the effort is moving in the right direction. DFDS uses the CodeScene tool to provide this monitoring. More specifically, DFDS uses CodeScene’s architectural analyses to uncover unexpected team coupling, track implicit dependencies, and visualize the coordination needs between development teams. This makes it possible to measure how organizational patterns influence code quality and how they are linked to the software architecture.
Monitor new code with automated Pull Request Reviews
CodeScene is also integrated into the development pipelines where it reports valuable metrics automatically. This lets the DFDS development teams utilize CodeScene to ensure high quality in new code via the automated pull request review. Martin observes that:
“It is very hard to change code already running in production compared to changing it before it is merged into master. CodeScene informs our developers about undesired parts of the new code – and the recommendations are mostly met."
When they identify files with low Code Health, DFDS also use CodeScene’s Goals that allow them to make sure the relevant code is improving over time. They also use the Hotspot map to identify problematic areas and candidates for pro-active refactorings. Martin adds:
“From time to time we also use the offboarding analyses, so we have a good idea about what should be handed over and what the impact is of a developer leaving a project.".
Our new microservices have a code health score of 9.7 out of 10
This process, with the help of CodeScene’s analytic feedback, allowed DFDS to successfully break down existing monoliths into smaller and more comprehensible components, and build a more maintainable system that is ready to respond to future challenges.
Martin also shared some impressive insights on their code health metrics.
"Our inherited monolith code base of our passenger system has a code health score of ~2-3 depending on what hotspots are active. We only have a few files with these low scores, but it is dragging the overall score down. Our new microservices have a score of 9.7. CodeScene is also helping us being at the high end of the scale."
"It is also evident that the immediate feedback given to our developers on quality when creating pull requests is lowering the development cost in the long run."
We want to thank Martin Bundgaard and DFDS for sharing this inspiring story! To read more about DFDS’s journey from monolith to microservices, check out:
- Martin Oskarsson, Domain solution architect at DFDS, has written about Embracing Conway’s Law and Capabilities in Retrospect.
- Learn more about DFDS and their strategy here
CodeScene offers unique insights into your software and is a quality visualization tool for code. Prioritize technical debt, detect delivery risks, and measure organizational aspects. If you’re interested in learning more about CodeScene, please reach out to firstname.lastname@example.org