Our First Go Language Experience in Trendyol Seller Productivity

Alican Bayir
Trendyol Tech
Published in
2 min readOct 20, 2020

Everything was started by the big API gateway project separation process. The API gateway project included a small authentication mechanism. Firstly we should have separated this part because the project other sides will be using the part for authentication. This whole API gateway project was written in java using the spring boot framework. We had two choices were that the first one is that we will continue java and spring boot, the other was that we will choose a new language or new java framework. We wanted a new experience because this project will be small that’s why it can be a new experience for the other big projects and a big chance to can learn a new language or framework.

We did a small survey with our team friends. The result of the survey: Java with quarkus framework: 1, GoLang : 3, NestJs: 2. According to the survey result, we decided to write GoLang. I have to admit we were a little scared at the beginning because we do not have any experience with GoLang but new beginnings are condition :).

After some research, we started the project. First, we had a little difficulty because GoLang syntax is more different than other languages that we have experience. We examined other GoLang projects and solved our difficulties. After the three days, we finished our project implementation and started to write unit tests. Bad surprise, We could not write any test because we did not use any GoLang “struct” and “interface” and we understood that we wrote GoLang without GoLang language detail structures. After the bad surprise, we researched some methods to write GoLang effectively and we found this link https://irahardianto.github.io/service-pattern-go/. This pattern facilitated editing our project structure and we could write unit tests with this pattern easily. We understood the GoLang structure more when we wrote the unit tests.

In the end, our first GoLang experience started a little bad but ended well. :)

Advantage Experiences

  1. GoLang's performance is really great.
  2. GoLang resource consumption is really low.
  3. GoLang application is suitable for sidecar pattern because of the above features.

Disadvantage Experiences

  1. GoLang syntax is a little hard at the beginning.
  2. You must spend more time finding an appropriate library. You may not find any problem easily in StackOverflow :) therefore sometimes you must deep research and read much detail to solve problem.
  3. You must manage many things yourself. For example, “dependency injection”.

Thanks, Productivity team :)

“There are some things one can only achieve by a deliberate leap in the opposite direction.”

--

--