Our client, an international hospitality giant, serves millions of customers through their website. To support ongoing growth, they aimed to make their development operations more efficient. They decided to move their monorepo for JVM languages (Java, Kotlin, Scala) from Gradle to Bazel. Our engineers helped complete this migration, resulting in faster build times and improved developer experience.
The challenge
The hospitality giant’s platform grew to the point where its existing build tool, Gradle, reached its scalability limits. Faced with the deteriorating developer experience and increasing costs, they decided to switch to Bazel, which is faster, has a better testing infrastructure, and is more maintainable in the long run.
Our client required Bazel to match the features of their existing Gradle setup. This would help avoid introducing any errors to the platform after migration, which could impact the end-users.
Our client lacked the manpower and expertise to complete the migration. Assembling the right team of experts would be challenging as the build tools are a niche domain and there are only a few experts available on the market. To avoid the time-consuming recruitment and onboarding process the client turned to VirtusLab, encouraged by our expertise in Bazel.
The solution
Our engineers joined forces with our client’s development team, who already made some preparations for the migration. They provided support for multiple versions of the same Java library within the given monorepo and built the foundations for the generator of Bazel configs.
VirtusLab took the lead in the migration process which had several key elements. In particular, our engineers rewrote the existing custom Gradle plugins into Bazel rules and macros. This required mirroring or simplifying non-standard solutions encountered within Gradle configs.
Also, much of the effort was devoted to extending and resolving issues within the generator of Bazel configs. The team also provided a systematic approach to classpath drift, which refers to discrepancies in libraries and their versions when comparing Bazel with Gradle.
Our client’s business partner, Engflow provided the low-level infrastructure for the migration such as build caches and the hardware used for Bazel builds.
The results
After migrating to Bazel, the median of the build times were reduced from 100 seconds to 30 seconds. The improvement varied, depending on each build.
- Gradle builds that previously took 400 seconds now only need 100 seconds to complete with Bazel.
- For continuous integration (CI) builds the median of the build times was reduced from 8 minutes to less than 30 seconds.
The development teams have also noticed an improvement in the quality of their work in three crucial areas.
- Reduced flakiness: Build flakiness was reduced by up to 60%, resulting in fewer CI failures and more reliable development cycles.
- Developer workflow streamlining: The standardized commands and integrations provided by Bazel allowed developers working across different repositories (the client also had separate per-language repositories for JavaScript, Golang, and Python codebases) to transition with minimal friction.
- Improved developer experience: Confirmed with satisfaction surveys among the development teams, which showed a 75% increase in positive feedback regarding the build and test setup after the adoption of Bazel.
Since Bazel migration is a cross-repo effort, it allowed developers to seamlessly transition between multiple repos. The same bazel test or bazel build commands work, reducing the need for repo-specific commands or tooling.