GopherCon 2019: Uber's Approach (1)
Source: Dev.to
Prerequisites
Take a look at GopherCon 2019 to understand some interesting topics.
GopherCon 2019: Elena Morozova – How Uber Goes
Recently, videos of GopherCon 2019 have been uploaded one after another, so please remember to check them out. Let’s learn about the latest shares this year. Today, I’ll share a topic that I think is very good, which is How Uber Goes. Uber engineers shared some common problems they encountered after introducing Golang in 2015:
- Creating a large number of new services.
- Frequently switching between different service development (context switching).
- Delivering globalized services.
Solutions
The solutions are through the following three methods:
- Dependency Injection
- Consistent Code Structure
- Monorepo
Because of these problems, Uber internally first developed a Dependency Injection library – fx (https://github.com/uber-go/fx) – to facilitate the creation of different new services, making it easier to develop them through fx. Next, they designed a consistent architecture for each service, making the code between different services easier to maintain. Finally, using a monorepo (all code in a large repository rather than individual projects) makes it more convenient to change package versions (you can update everyone with one commit).