Go Go-Kit

一個架構不錯的 Go Lib

Goal

Goal: make Go a first-class citizen at the application layer

  • Border - HAProxy, nginx…
  • Appliecation - here
  • Data - Cassandra, PostgreSQL, Redis, Elasticsearch…

Goal: (micro) service architecture

Goal: RPC messaging pattern

Goal: operate in a mixed environment

Goal: pluggable transports

  • HTTP/JSON
  • Thrift
  • Protobuf
  • net/rpc
  • gRPC

Goal: strongly encourage best practices

Go kit 貢獻者具有 large-scale infrastructures 的經驗

所以沒有必要再犯同樣的錯誤

Non-goal:

Non-goal: require any specific infrastructure

Go kit 並無其他 相依基礎設施

我們可以在任何擴充的環境中運作良好

Non-goal: opinions about orchestration

Non-goal: opinions about configuration

Component

Service :

  • rate limit 在 入口 & 出口
    circuit break
    service discovering
Transport
Service metric
Service safety
Service connectivity
Go kit’s domain
Biz analytics
Biz metrics
Biz logic
Your domain

難得的經驗(hard-won lesson): 有結構的 log 是強制的

提供一些 circuit breaker 的實作

load balancer:

  • round robin
  • random
  • weighted
  • health checked

publisher 支援 DNS SRV,Consul etcd 計畫中

package tracing: zipkin

Blog

Go kit: Go in the modern enterprise

Vedio

Go and the Modern Enterprise - Peter Bourgon - London Go Gathering 2015
The Go Programming Language

Golang UK Conference 2015 - Peter Bourgon - Go Kit A Toolkit for Microservices
Golang UK Conference

GopherCon 2015: Peter Bourgon - Go Kit: A Standard Library for Distributed Programming