21
Gett & Golang Sergey Lanzman February 2016

Gett && Golang

Embed Size (px)

Citation preview

Page 1: Gett && Golang

Gett &Golang

Sergey LanzmanFebruary 2016

Page 2: Gett && Golang

About Gett

Page 3: Gett && Golang

Challenges

1. Scale

2. Stability

3. Time to Market

4. Big Data

5. Real Time data

Page 4: Gett && Golang

Tech stack

Page 5: Gett && Golang

Challenges

Page 6: Gett && Golang

Location service

Responsibility: maintain geographical location of drivers (with short history) + allow query.

Page 7: Gett && Golang

Location serviceHistory

1. Rails + MySQL

2. Node.js + MongoDB

3. Golang + MongoDB

4. Golang + Redis - MongoDB

Page 8: Gett && Golang

Location service

1. Rewrite from Node.js to Golang as is.

2. Add in-memory cacheand Redis.

3. Move geospatial from MongoDB to Golang code.

4. Additional modules: Amazon Kinesis integration and etc.

Page 9: Gett && Golang

Location serviceFirst implementation 1. Martini + mgo + redigo2. Hundreds of goroutines for async write.

web/martini

X 150-300

X 150-300

X 150-300

Page 10: Gett && Golang

Location service

web

Latest implementation1. Pat + negroni + redigo.

MessagePack

Page 11: Gett && Golang

Location serviceLast implementations1. Build Kd-trees Every second for geospatial

geo-module(KD-Tree) X4every 1 second

web

Page 12: Gett && Golang

Location serviceMonitoring tools1. StackDriver - only server metrics2. NewRelic - no official support, but there are plugins

(available). Now implement with CGO + agent SDK

Page 13: Gett && Golang

Location service

Page 14: Gett && Golang

Location service

Page 15: Gett && Golang

Location service

Page 16: Gett && Golang

Location serviceGenerating code + MessagePackhttps://github.com/tinylib/msgp

https://github.com/alecthomas/go_serialization_benchmarks

Page 17: Gett && Golang

Location serviceCode generate + MessagePackhttps://github.com/tinylib/msgp

Page 18: Gett && Golang

Location serviceDependencies:1. github.com/bmizerany/pat 2. github.com/codegangsta/negroni3. github.com/garyburd/redigo/redis4. github.com/gorilla/context5. github.com/manveru/faker6. github.com/remind101/newrelic7. github.com/spf13/viper8. github.com/tinylib/msgp/msgp9. gopkg.in/airbrake/gobrake.v210.github.com/facebookgo/grace/gracehttp11.github.com/sendgridlabs/go-kinesis12.github.com/go-lang-plugin-org/go-lang-idea-plugin

Page 19: Gett && Golang

Golang && GettDual stack

Page 20: Gett && Golang

Golang && GettOther services on golang

1. Relay metrics2. 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

Page 21: Gett && Golang

THANK YOU