Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Go Features and Case Studies
Search
Ian Lewis
April 21, 2015
Technology
0
150
Go Features and Case Studies
Ian Lewis
April 21, 2015
Tweet
Share
More Decks by Ian Lewis
See All by Ian Lewis
Kubernetes Security Best Practices
ianlewis
38
26k
The Enemy Within: Running untrusted code in Kubernetes
ianlewis
0
1.2k
The Enemy Within: Running untrusted code with gVisor
ianlewis
4
1.1k
KubeCon EU Runtime Track Recap
ianlewis
3
1.6k
コンテナによるNoOpsオートメーション
ianlewis
2
140
Google Kubernetes Engine 概要 & アップデート @ GCPUG Kansai Summit Day 2018
ianlewis
2
880
Extending Kubernetes with Custom Resources and Operator Frameworks
ianlewis
10
3.7k
Kubernetesのセキュリティのベストプラクティス
ianlewis
12
17k
Scheduling and Resource Management in Kubernetes
ianlewis
2
1.4k
Other Decks in Technology
See All in Technology
複雑なState管理からの脱却
sansantech
PRO
1
140
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
750
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
250
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
Platform Engineering for Software Developers and Architects
syntasso
1
520
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
ハイパーパラメータチューニングって何をしているの
toridori_dev
0
140
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
Terraform Stacks入門 #HashiTalks
msato
0
350
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
It's Worth the Effort
3n
183
27k
Producing Creativity
orderedlist
PRO
341
39k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Designing the Hi-DPI Web
ddemaree
280
34k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Scaling GitHub
holman
458
140k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Transcript
Go言語の可能性と開発事例 QCon Tokyo 2015
Ian Lewis Developer Advocate Google Cloud Platform google.com/+IanLewis-hoge @IanMLewis
Go! Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. Go(lang)
• Developed at Google • Created to address problems: ◦ Speed of Software Development ◦ Cumbersome Type Systems ◦ Multiple Cores/Concurrency
Features Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. Features
• Compiles to static binary native code • Garbage collector • Strongly typed (types inferred) • Goroutines • Channels • Structs/Interfaces
Static Binary
Image © Renée French. Licensed under CC BY 3.0. Static
Binary • All Code Needed is Bundled • Avoids Problems with Linking at Runtime • Allows for *very* simple deployment
Garbage Collection Image © Takuya Ueda. Licensed under CC BY
3.0.
Image © Renée French. Licensed under CC BY 3.0. Garbage
Collection • Mark and Sweep in 1.1 • Concurrent Mark and Sweep • Hybrid Mark and Sweep/Concurrent in 1.4 • Concurrent Garbage Collector in 1.5
Type Inference Image © Takuya Ueda. Licensed under CC BY
3.0.
Image © Renée French. Licensed under CC BY 3.0. Type
Inference int hoge = 123; // NO!! int fuga = MyFunc(); hoge := 123; // GOOD!! fuga := MyFunc();
Goroutines Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. Goroutines
• Concurrent Function • Light Weight Process • Runs on Multiple Cores • Easy to Write
Image © Renée French. Licensed under CC BY 3.0. Goroutines
func MyFunc() { resp, err := http.Get("http://google.com/") } go MyFunc() // Concurrent!!!
Image © Renée French. Licensed under CC BY 3.0. Goroutines
func main() { go MyFunc() // NONO!! // Program will exit to early }
Channels Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. Channels
• Like a Queue • Used to Communicate Between Goroutines • Allows for Blocking Operations
Image © Renée French. Licensed under CC BY 3.0. Channels
func MyFunc(done chan int) { resp, err := http.Get("http://google.com/") done <- 1 }
Image © Renée French. Licensed under CC BY 3.0. Channels
func main() { done := make(chan int) go MyFunc(done) <-done // GOOD!!! }
Interfaces Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. Interfaces
type Writer interface { Write(p []byte) (n int, err error) }
Image © Renée French. Licensed under CC BY 3.0. Interfaces
type MyWriter struct {} func (w MyWriter) Write(p []byte) (n int, e error) { ... }
Examples Image © Takuya Ueda. Licensed under CC BY 3.0.
Vitess Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. Vitess
• Used at Youtube • Sharding MySQL Servers • Serving all YouTube DB traffic since 2011 • http://vitess.io/
Image © Renée French. Licensed under CC BY 3.0.
Image © 2015 Google. Licensed under CC BY 4.0.
Docker Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. Docker
• Container Engine • Includes HTTP API Server • Provides Image Packaging Format
Image © Renée French. Licensed under CC BY 3.0.
CoreOS Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. etcd
• Distributed Key-Value Store • Used for Storing Cluster State/Config • Implements RAFT Protocol
Image © Renée French. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. rocket
• Container Runner • Supports Docker Containers • Supports Pods
Image © Renée French. Licensed under CC BY 3.0.
Kubernetes Image © Takuya Ueda. Licensed under CC BY 3.0.
Image © Renée French. Licensed under CC BY 3.0. Kubernetes
• Container Cluster Manager • Manages a Distributed Cluster • Supports Pods • Provides HTTP API
Image © Renée French. Licensed under CC BY 3.0.
Join Us! Image © Takuya Ueda. Licensed under CC BY
3.0.
None
Image © Renée French. Licensed under CC BY 3.0. GoCon
2015 Summer • Biggest Go Event in Japan!! • 2015/06/20 (Sat) • Registration starts 2015/05/01
http://gocon.connpass.com/
Thank You! QCon Tokyo 2015 Ian Lewis Developer Advocate Google
Cloud Platform google.com/+IanLewis-hoge @IanMLewis