SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
Go at Uber
Prashant Varanasi, Senior Engineer, RPC
April 26, 2016
● Previously at Google — my first production experience with Go
● At Uber, I work on the RPC team
○ Support the Go client library for TChannel, our open source RPC framework
○ Building out the new fleetwide routing and load balancing sidecar
● One of the core reviewers for internal Go libraries
● Maintainer of the internal Go build infrastructure, go-build
About me
Java-free for 2 years
● Traditionally used Python and Node.js
○ Node.js is popular in our marketplace
and dispatch services
○ Python is popular for business logic
as well as data analysis
● Almost all the business logic was
behind a monolithic Python API server
About Uber
From a large monolithic service...
The Uber Monolith
Users
Products
Background
Checks
Trips
Cities
Vehicles
Payments
Documents
Promos
● As Uber grew (in features and
engineers), continuous integration
turned into a liability as deploying the
codebase meant deploying everything
● We followed the lead of other hyper-
growth companies (i.e., Twitter, Netflix)
and broke up the monolith into many
microservices.
● This allowed more flexibility in
languages
About Uber
...to over one thousand microservices
Users
ProductsTrips
Cities
Communication
between services
uses HTTP/JSON or
TChannel/Thrift
● In 2014, Aiden Scandella, one of our early
engineers, experimented with Go
○ Deployed a sandbox marketplace for the Uber
External API
● By early 2015, Go was used across the
company,
○ Data Engineering: A cross-cluster query cache
○ Marketplace: The Geofences service
● Go was selected for the following characteristics:
○ Simple language, high developer productivity
○ Strong concurrency and parallelism built in
Introduction of Go
Cross-language microservices
Building up the ecosystem
● No standardized support for Go (build, lint, coverage) in our internal
infrastructure
○ Custom Makefiles integrated with go-junit-report and gocov
● Dependency management, used godep
○ Builds passed locally but not on build machines due to missing deps
○ Vendored dependencies hard to manage and review
● Lack of libraries for internal infrastructure
○ E.g., Kafka logging, dynamic configuration, background tasks
Making Go a first-class citizen
go-buildOld Way
Build Infrastructure
From copy+pasted Makefiles and shell scripts to a common submodule
● Before the GO15VENDOREXPERIMENT, we started with godep
○ Vendored dependencies in every repo
○ Even internal dependencies were vendored as godep restore was flaky
○ Noisy code reviews, hard to update dependencies,
● The glide migration
○ Users can choose to check in their dependencies in the vendor folder
○ Or check in glide.yaml and glide.lock and have dependencies
installed before build
○ Use an internal Github mirror to avoid outages affecting internal builds
Dependency Management
From godep to glide
● Base libraries used by almost all services: config, metrics, logging, tracing,
RPC
● Utility and extension libraries:
○ Transport helpers, JSON + HTTP, TChannel + Thrift
○ Backoff, LRU cache, flags, worker pools
● Libraries for internal infrastructure built up over time
○ Storage (schemaless -- internal key-value store built on MySQL)
○ Translations, AVRO-encoded logging, dynamic config, experiments
Libraries for internal infrastructure
Monorepo of Go libraries
● Now have over a hundred services written in Go
● Two years of production experience
○ Integrated runtime metrics (#goroutines, GC stats)
○ Easy profiling of services running in production
○ Investigated and fixed file descriptor leaks in open
source libraries
○ Even found a compiler bug that led to stack corruption
● Strong library and infrastructure support
● Lots of resources: documentation, classes, mailing list
● Now the recommended language for new services
Experience with Go
Writing code is fun again
What’s built in Go?
Goal: given a lat/lng pair, find the list of geofences this location falls in
● HTTP/JSON interface
● High throughput, low latency (P99 < 100ms)
● No infrastructure support, so project handled everything:
○ Config: Used the standard “encoding/json” package
○ Logging: wrapped the standard “log” package, and reported errors to
Sentry
○ Metrics: Wrapped open source StatsD client
Blog Post
Geofences
One of the earliest Go services at Uber
Goal: match riders to drivers, sharding the matching across machines
● Ringpop for sharding the matching by location
● TChannel / Thrift for RPC interface
● Uses our internal libraries for:
○ Config (both static, and dynamic configuration)
○ Logging (includes logging to disk, Kafka, and Sentry)
○ Metrics (reported to M3, our internal Metrics infrastructure)
● Much more infrastructure support for Go services
Geobase
One of the more recent Go services at Uber
● Embeddable application level sharding:
○ Fault detection: provides membership list of alive
nodes using a variation of SWIM (similar to Serf)
○ Consistent hashing: keys are hashed to a node,
and failures will not create load imbalances or
redistribute every key
○ Forwarding: provides forward of HTTP or
TChannel requests
● Used for sharding work, sharded cache, serializing
requests to a resource (in-order)
Ringpop
Scalable, fault-tolerant application-layer sharding. Open source!
● Strong forwarding performance, as it was built for Ringpop forwarding
● Built on top of TCP, provides multiplexing and framing
○ Supports out of order responses, no head of line blocking
○ Very simple protocol, easy to implement in multiple languages
● Provides high-level RPC features:
○ Timeouts, consistent retry semantics
○ Connection management and smart peer selection
● Integrates with Thrift as a first-class citizen
TChannel
Intra-datacenter RPC protocol. Open source, available for Go, Java, Node, and Python
● Strong integration with Thrift
○ Uses net/context
○ Integrates with error values
val, err := client.Get(ctx, key)
if err != nil {
switch err := err.(type) {
case *keyvalue.KeyNotFound:
// Handle Thrift exception
default:
// Unknown error
}
}
TChannel + Thrift
Intra-datacenter RPC protocol. Open source, available for Go, Java, Node, and Python
● Often used internally with Python and Node.js
● Uses pprof output to generate the flamegraph
go-torch
Visualization of profiling output. Open source!
● Powers the majority of high QPS services at Uber
● Already the most popular language for new services
● Open source our core libraries and tools
■ TChannel, Ringpop, go-torch, yab (beta), zap (beta)
■ Working with open source community on opentracing
● Check out our engineering blog and Github page for more information
Go at Uber
Thanks

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming languageSlawomir Dorzak
 
Présentation Git & GitHub
Présentation Git & GitHubPrésentation Git & GitHub
Présentation Git & GitHubThibault Vlacich
 
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみるいまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる裕士 常田
 
Introduction to redis - version 2
Introduction to redis - version 2Introduction to redis - version 2
Introduction to redis - version 2Dvir Volk
 
「とても小さいVim」vim tiny
「とても小さいVim」vim tiny「とても小さいVim」vim tiny
「とても小さいVim」vim tinygu4
 
IPC in Microkernel Systems, Capabilities
IPC in Microkernel Systems, CapabilitiesIPC in Microkernel Systems, Capabilities
IPC in Microkernel Systems, CapabilitiesMartin Děcký
 
Odoo - Office 365 Integration
Odoo - Office 365 IntegrationOdoo - Office 365 Integration
Odoo - Office 365 IntegrationEr. Jay Vora
 
Formation autour de git et git lab
Formation autour de git et git labFormation autour de git et git lab
Formation autour de git et git labAbdelghani Azri
 
Using eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumUsing eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumScyllaDB
 
Go MobileでAndroidアプリ開発
Go MobileでAndroidアプリ開発Go MobileでAndroidアプリ開発
Go MobileでAndroidアプリ開発Takuya Ueda
 
低レイヤー入門
低レイヤー入門低レイヤー入門
低レイヤー入門demuyan
 
Linux network stack
Linux network stackLinux network stack
Linux network stackTakuya ASADA
 
Scaling Django with gevent
Scaling Django with geventScaling Django with gevent
Scaling Django with geventMahendra M
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSPMin-Yih Hsu
 
.NET Framework で ​C# 8って使える? ​YESとNO!
.NET Framework で ​C# 8って使える? ​YESとNO!.NET Framework で ​C# 8って使える? ​YESとNO!
.NET Framework で ​C# 8って使える? ​YESとNO!Joni
 
Foster - Getting started with Angular
Foster - Getting started with AngularFoster - Getting started with Angular
Foster - Getting started with AngularMukundSonaiya1
 
UnboundとNSDの紹介 BIND9との比較編
UnboundとNSDの紹介 BIND9との比較編UnboundとNSDの紹介 BIND9との比較編
UnboundとNSDの紹介 BIND9との比較編hdais
 

Was ist angesagt? (20)

Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming language
 
Présentation Git & GitHub
Présentation Git & GitHubPrésentation Git & GitHub
Présentation Git & GitHub
 
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみるいまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
いまどきの組込みOSの​ ZephyrRTOSと​ OpenThreadを​ Arduino環境で遊んでみる
 
gRPC Overview
gRPC OverviewgRPC Overview
gRPC Overview
 
Introduction to redis - version 2
Introduction to redis - version 2Introduction to redis - version 2
Introduction to redis - version 2
 
「とても小さいVim」vim tiny
「とても小さいVim」vim tiny「とても小さいVim」vim tiny
「とても小さいVim」vim tiny
 
IPC in Microkernel Systems, Capabilities
IPC in Microkernel Systems, CapabilitiesIPC in Microkernel Systems, Capabilities
IPC in Microkernel Systems, Capabilities
 
Odoo - Office 365 Integration
Odoo - Office 365 IntegrationOdoo - Office 365 Integration
Odoo - Office 365 Integration
 
Formation autour de git et git lab
Formation autour de git et git labFormation autour de git et git lab
Formation autour de git et git lab
 
Using eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumUsing eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in Cilium
 
Go MobileでAndroidアプリ開発
Go MobileでAndroidアプリ開発Go MobileでAndroidアプリ開発
Go MobileでAndroidアプリ開発
 
GraphQL入門
GraphQL入門GraphQL入門
GraphQL入門
 
低レイヤー入門
低レイヤー入門低レイヤー入門
低レイヤー入門
 
Linux network stack
Linux network stackLinux network stack
Linux network stack
 
Scaling Django with gevent
Scaling Django with geventScaling Django with gevent
Scaling Django with gevent
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
 
Ipc in linux
Ipc in linuxIpc in linux
Ipc in linux
 
.NET Framework で ​C# 8って使える? ​YESとNO!
.NET Framework で ​C# 8って使える? ​YESとNO!.NET Framework で ​C# 8って使える? ​YESとNO!
.NET Framework で ​C# 8って使える? ​YESとNO!
 
Foster - Getting started with Angular
Foster - Getting started with AngularFoster - Getting started with Angular
Foster - Getting started with Angular
 
UnboundとNSDの紹介 BIND9との比較編
UnboundとNSDの紹介 BIND9との比較編UnboundとNSDの紹介 BIND9との比較編
UnboundとNSDの紹介 BIND9との比較編
 

Ähnlich wie Go at uber

The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)Oracle Developers
 
AirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadAirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadKarthik Murugesan
 
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa... Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...Databricks
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthNicolas Brousse
 
2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...
2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...
2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...Ambassador Labs
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureYshay Yaacobi
 
Docker build, test and deploy saa s applications
Docker  build, test and deploy saa s applicationsDocker  build, test and deploy saa s applications
Docker build, test and deploy saa s applicationswilliam_greenly
 
The Fn Project by Jesse Butler
 The Fn Project by Jesse Butler The Fn Project by Jesse Butler
The Fn Project by Jesse ButlerOracle Developers
 
Serverless Boston @ Oracle Meetup
Serverless Boston @ Oracle MeetupServerless Boston @ Oracle Meetup
Serverless Boston @ Oracle MeetupWayne Scarano
 
Modern VoIP in modern infrastructures
Modern VoIP in modern infrastructuresModern VoIP in modern infrastructures
Modern VoIP in modern infrastructuresGiacomo Vacca
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservicesRon Barabash
 
Free the Functions with Fn project!
Free the Functions with Fn project!Free the Functions with Fn project!
Free the Functions with Fn project!J On The Beach
 
Fighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless phpFighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless phpFabio Pellegrini
 
Visual, scalable, and manageable data loading to and from Neo4j with Apache Hop
Visual, scalable, and manageable data loading to and from Neo4j with Apache Hop Visual, scalable, and manageable data loading to and from Neo4j with Apache Hop
Visual, scalable, and manageable data loading to and from Neo4j with Apache Hop Neo4j
 
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedis Labs
 
