Spring Boot as Java Web Application Framework in Traveloka

TL;DR

The majority of Java applications in Traveloka are still powered by Traveloka’s in-house framework. This framework was mainly developed by some of Traveloka’s earliest engineers, including our previous CTO. The in-house framework was initially based on the Play framework. In fact, the early engineers in Traveloka actually used the Play framework at the time, but it was deemed to not satisfy the requirements. Over time, this framework was handed over to the Backend Infra team when the team was created. Using an in-house framework definitely has its own trade-off. While it provides high flexibility, it also comes with a high maintenance cost internally. The in-house framework now is not actively developed further, mainly we only fix major bugs/risks or improve small features, and the documentation is incomplete. There are also a lot of technical debts (i.e. deprecated Jetty libraries) that require effort to be removed. At the same time, in the past couple of years, a lot of new open-source frameworks are emerging in the industry. Some of these frameworks seem to provide solutions to common use cases in the industry based on the popularity alone, and we may also leverage them more in Traveloka. We believe that it is the time to reevaluate the decision that was made years ago regarding the framework in Traveloka.

The most popular Java web application framework now is undoubtedly Spring Boot. According to JetBrains State of Developer Ecosystem 2019, 56% of respondents said that they use Spring Boot when developing Java web applications. Spring Boot itself is not new, Spring Boot 1.0.0 was released back in April 2014, which is roughly 2 years after Traveloka was founded. Furthermore, Spring Boot would not exist without the Spring Framework, which is the very foundation of Spring Boot. Spring Framework is even older, Spring Framework 1.0 was released back in March 2004 (16 years ago!). You can read more about Spring history and philosophy here. What’s interesting for us is even though Spring Boot (or Framework) is getting older, its popularity is still rising, according to the same survey above.

The first adoption of Spring (as far as we know) in Traveloka happened last year, this was completed by the team themselves without any involvement from Backend Infra. Early this year, we noticed that more and more teams are looking into/considering/experimenting/migrating/adopting Spring Boot for their new and/or existing applications. Thus, we decided to also invest in Spring Boot and collaborate with a couple of teams to build expertise together. We also leveraged a lot of existing knowledge from early-adopters within Traveloka (thank you!). We specifically worked on refactoring in-house libraries to be compatible and easily integrated with Spring Boot. We also worked with the PoC teams to figure out how to configure some of the common components such as logging, monitoring, and application build and deployment processes. So far, these teams in Traveloka had (or in the process of) adopted Spring Boot:

We also conducted a survey of Spring Boot adoption in these teams. We asked some questions to know whether Spring Boot brought benefits to their teams, what is their opinion of Spring, and whether it should be adopted further. The results are:

Based on our research, PoC, and the survey result, Backend Infra highly encourages all teams to leverage Spring Boot as the new Java web application framework. We believe that there are many benefits that we can extract from Spring Boot if used correctly:

Going forward, Backend Infra would like to continuously collaborate with all of you to build our expertise on Spring Boot together. We will also iteratively build any required integration to Spring Boot that is specific to Traveloka’s environment, for example, integration with Traveloka’s public API convention. We also believe that there is still a benefit of defining a common convention on using Spring Boot to reduce the duplicate effort and variations within the organization, for example, repository structure, code structure, and Gradle configuration. Therefore, please do not hesitate to involve us if you are interested/considering/deciding to adopt Spring Boot.

We also would like to invite everyone to contribute to continuously improving our Spring Boot SSOT. Your contribution will be beneficial to any team in Traveloka. We also have #java-spring-community Slack channel that focuses on any discussion related to Spring and Spring Boot.

Special thanks to early-adopter teams, we learned a lot from all of you. Special thanks to PoC teams that collaborated with us in this initiative.

If you have any questions or feedback, feel free to contact us. Any feedback is highly appreciated.

Ciao!