Gett &
Golang
Sergey Lanzman
February 2016
About Gett
Challenges
1. Scale
1. Stability
1. Time to Market
1. Big Data
1. Real Time data
Tech stack
Challenges
Location service
Responsibility: maintain
geographical location of
drivers (with short history) +
allow query.
Location service
History
1. Rails + MySQL
1. Node.js + MongoDB
1. Golang + MongoDB
1. Golang + Redis - MongoDB
Location service
1. Rewrite from Node.js
to Golang as is.
2. Add in-memory cache
and Redis.
3. Move geospatial from MongoDB to Golang code.
4. Additional modules: Amazon Kinesis integration and
etc.
Location service
First implementation
1. Martini + mgo + redigo
2. Hundreds of goroutines for async write.
web/martini
X 150-300
X 150-300
X 150-300
Location service
web
Latest implementation
1. Pat + negroni + redigo.
MessagePack
Location service
Last implementations
1. Build Kd-trees Every second for geospatial
geo-module(KD-Tree)
X4every 1 second
web
Location service
Monitoring tools
1. StackDriver - only server metrics
2. NewRelic - no official support, but there are plugins
(available). Now implement with CGO + agent SDK
Location service
Location service
Location service
Location service
Generating code + MessagePack
https://github.com/tinylib/msgp
https://github.com/alecthomas/go_serialization_benchmarks
Location service
Code generate + MessagePack
https://github.com/tinylib/msgp
Location service
Dependencies:
1. github.com/bmizerany/pat
2. github.com/codegangsta/negroni
3. github.com/garyburd/redigo/redis
4. github.com/gorilla/context
5. github.com/manveru/faker
6. github.com/remind101/newrelic
7. github.com/spf13/viper
8. github.com/tinylib/msgp/msgp
9. gopkg.in/airbrake/gobrake.v2
10.github.com/facebookgo/grace/gracehttp
11.github.com/sendgridlabs/go-kinesis
12.github.com/go-lang-plugin-org/go-lang-idea-plugin
Golang && Gett
Dual stack
Golang && Gett
Other services on golang
1. Relay metrics
2. Report service (dual stack)
3. Fleets service
4. Dispatching service (in development)
5. Billing (future)
6. API gateway (future)
More services move to dual stack
THANK YOU

Gett && Golang