Apcera Case Study: The selection of the Go language
1. + apcera
next generation cloud platform
A Case Study:
The Selection of Go at Apcera
Go Conference Japan
April 13, 2013
2. Quick About
Derek Collison
Designed and Built CloudFoundry Founded March 2012
Former Google, VMware, TIBCO San Francisco, CA
Distributed Systems Building Next Generation Cloud Platform
Founder of Apcera, Inc. Investors
Kleiner Perkins
@derekcollison
Andreesen Horowitz
derek@apcera.com True Ventures
Data Collective
@apcera
www.apcera.com
4. CloudFoundry
Built using Ruby
Ruby the “Good”
Great Language
Easy Development
Synchronous programming model
Ruby the “Not so Good”
Dependency Management
Deployment Issues
No builtin Eventing Model
Lacks good support for Concurrency
5. EventMachine
Eventing in Ruby
Asynchronous IO, Timers, etc.
EM + Fibers, CF process scalability model
Fragile
Complex
C++ code base, limited community support
Complex code base
Critical to process design patterns for CloudFoundry
Contributed to Dependency management issues
8. Apcera Choice Criteria
Good platform support (Linux, Windows, Mac, SmartOs)
Good dependency model, preferred builtin
Good support for Concurrency primitives
Good support for Large Scale Distributed Systems
Customer neutral
Not Java
Not .Net
10. Node.js
Good
V8 runtime from Google
Evented system by design
Javascript based
All programmers will know Javascript.
Not so Good
Runtime Dependency
Based on Javascript
Function scoping
Callback Spaghetti
Dependency via external NPM (NPM is good)
11. Go
Good
Designed by amazing team: Rob Pike, Ken Thompson, Robert Griesemer
Synchronous programming model
Concurrency is a first class citizen
Static executables - No dependencies (Except ARCH)
Google Goodies - Builtin Testing, Docs, Benchmarks, Flags, etc.
Good platform support
Not so Good
New Language
New Standard Libraries
Immature GC and Scheduler
Google starting to kill off projects, would Go be on that list?
14. Go Deeper
Go Routines and Channels
Well thought out concurrency primitives, based on variant of CSP.
Can take advantage of Multi-Core (GOMAXPROCS)
Statically Typed, compiled language
Inference
Interfaces - Again well thought out design
Compiles fast
Easy to learn - Don’t need a large talent pool
Decent Standard Library - IO, FS, Network, HTTP, Json
GC, but Go has real STACKS!
15. Why I Would Choose Go?
Stacks
This is a big deal
Relieves pressure from the GC
Gives back power to the developer
I spent 3+ months designing this in C in the 90s
Go also allows interior pointers in structs to also relieve pressure
Statically linked executables
Deployment is “scp binary <target>”
Easy to learn
Scale teams with Java, C++, Ruby or Python experience
Small Standard library, also easy to pick up in a week or so
16. Go Stacks?
Why should you really care?
Relieves pressure on GC
Performance
Stability - GC pauses
Move from GC to stack easily, no GC hit
Yet, can auto-promote
What do you mean?
19. Not all Roses
Import model lacks support for versioning
import “github.com/apcera/nats” - Which version do you get?
We test for version constraints in pkg that imports
Crypto is not production ready
Proclaimed by a Go developer
We built our own high performance mappings to OpenSSL
Static executables break when linking
Being Fixed in 1.1 I believe
String <-> Byte causes copies
Garbage Collector and Scheduler still young.
20. Not all Roses - Cont’d
Logging library
We wrote our own - Designed by former Twitter Ops team member
SQL
Lack of error promotion and error handling
Designed our own Enterprise grade ORM + drivers
HTTP Server
I think everyone has written their own by now
Maps are slow
Being fixed in 1.1 I believe
We wrote our own high performance ones for Go NATS server
25. Go Summary
Great Systems language from Google
Concurrency is first class citizen
Testing, Docs, Benchmarks are builtin
Standard library is fairly complete and good enough
Easy to Learn - Go to www.golang.org
Static Executables
Stacks - You will thank me later.
And Most Important
Great velocity as Go moves from 1.0 -> 1.1 and beyond