Apcera Case Study: The selection of the Go language

Post on 06-May-2015

22.190 views 2 download

description

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

Transcript of 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

Designed and Built CloudFoundryFormer Google, VMware, TIBCODistributed SystemsFounder of Apcera, Inc.@derekcollisonderek@apcera.com

Derek Collison

Quick About

Founded March 2012San Francisco, CABuilding Next Generation Cloud PlatformInvestors

Kleiner PerkinsAndreesen HorowitzTrue VenturesData Collective

@apcerawww.apcera.com

How did we get here?

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

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

I still <3 Ruby

Choices for Apcera?

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

Go vs Node.js

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

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

Team selected Go in 15 minutes

Never once questioned decision

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

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?

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?

My First Go Program

Not all Roses, there are issues

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

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

There are more.. BUT..

Go was right choice for Apcera

More will make same decision!

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

Thank You!ありがとう

Questions?

apceranext generation cloud platform

www.apcera.cominfo@apcera.com