#RADC4L16: An API-First Archives Approach at NPR
#RADC4L16: An API-First Archives Approach at NPR#RADC4L16: An API-First Archives Approach at NPR
#RADC4L16: An API-First Archives Approach at NPRCamille Salas
 
CNCF Singapore - Introduction to Envoy
CNCF Singapore - Introduction to EnvoyCNCF Singapore - Introduction to Envoy
CNCF Singapore - Introduction to EnvoyHarish
 
Geoscience and Microservices
Geoscience and Microservices Geoscience and Microservices
Geoscience and Microservices Matthew Gerring
 

Ähnlich wie Go at uber (20)

Cloud Native API Design and Management
Cloud Native API Design and ManagementCloud Native API Design and Management
Cloud Native API Design and Management
 
The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)
 
AirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadAirBNB's ML platform - BigHead
AirBNB's ML platform - BigHead
 
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa... Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
 
2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...
2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...
2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
 
Docker build, test and deploy saa s applications
Docker  build, test and deploy saa s applicationsDocker  build, test and deploy saa s applications
Docker build, test and deploy saa s applications
 
The Fn Project by Jesse Butler
 The Fn Project by Jesse Butler The Fn Project by Jesse Butler
The Fn Project by Jesse Butler
 
Serverless Boston @ Oracle Meetup
Serverless Boston @ Oracle MeetupServerless Boston @ Oracle Meetup
Serverless Boston @ Oracle Meetup
 
