Gett && Golang

Preview:

Citation preview

Gett &Golang

Sergey LanzmanFebruary 2016

About Gett

Challenges

1. Scale

2. Stability

3. Time to Market

4. Big Data

5. Real Time data

Tech stack

Challenges

Location service

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

Location serviceHistory

1. Rails + MySQL

2. Node.js + MongoDB

3. Golang + MongoDB

4. Golang + Redis - MongoDB

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.

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

web/martini

X 150-300

X 150-300

X 150-300

Location service

web

Latest implementation1. Pat + negroni + redigo.

MessagePack

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

geo-module(KD-Tree) X4every 1 second

web

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

(available). Now implement with CGO + agent SDK

Location service

Location service

Location service

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

https://github.com/alecthomas/go_serialization_benchmarks

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

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

Golang && GettDual stack

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

THANK YOU