Live data from Hacker News

Uber Go Style Guide

github.com

21–30 of 140 posts

Re: Uber Go Style Guide

#21
post #4

"Copy Slices and Maps at Boundaries. Slices and maps contain pointers to the underlying data so be wary of scenarios when they need to be copied. Keep in mind that users can modify a map or slice you received as an argument if you store a reference to it. Similarly, be wary of user modifications to maps or slices exposing internal state." This could be used as an ad for Rust borrow checker, verbatim. You can't modify…

Cannot wait for "Uber Rust Style Guide".

Re: Uber Go Style Guide

#22
post #2

Is Go the primary language in Uber now? I see a lot of tools written in Go coming out of Uber. What kind of services inside Uber is Go used for?

Uber have well over 1,500 microservices written in Go, it is the primary language backend services are written in at Uber.

> Uber have well over 1,500 microservices written in Go

1500?! I can't even imagine how micro a microservice could be such that Uber could have so many.

edit: Having said that, the Monzo blog post also on the front page says it has 1100 microservices, so I suppose I've just not worked somewhere with 'actual' microservices. What constitutes a 'service', a single procedure for RPC?

Re: Uber Go Style Guide

#23
post #2

Is Go the primary language in Uber now? I see a lot of tools written in Go coming out of Uber. What kind of services inside Uber is Go used for?

Uber have well over 1,500 microservices written in Go, it is the primary language backend services are written in at Uber.

1500 microservices? Are they exposing each function as a microservice or something? At which point could be having 1500 microservices a good thing? I honestly cannot think of one unless you have some massive design flaw or have a different definition for microservice.

Re: Uber Go Style Guide

#24

Earlier quoted context omitted.

For backends they've standardized on Go and Java, deprecating/eliminating node and python where possible. I understand node is still prevalent for serving react-based frontends, both external and internal facing.

How do they decide with a new backend service to use Go vs Java?

Often comes down to the preference of the engineers in a given team and evaluating pros and cons with engineers outside their team (aka review their plans before they start building)

Re: Uber Go Style Guide

#25

Earlier quoted context omitted.

For backends they've standardized on Go and Java, deprecating/eliminating node and python where possible. I understand node is still prevalent for serving react-based frontends, both external and internal facing.

How do they decide with a new backend service to use Go vs Java?

I'd guess it's usually up to the developers/owning team, but also to some extent depending on the ecosystem it's interacting with (e.g. Hadoop would tend to prefer Java)

Re: Uber Go Style Guide

#26
post #4

"Copy Slices and Maps at Boundaries. Slices and maps contain pointers to the underlying data so be wary of scenarios when they need to be copied. Keep in mind that users can modify a map or slice you received as an argument if you store a reference to it. Similarly, be wary of user modifications to maps or slices exposing internal state." This could be used as an ad for Rust borrow checker, verbatim. You can't modify…

Yes, that's not good, but it seems like in practice this doesn't come up too often in Go?

More typically you're building a new slice containing the results of a query or other computation, and returning it without keeping a reference. Or instead of exposing an internal map, you have a Get method.

Re: Uber Go Style Guide

#27
post #22

Earlier quoted context omitted.

Uber have well over 1,500 microservices written in Go, it is the primary language backend services are written in at Uber.

> Uber have well over 1,500 microservices written in Go 1500 ?! I can't even imagine how micro a microservice could be such that Uber could have so many. edit: Having said that, the Monzo blog post also on the front page says it has 1100 microservices, so I suppose I've just not worked somewhere with 'actual' microservices. What constitutes a 'service', a single procedure for RPC?

I guess they suffer from "leftpad as service".

http://left-pad.io/

Re: Uber Go Style Guide

#28
post #21
post #4

"Copy Slices and Maps at Boundaries. Slices and maps contain pointers to the underlying data so be wary of scenarios when they need to be copied. Keep in mind that users can modify a map or slice you received as an argument if you store a reference to it. Similarly, be wary of user modifications to maps or slices exposing internal state." This could be used as an ad for Rust borrow checker, verbatim. You can't modify…

Cannot wait for "Uber Rust Style Guide".

You might be waiting a while, there are zero Rust repositories in their open source repertoire: https://github.com/uber

Re: Uber Go Style Guide

#29
post #22

Earlier quoted context omitted.

Uber have well over 1,500 microservices written in Go, it is the primary language backend services are written in at Uber.

> Uber have well over 1,500 microservices written in Go 1500 ?! I can't even imagine how micro a microservice could be such that Uber could have so many. edit: Having said that, the Monzo blog post also on the front page says it has 1100 microservices, so I suppose I've just not worked somewhere with 'actual' microservices. What constitutes a 'service', a single procedure for RPC?

The target is one microservice per syscall, maybe.

Re: Uber Go Style Guide

#30

Earlier quoted context omitted.

Uber have well over 1,500 microservices written in Go, it is the primary language backend services are written in at Uber.

1500 microservices? Are they exposing each function as a microservice or something? At which point could be having 1500 microservices a good thing? I honestly cannot think of one unless you have some massive design flaw or have a different definition for microservice.

I don't work at Uber, so I can't answer your questions around motivation, but I took the 1,500 value from this presentation at Gophercon this year: https://www.youtube.com/watch?v=nLskCRJOdxM&t=22m59s
Post reply on HN