Dynomite @ RedisConf 2017
Dynomite @ RedisConf 2017Dynomite @ RedisConf 2017
Dynomite @ RedisConf 2017
 
Modern VoIP in modern infrastructures
Modern VoIP in modern infrastructuresModern VoIP in modern infrastructures
Modern VoIP in modern infrastructures
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservices
 
Free the Functions with Fn project!
Free the Functions with Fn project!Free the Functions with Fn project!
Free the Functions with Fn project!
 
Fighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless phpFighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless php
 
Visual, scalable, and manageable data loading to and from Neo4j with Apache Hop
Visual, scalable, and manageable data loading to and from Neo4j with Apache Hop Visual, scalable, and manageable data loading to and from Neo4j with Apache Hop
Visual, scalable, and manageable data loading to and from Neo4j with Apache Hop
 
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
 
#RADC4L16: An API-First Archives Approach at NPR
#RADC4L16: An API-First Archives Approach at NPR#RADC4L16: An API-First Archives Approach at NPR
#RADC4L16: An API-First Archives Approach at NPR
 
CNCF Singapore - Introduction to Envoy
CNCF Singapore - Introduction to EnvoyCNCF Singapore - Introduction to Envoy
CNCF Singapore - Introduction to Envoy
 
Geoscience and Microservices
Geoscience and Microservices Geoscience and Microservices
Geoscience and Microservices
 

Kürzlich hochgeladen

Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsDILIPKUMARMONDAL6
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESNarmatha D
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 

Kürzlich hochgeladen (20)

Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teams
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIES
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 

