Apcera Case Study: The selection of the Go language

28
A Case Study: The Selection of Go at Apcera apcera next generation cloud platform + Go Conference Japan April 13, 2013

description

This is from a presentation at GoCon Japan on April 13th, 2013.

Transcript of Apcera Case Study: The selection of the Go language

Page 1: Apcera Case Study: The selection of the Go language

A Case Study:The Selection of Go at Apcera

apceranext generation cloud platform

+

Go Conference JapanApril 13, 2013

Page 2: Apcera Case Study: The selection of the Go language

Designed and Built CloudFoundryFormer Google, VMware, TIBCODistributed SystemsFounder of Apcera, Inc.@[email protected]

Derek Collison

Quick About

Founded March 2012San Francisco, CABuilding Next Generation Cloud PlatformInvestors

Kleiner PerkinsAndreesen HorowitzTrue VenturesData Collective

@apcerawww.apcera.com

Page 3: Apcera Case Study: The selection of the Go language

How did we get here?

Page 4: Apcera Case Study: The selection of the Go language

Built using RubyRuby the “Good”

Great LanguageEasy DevelopmentSynchronous programming model

Ruby the “Not so Good”Dependency ManagementDeployment IssuesNo builtin Eventing ModelLacks good support for Concurrency

CloudFoundry

Page 5: Apcera Case Study: The selection of the Go language

Eventing in RubyAsynchronous IO, Timers, etc.EM + Fibers, CF process scalability model

FragileComplex

C++ code base, limited community supportComplex code baseCritical to process design patterns for CloudFoundryContributed to Dependency management issues

EventMachine

Page 6: Apcera Case Study: The selection of the Go language

I still <3 Ruby

Page 7: Apcera Case Study: The selection of the Go language

Choices for Apcera?

Page 8: Apcera Case Study: The selection of the Go language

Good platform support (Linux, Windows, Mac, SmartOs)Good dependency model, preferred builtinGood support for Concurrency primitivesGood support for Large Scale Distributed SystemsCustomer neutral

Not JavaNot .Net

Apcera Choice Criteria

Page 9: Apcera Case Study: The selection of the Go language

Go vs Node.js

Page 10: Apcera Case Study: The selection of the Go language

GoodV8 runtime from GoogleEvented system by designJavascript based

All programmers will know Javascript.

Not so GoodRuntime DependencyBased on Javascript

Function scopingCallback Spaghetti

Dependency via external NPM (NPM is good)

Node.js

Page 11: Apcera Case Study: The selection of the Go language

GoodDesigned by amazing team: Rob Pike, Ken Thompson, Robert GriesemerSynchronous programming modelConcurrency is a first class citizenStatic executables - No dependencies (Except ARCH)Google Goodies - Builtin Testing, Docs, Benchmarks, Flags, etc.Good platform support

Not so GoodNew LanguageNew Standard LibrariesImmature GC and SchedulerGoogle starting to kill off projects, would Go be on that list?

Go

Page 12: Apcera Case Study: The selection of the Go language

Team selected Go in 15 minutes

Page 13: Apcera Case Study: The selection of the Go language

Never once questioned decision

Page 14: Apcera Case Study: The selection of the Go language

Go Routines and ChannelsWell thought out concurrency primitives, based on variant of CSP.Can take advantage of Multi-Core (GOMAXPROCS)

Statically Typed, compiled languageInferenceInterfaces - Again well thought out designCompiles fast

Easy to learn - Don’t need a large talent poolDecent Standard Library - IO, FS, Network, HTTP, JsonGC, but Go has real STACKS!

Go Deeper

Page 15: Apcera Case Study: The selection of the Go language

StacksThis is a big dealRelieves pressure from the GCGives back power to the developerI spent 3+ months designing this in C in the 90sGo also allows interior pointers in structs to also relieve pressure

Statically linked executablesDeployment is “scp binary <target>”

Easy to learnScale teams with Java, C++, Ruby or Python experienceSmall Standard library, also easy to pick up in a week or so

Why I Would Choose Go?

Page 16: Apcera Case Study: The selection of the Go language

Why should you really care?Relieves pressure on GC

PerformanceStability - GC pauses

Move from GC to stack easily, no GC hitYet, can auto-promote

What do you mean?

Go Stacks?

Page 17: Apcera Case Study: The selection of the Go language

My First Go Program

Page 18: Apcera Case Study: The selection of the Go language

Not all Roses, there are issues

Page 19: Apcera Case Study: The selection of the Go language

Import model lacks support for versioningimport “github.com/apcera/nats” - Which version do you get?We test for version constraints in pkg that imports

Crypto is not production readyProclaimed by a Go developerWe built our own high performance mappings to OpenSSL

Static executables break when linkingBeing Fixed in 1.1 I believe

String <-> Byte causes copiesGarbage Collector and Scheduler still young.

Not all Roses

Page 20: Apcera Case Study: The selection of the Go language

Logging libraryWe wrote our own - Designed by former Twitter Ops team member

SQLLack of error promotion and error handlingDesigned our own Enterprise grade ORM + drivers

HTTP ServerI think everyone has written their own by now

Maps are slowBeing fixed in 1.1 I believeWe wrote our own high performance ones for Go NATS server

Not all Roses - Cont’d

Page 21: Apcera Case Study: The selection of the Go language

There are more.. BUT..

Page 22: Apcera Case Study: The selection of the Go language

Go was right choice for Apcera

Page 23: Apcera Case Study: The selection of the Go language

More will make same decision!

Page 24: Apcera Case Study: The selection of the Go language
Page 25: Apcera Case Study: The selection of the Go language

Great Systems language from Google Concurrency is first class citizenTesting, Docs, Benchmarks are builtinStandard library is fairly complete and good enoughEasy to Learn - Go to www.golang.orgStatic ExecutablesStacks - You will thank me later.And Most Important

Great velocity as Go moves from 1.0 -> 1.1 and beyond

Go Summary

Page 26: Apcera Case Study: The selection of the Go language

Thank You!ありがとう

Page 27: Apcera Case Study: The selection of the Go language

Questions?