Go at uber

  • 1. Go at Uber Prashant Varanasi, Senior Engineer, RPC April 26, 2016
  • 2. ● Previously at Google — my first production experience with Go ● At Uber, I work on the RPC team ○ Support the Go client library for TChannel, our open source RPC framework ○ Building out the new fleetwide routing and load balancing sidecar ● One of the core reviewers for internal Go libraries ● Maintainer of the internal Go build infrastructure, go-build About me Java-free for 2 years
  • 3. ● Traditionally used Python and Node.js ○ Node.js is popular in our marketplace and dispatch services ○ Python is popular for business logic as well as data analysis ● Almost all the business logic was behind a monolithic Python API server About Uber From a large monolithic service... The Uber Monolith Users Products Background Checks Trips Cities Vehicles Payments Documents Promos
  • 4. ● As Uber grew (in features and engineers), continuous integration turned into a liability as deploying the codebase meant deploying everything ● We followed the lead of other hyper- growth companies (i.e., Twitter, Netflix) and broke up the monolith into many microservices. ● This allowed more flexibility in languages About Uber ...to over one thousand microservices Users ProductsTrips Cities Communication between services uses HTTP/JSON or TChannel/Thrift
  • 5. ● In 2014, Aiden Scandella, one of our early engineers, experimented with Go ○ Deployed a sandbox marketplace for the Uber External API ● By early 2015, Go was used across the company, ○ Data Engineering: A cross-cluster query cache ○ Marketplace: The Geofences service ● Go was selected for the following characteristics: ○ Simple language, high developer productivity ○ Strong concurrency and parallelism built in Introduction of Go Cross-language microservices
  • 6. Building up the ecosystem
  • 7. ● No standardized support for Go (build, lint, coverage) in our internal infrastructure ○ Custom Makefiles integrated with go-junit-report and gocov ● Dependency management, used godep ○ Builds passed locally but not on build machines due to missing deps ○ Vendored dependencies hard to manage and review ● Lack of libraries for internal infrastructure ○ E.g., Kafka logging, dynamic configuration, background tasks Making Go a first-class citizen
  • 8. go-buildOld Way Build Infrastructure From copy+pasted Makefiles and shell scripts to a common submodule
  • 9. ● Before the GO15VENDOREXPERIMENT, we started with godep ○ Vendored dependencies in every repo ○ Even internal dependencies were vendored as godep restore was flaky ○ Noisy code reviews, hard to update dependencies, ● The glide migration ○ Users can choose to check in their dependencies in the vendor folder ○ Or check in glide.yaml and glide.lock and have dependencies installed before build ○ Use an internal Github mirror to avoid outages affecting internal builds Dependency Management From godep to glide
  • 10. ● Base libraries used by almost all services: config, metrics, logging, tracing, RPC ● Utility and extension libraries: ○ Transport helpers, JSON + HTTP, TChannel + Thrift ○ Backoff, LRU cache, flags, worker pools ● Libraries for internal infrastructure built up over time ○ Storage (schemaless -- internal key-value store built on MySQL) ○ Translations, AVRO-encoded logging, dynamic config, experiments Libraries for internal infrastructure Monorepo of Go libraries
  • 11. ● Now have over a hundred services written in Go ● Two years of production experience ○ Integrated runtime metrics (#goroutines, GC stats) ○ Easy profiling of services running in production ○ Investigated and fixed file descriptor leaks in open source libraries ○ Even found a compiler bug that led to stack corruption ● Strong library and infrastructure support ● Lots of resources: documentation, classes, mailing list ● Now the recommended language for new services Experience with Go Writing code is fun again
  • 13. Goal: given a lat/lng pair, find the list of geofences this location falls in ● HTTP/JSON interface ● High throughput, low latency (P99 < 100ms) ● No infrastructure support, so project handled everything: ○ Config: Used the standard “encoding/json” package ○ Logging: wrapped the standard “log” package, and reported errors to Sentry ○ Metrics: Wrapped open source StatsD client Blog Post Geofences One of the earliest Go services at Uber
  • 14. Goal: match riders to drivers, sharding the matching across machines ● Ringpop for sharding the matching by location ● TChannel / Thrift for RPC interface ● Uses our internal libraries for: ○ Config (both static, and dynamic configuration) ○ Logging (includes logging to disk, Kafka, and Sentry) ○ Metrics (reported to M3, our internal Metrics infrastructure) ● Much more infrastructure support for Go services Geobase One of the more recent Go services at Uber
  • 15. ● Embeddable application level sharding: ○ Fault detection: provides membership list of alive nodes using a variation of SWIM (similar to Serf) ○ Consistent hashing: keys are hashed to a node, and failures will not create load imbalances or redistribute every key ○ Forwarding: provides forward of HTTP or TChannel requests ● Used for sharding work, sharded cache, serializing requests to a resource (in-order) Ringpop Scalable, fault-tolerant application-layer sharding. Open source!
  • 16. ● Strong forwarding performance, as it was built for Ringpop forwarding ● Built on top of TCP, provides multiplexing and framing ○ Supports out of order responses, no head of line blocking ○ Very simple protocol, easy to implement in multiple languages ● Provides high-level RPC features: ○ Timeouts, consistent retry semantics ○ Connection management and smart peer selection ● Integrates with Thrift as a first-class citizen TChannel Intra-datacenter RPC protocol. Open source, available for Go, Java, Node, and Python
  • 17. ● Strong integration with Thrift ○ Uses net/context ○ Integrates with error values val, err := client.Get(ctx, key) if err != nil { switch err := err.(type) { case *keyvalue.KeyNotFound: // Handle Thrift exception default: // Unknown error } } TChannel + Thrift Intra-datacenter RPC protocol. Open source, available for Go, Java, Node, and Python
  • 18. ● Often used internally with Python and Node.js ● Uses pprof output to generate the flamegraph go-torch Visualization of profiling output. Open source!
  • 19. ● Powers the majority of high QPS services at Uber ● Already the most popular language for new services ● Open source our core libraries and tools ■ TChannel, Ringpop, go-torch, yab (beta), zap (beta) ■ Working with open source community on opentracing ● Check out our engineering blog and Github page for more information Go at Uber