SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
Go @ Tokopedia Qasim Zaidi
About Tokopedia
• Launched in 2009
• 300K Active merchants
• 8 Million Products
• Indonesia’s biggest online marketplace
• Everyone pays shipping charges
• Shipping is a function of distance
• No discounting or cash-backs, neutral marketplace.
• Most payments are offline
nginx
ssl termination and
proxy pass
nginx-mod_perl
nginx-mod_perl
nginx-mod_perl
The Stack
postgres
mongo
redis
proxy_pass
What we already use go for
• Search & Discovery
• Image Uploads
• Analytics
60% of the time, it works every time.
nginx
ssl termination and
proxy pass
nginx-mod_perl
nginx-mod_perl
nginx-mod_perl
The Stack
postgres
mongo
redis
proxy_pass
mod_perl blocks nginx
isolation is hard
cancellation is harder
Challenges of scaling with mod_perl
• Each request is
synchronously
processed in a worker
• If there is one bad
request, it ends up
queuing everything else.
• Cancellation is not easy
- so even when the user
moves away, the request
continues to run.
In 2012, we bet on node.js
scaled well too - from 50K transactions in 2012 to over a million in 2015
node.js challenges
• Too easy to mess up (dynamic, no type checking)
• linting, code reviews
• Unbounded Concurrency is hard.
• async, promises
• Scale issues with http client for c10k
• even dns latencies can have big impact
Picking a new language in 2015.
the no QA philosophy
QA is not a different role.

Developers are responsible for
testing their code.
Testing in Go
• Easy to write unit tests
func TestFoo(t *testing.T) {
...
}
• run as go test
• No separate frameworks
• Benchmarking is as easy as testing
the no Documentation
philosophy
Code should be self explanatory.

Documentation outside of code is
never updated.
Documentation with GoDoc
• Comments in code - e.g.
preceding function definition
• It extracts the comments
and presents them:
• $ godoc strings Join



func Join(a []string, sep
string) string



Join concatenates the
elements of a to create a
single string. The separator
string sep is placed between
elements in the resulting
string.
// Join concatenates the elements of a to create
a single string.

// The separator string sep is placed between
elements in the resulting string.



func Join(a []string, sep string) string {

//self explanatory blah blah blah

//more of the same
}
godoc - examples and testing
func ExampleJoin() {
s := []string{"foo", "bar", "baz"}
fmt.Println(strings.Join(s, ", "))
// Output: foo, bar, baz
}
• Also integrated with the testing framework to provide testable
example functions.
godoc - webview
Concurrency should
be easy
And not yet forced. 

Too much concurrency spoils the
code.
Code should be hard
to mess with
A compiler that catches bugs

and is not too slow

statically compiled binaries - no
library mess
Institutional knowledge
Go brings google’s institutional
knowledge to you, for free

- Groupcache

- Expvars

- Single-flights and Cancellations
Object Caching
• In node.js - we built in an object caching solution in
house, that can easily make a function called cached
without changing much code.
• var wrapper = cache.wrap(original);
• Can chose whether to cache in memory or redis.
• Can avoid thundering herds - single flighting
Enter group cache
• In memory
• distributed
• single flight
ELB
app
groupcache
app app
groupcachegroupcache
http http
expvars - server metrics over http
• Export variables over http
• http://localhost:8123/debug/vars

{

"cmdline": ["/var/folders/bc/27hv15_d2zvcc3n3s9dxmfg00000gn/T/go-build421732654/command-
line-arguments/_obj/exe/main","-l","debug","-s","i.sock","-c","realtest"],

"counters": {"a": 10, "b": 10},

"memstats": {"Alloc":1076016,"TotalAlloc":1801544,"Sys":5966072,"Lookups":209,"Mallocs":
7986,"Frees":4528,"HeapAlloc":1076016,"HeapSys":2097152,"HeapIdle":327680,"HeapInuse":
1769472,"HeapReleased":0,"HeapObjects":3458,"StackInuse":212992,"StackSys":
917504,"MSpanInuse":21504,"MSpanSys":32768,"MCacheInuse":8800,"MCacheSys":
16384,"BuckHashSys":1441160,"GCSys":1183744,"OtherSys":277360,"NextGC":
1436032,"LastGC":1418102095002592201,"PauseTotalNs":2744531,"PauseNs":
[480149,171430,603839,288381,494934,522995,182803,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"NumGC":7,"EnableGC":true,"DebugGC":false}

}
Cancellations
• User moves away, nginx sends 499, but queries keep
running.
• Not Abandoning work when user has moved away is
often wasteful
• Go’s has advisory cancellations - cancel across go-
routines
• facilitated by contexts
moving from ‘dynamic’ to ‘compiled’
• Deployment changes
• from git clone to compile, build & deploy
• have a way of knowing binary version that is automatic
BUILDHASH=$(shell cd src/$(SRCDIR) && git rev-parse --verify HEAD | cut -c 1-7)

go build —ldflags -X $BUILDHASH
appname —version
• config and code is separate
• make sure everything you may ever need to configure is in config/flags, can’t change
binary
appname —port
appname —configtest
appname —debug
• have good debugging (we have debug() statements that are turned on by —debug flag)
The go workflow
jenkins
dpkg-
buildpackagetriggers build
build dpkg using go get
ansible
srv1 srv1 srv1
elb
nginx
binary, run via upstart
deploy dpkg
restart
2
1
triggers deploy
3
No templates, no exceptions, weird and sometimes inconsistent.
Go is an opinionated language
“Instructions, registers, and assembler
directives are always in UPPER CASE to
remind you that assembly programming is
a fraught endeavor.”
- Rob Pike
-Dick Gabriel, from the golang FAQ
Who would have guessed sophistication
bought such noise?
Golang - missing a package manager?
• go get - but its not complete
• No dependency management, unlike npm, no easy
hermetic builds
• gopkg.in is a solution - allows versioning
• if you have to change versions, edit every single import
Deployment Challenges
• No Fork() - forking with subroutines ain’t easy
• Facebook grace (https://github.com/facebookgo/grace)
• PID changes - no relationship
• problems with upstart / job monitor
• log rotation
Moving from a script to binary
• Deployment changes (from git clone to build, package and deploy)
• Need to know which version of code is running
• appname —version
• Need to debug easily
• appname —debug - enables debug() output
• Keep configuration flexible, because in case of issues, you can’t just edit and
deploy
• appname —configtest
• appname —port (over ride config)
Go @ Tokopedia
• Go is a modern language, very suitable for web.
• Go is Performant, unless you are doing C.
• Go is mostly google still, and not 100% complete.
• Go is opinionated, like Plan9, and there will be a learning
curve.
• Go is slower for prototyping, e.g. when compared to
node.js
Questions?

Contenu connexe

Tendances

Spring Framework Petclinic sample application
Spring Framework Petclinic sample applicationSpring Framework Petclinic sample application
Spring Framework Petclinic sample applicationAntoine Rey
 
HTTP Interceptors com AngularJS
HTTP Interceptors com AngularJSHTTP Interceptors com AngularJS
HTTP Interceptors com AngularJSRodrigo Branas
 
JavaScript Static Security Analysis made easy with JSPrime
JavaScript Static Security Analysis made easy with JSPrimeJavaScript Static Security Analysis made easy with JSPrime
JavaScript Static Security Analysis made easy with JSPrimeNishant Das Patnaik
 
[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How ToJi-Woong Choi
 
Construindo Diretivas com AngularJS
Construindo Diretivas com AngularJSConstruindo Diretivas com AngularJS
Construindo Diretivas com AngularJSRodrigo Branas
 
En route vers Java 21 - Javaday Paris 2023
En route vers Java 21 - Javaday Paris 2023En route vers Java 21 - Javaday Paris 2023
En route vers Java 21 - Javaday Paris 2023Jean-Michel Doudoux
 
우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구Jae Sung Park
 
Architecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker servicesArchitecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker servicesLINE Corporation
 
오픈소스를 활용한 Batch_처리_플랫폼_공유
오픈소스를 활용한 Batch_처리_플랫폼_공유오픈소스를 활용한 Batch_처리_플랫폼_공유
오픈소스를 활용한 Batch_처리_플랫폼_공유knight1128
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Peter R. Egli
 
Efficient Use of indexes in MySQL
Efficient Use of indexes in MySQLEfficient Use of indexes in MySQL
Efficient Use of indexes in MySQLAleksandr Kuzminsky
 
Javascript Prototype Visualized
Javascript Prototype VisualizedJavascript Prototype Visualized
Javascript Prototype Visualized军 沈
 

Tendances (20)

Spring Framework Petclinic sample application
Spring Framework Petclinic sample applicationSpring Framework Petclinic sample application
Spring Framework Petclinic sample application
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
HTTP Interceptors com AngularJS
HTTP Interceptors com AngularJSHTTP Interceptors com AngularJS
HTTP Interceptors com AngularJS
 
JavaScript Static Security Analysis made easy with JSPrime
JavaScript Static Security Analysis made easy with JSPrimeJavaScript Static Security Analysis made easy with JSPrime
JavaScript Static Security Analysis made easy with JSPrime
 
JSON in Solr: from top to bottom
JSON in Solr: from top to bottomJSON in Solr: from top to bottom
JSON in Solr: from top to bottom
 
[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To
 
Construindo Diretivas com AngularJS
Construindo Diretivas com AngularJSConstruindo Diretivas com AngularJS
Construindo Diretivas com AngularJS
 
En route vers Java 21 - Javaday Paris 2023
En route vers Java 21 - Javaday Paris 2023En route vers Java 21 - Javaday Paris 2023
En route vers Java 21 - Javaday Paris 2023
 
우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring boot
Spring bootSpring boot
Spring boot
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 
Cursors in MySQL
Cursors in MySQL Cursors in MySQL
Cursors in MySQL
 
JSON-LD and MongoDB
JSON-LD and MongoDBJSON-LD and MongoDB
JSON-LD and MongoDB
 
Architecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker servicesArchitecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker services
 
오픈소스를 활용한 Batch_처리_플랫폼_공유
오픈소스를 활용한 Batch_처리_플랫폼_공유오픈소스를 활용한 Batch_처리_플랫폼_공유
오픈소스를 활용한 Batch_처리_플랫폼_공유
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
 
Efficient Use of indexes in MySQL
Efficient Use of indexes in MySQLEfficient Use of indexes in MySQL
Efficient Use of indexes in MySQL
 
길병원 마케팅
길병원 마케팅길병원 마케팅
길병원 마케팅
 
Javascript Prototype Visualized
Javascript Prototype VisualizedJavascript Prototype Visualized
Javascript Prototype Visualized
 

En vedette

Tokopedia - How Tokopedia Became one of Indonesia’s Most Promising Startups
Tokopedia - How Tokopedia Became one of Indonesia’s Most Promising StartupsTokopedia - How Tokopedia Became one of Indonesia’s Most Promising Startups
Tokopedia - How Tokopedia Became one of Indonesia’s Most Promising Startupse27
 
Presentasi Tokopedia di Bancakan 2.0 3rd meetup
Presentasi Tokopedia di Bancakan 2.0 3rd meetupPresentasi Tokopedia di Bancakan 2.0 3rd meetup
Presentasi Tokopedia di Bancakan 2.0 3rd meetupFachry Bafadal
 
Kopi Chat with William Tanuwijaya founder of Tokopedia
Kopi Chat with William Tanuwijaya founder of TokopediaKopi Chat with William Tanuwijaya founder of Tokopedia
Kopi Chat with William Tanuwijaya founder of TokopediaBLOCK71 Singapore
 
Statistik 5th anniversary tokopedia di Ecommerce Indonesia
Statistik 5th anniversary tokopedia di Ecommerce IndonesiaStatistik 5th anniversary tokopedia di Ecommerce Indonesia
Statistik 5th anniversary tokopedia di Ecommerce Indonesiastartupbisnis
 
Amazon ppt
Amazon pptAmazon ppt
Amazon pptaftabssm
 
Amazon.com Strategic Analysis
Amazon.com Strategic AnalysisAmazon.com Strategic Analysis
Amazon.com Strategic AnalysisMax Jallifier
 
SISTIM INFORMASI MANAJEMEN BUKALAPAK.COM
SISTIM INFORMASI MANAJEMEN BUKALAPAK.COMSISTIM INFORMASI MANAJEMEN BUKALAPAK.COM
SISTIM INFORMASI MANAJEMEN BUKALAPAK.COMNiar Afriyani
 
500 Startups: Kopi Chat at @Blk71 Singapore
500 Startups: Kopi Chat at @Blk71 Singapore500 Startups: Kopi Chat at @Blk71 Singapore
500 Startups: Kopi Chat at @Blk71 SingaporeBLOCK71 Singapore
 
10 Langkah Strategis Membangun Toko Online Dengan Jejualan.com
10 Langkah Strategis Membangun Toko Online Dengan Jejualan.com10 Langkah Strategis Membangun Toko Online Dengan Jejualan.com
10 Langkah Strategis Membangun Toko Online Dengan Jejualan.comEko Prasetyo
 
LINE@ Blogger Success Tools & Guidelines
LINE@ Blogger Success Tools & GuidelinesLINE@ Blogger Success Tools & Guidelines
LINE@ Blogger Success Tools & GuidelinesFanny Verona
 
Tokopedia & Google Drive
Tokopedia & Google DriveTokopedia & Google Drive
Tokopedia & Google DriveRezaSanjaya98
 
Media Sosial & Perniagaan Mudah Alih 303 oleh Avana
Media Sosial & Perniagaan Mudah Alih 303 oleh AvanaMedia Sosial & Perniagaan Mudah Alih 303 oleh Avana
Media Sosial & Perniagaan Mudah Alih 303 oleh Avanasitecmy
 
Marketplace Site Begin To Dominate E-Commerce Marke tin Indonesia 2015
Marketplace Site Begin To Dominate E-Commerce Marke tin Indonesia 2015Marketplace Site Begin To Dominate E-Commerce Marke tin Indonesia 2015
Marketplace Site Begin To Dominate E-Commerce Marke tin Indonesia 2015MACROMILL SOUTH EAST ASIA, INC.
 
Liputan #KopdarRpx : SFS Cara Paling Murah dan Mudah Menambah Followers Insta...
Liputan #KopdarRpx : SFS Cara Paling Murah dan Mudah Menambah Followers Insta...Liputan #KopdarRpx : SFS Cara Paling Murah dan Mudah Menambah Followers Insta...
Liputan #KopdarRpx : SFS Cara Paling Murah dan Mudah Menambah Followers Insta...startupbisnis
 
LINE@ reward card manual
LINE@ reward card manualLINE@ reward card manual
LINE@ reward card manualFanny Verona
 
Apple Computers to Apple Inc
Apple Computers to Apple IncApple Computers to Apple Inc
Apple Computers to Apple IncQasim Zaidi
 

En vedette (19)

Tokopedia - How Tokopedia Became one of Indonesia’s Most Promising Startups
Tokopedia - How Tokopedia Became one of Indonesia’s Most Promising StartupsTokopedia - How Tokopedia Became one of Indonesia’s Most Promising Startups
Tokopedia - How Tokopedia Became one of Indonesia’s Most Promising Startups
 
Presentasi Tokopedia di Bancakan 2.0 3rd meetup
Presentasi Tokopedia di Bancakan 2.0 3rd meetupPresentasi Tokopedia di Bancakan 2.0 3rd meetup
Presentasi Tokopedia di Bancakan 2.0 3rd meetup
 
TOKOPEDIA
TOKOPEDIA TOKOPEDIA
TOKOPEDIA
 
Kopi Chat with William Tanuwijaya founder of Tokopedia
Kopi Chat with William Tanuwijaya founder of TokopediaKopi Chat with William Tanuwijaya founder of Tokopedia
Kopi Chat with William Tanuwijaya founder of Tokopedia
 
Cyber-security
Cyber-securityCyber-security
Cyber-security
 
Statistik 5th anniversary tokopedia di Ecommerce Indonesia
Statistik 5th anniversary tokopedia di Ecommerce IndonesiaStatistik 5th anniversary tokopedia di Ecommerce Indonesia
Statistik 5th anniversary tokopedia di Ecommerce Indonesia
 
Amazon ppt
Amazon pptAmazon ppt
Amazon ppt
 
Amazon.com Strategic Analysis
Amazon.com Strategic AnalysisAmazon.com Strategic Analysis
Amazon.com Strategic Analysis
 
SISTIM INFORMASI MANAJEMEN BUKALAPAK.COM
SISTIM INFORMASI MANAJEMEN BUKALAPAK.COMSISTIM INFORMASI MANAJEMEN BUKALAPAK.COM
SISTIM INFORMASI MANAJEMEN BUKALAPAK.COM
 
500 Startups: Kopi Chat at @Blk71 Singapore
500 Startups: Kopi Chat at @Blk71 Singapore500 Startups: Kopi Chat at @Blk71 Singapore
500 Startups: Kopi Chat at @Blk71 Singapore
 
10 Langkah Strategis Membangun Toko Online Dengan Jejualan.com
10 Langkah Strategis Membangun Toko Online Dengan Jejualan.com10 Langkah Strategis Membangun Toko Online Dengan Jejualan.com
10 Langkah Strategis Membangun Toko Online Dengan Jejualan.com
 
LINE@ Blogger Success Tools & Guidelines
LINE@ Blogger Success Tools & GuidelinesLINE@ Blogger Success Tools & Guidelines
LINE@ Blogger Success Tools & Guidelines
 
Tokopedia & Google Drive
Tokopedia & Google DriveTokopedia & Google Drive
Tokopedia & Google Drive
 
Antresol Pitch Deck
Antresol Pitch DeckAntresol Pitch Deck
Antresol Pitch Deck
 
Media Sosial & Perniagaan Mudah Alih 303 oleh Avana
Media Sosial & Perniagaan Mudah Alih 303 oleh AvanaMedia Sosial & Perniagaan Mudah Alih 303 oleh Avana
Media Sosial & Perniagaan Mudah Alih 303 oleh Avana
 
Marketplace Site Begin To Dominate E-Commerce Marke tin Indonesia 2015
Marketplace Site Begin To Dominate E-Commerce Marke tin Indonesia 2015Marketplace Site Begin To Dominate E-Commerce Marke tin Indonesia 2015
Marketplace Site Begin To Dominate E-Commerce Marke tin Indonesia 2015
 
Liputan #KopdarRpx : SFS Cara Paling Murah dan Mudah Menambah Followers Insta...
Liputan #KopdarRpx : SFS Cara Paling Murah dan Mudah Menambah Followers Insta...Liputan #KopdarRpx : SFS Cara Paling Murah dan Mudah Menambah Followers Insta...
Liputan #KopdarRpx : SFS Cara Paling Murah dan Mudah Menambah Followers Insta...
 
LINE@ reward card manual
LINE@ reward card manualLINE@ reward card manual
LINE@ reward card manual
 
Apple Computers to Apple Inc
Apple Computers to Apple IncApple Computers to Apple Inc
Apple Computers to Apple Inc
 

Similaire à Golang @ Tokopedia

Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overviewJesse Warden
 
How we realized SOA by Python at PyCon JP 2015
How we realized SOA by Python at PyCon JP 2015How we realized SOA by Python at PyCon JP 2015
How we realized SOA by Python at PyCon JP 2015hirokiky
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development PipelineIzzet Mustafaiev
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?Dmitri Shiryaev
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at ScaleKris Buytaert
 
Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Google AppEngine (GAE/J) - Introduction and Overview from a Java GuyGoogle AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Google AppEngine (GAE/J) - Introduction and Overview from a Java GuyMax Völkel
 
Django Deployment with Fabric
Django Deployment with FabricDjango Deployment with Fabric
Django Deployment with FabricJonas Nockert
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
Smarter deployments with octopus deploy
Smarter deployments with octopus deploySmarter deployments with octopus deploy
Smarter deployments with octopus deployThibaud Gravrand
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal infoSynapseindiappsdevelopment
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?hawkowl
 
Gophers Riding Elephants: Writing PostgreSQL tools in Go
Gophers Riding Elephants: Writing PostgreSQL tools in GoGophers Riding Elephants: Writing PostgreSQL tools in Go
Gophers Riding Elephants: Writing PostgreSQL tools in GoAJ Bahnken
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpAhmed Abdou
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKAJohan Edstrom
 
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodePipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodeKris Buytaert
 
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi   SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi Sencha
 
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonIneke Scheffers
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 

Similaire à Golang @ Tokopedia (20)

Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
How we realized SOA by Python at PyCon JP 2015
How we realized SOA by Python at PyCon JP 2015How we realized SOA by Python at PyCon JP 2015
How we realized SOA by Python at PyCon JP 2015
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development Pipeline
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Google AppEngine (GAE/J) - Introduction and Overview from a Java GuyGoogle AppEngine (GAE/J) - Introduction and Overview from a Java Guy
Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy
 
Django Deployment with Fabric
Django Deployment with FabricDjango Deployment with Fabric
Django Deployment with Fabric
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Smarter deployments with octopus deploy
Smarter deployments with octopus deploySmarter deployments with octopus deploy
Smarter deployments with octopus deploy
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?
 
Gophers Riding Elephants: Writing PostgreSQL tools in Go
Gophers Riding Elephants: Writing PostgreSQL tools in GoGophers Riding Elephants: Writing PostgreSQL tools in Go
Gophers Riding Elephants: Writing PostgreSQL tools in Go
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
 
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodePipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as Code
 
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi   SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
 
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomon
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 

Dernier

Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
SEO Growth Program-Digital optimization Specialist
SEO Growth Program-Digital optimization SpecialistSEO Growth Program-Digital optimization Specialist
SEO Growth Program-Digital optimization SpecialistKHM Anwar
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 

Dernier (20)

Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
SEO Growth Program-Digital optimization Specialist
SEO Growth Program-Digital optimization SpecialistSEO Growth Program-Digital optimization Specialist
SEO Growth Program-Digital optimization Specialist
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 

Golang @ Tokopedia

  • 1. Go @ Tokopedia Qasim Zaidi
  • 2. About Tokopedia • Launched in 2009 • 300K Active merchants • 8 Million Products • Indonesia’s biggest online marketplace • Everyone pays shipping charges • Shipping is a function of distance • No discounting or cash-backs, neutral marketplace. • Most payments are offline
  • 3. nginx ssl termination and proxy pass nginx-mod_perl nginx-mod_perl nginx-mod_perl The Stack postgres mongo redis proxy_pass
  • 4. What we already use go for • Search & Discovery • Image Uploads • Analytics
  • 5.
  • 6.
  • 7.
  • 8. 60% of the time, it works every time.
  • 9. nginx ssl termination and proxy pass nginx-mod_perl nginx-mod_perl nginx-mod_perl The Stack postgres mongo redis proxy_pass mod_perl blocks nginx isolation is hard cancellation is harder
  • 10. Challenges of scaling with mod_perl • Each request is synchronously processed in a worker • If there is one bad request, it ends up queuing everything else. • Cancellation is not easy - so even when the user moves away, the request continues to run.
  • 11.
  • 12.
  • 13. In 2012, we bet on node.js
  • 14. scaled well too - from 50K transactions in 2012 to over a million in 2015
  • 15. node.js challenges • Too easy to mess up (dynamic, no type checking) • linting, code reviews • Unbounded Concurrency is hard. • async, promises • Scale issues with http client for c10k • even dns latencies can have big impact
  • 16. Picking a new language in 2015.
  • 17. the no QA philosophy QA is not a different role. Developers are responsible for testing their code.
  • 18. Testing in Go • Easy to write unit tests func TestFoo(t *testing.T) { ... } • run as go test • No separate frameworks • Benchmarking is as easy as testing
  • 19. the no Documentation philosophy Code should be self explanatory. Documentation outside of code is never updated.
  • 20. Documentation with GoDoc • Comments in code - e.g. preceding function definition • It extracts the comments and presents them: • $ godoc strings Join
 
 func Join(a []string, sep string) string
 
 Join concatenates the elements of a to create a single string. The separator string sep is placed between elements in the resulting string. // Join concatenates the elements of a to create a single string.
 // The separator string sep is placed between elements in the resulting string.
 
 func Join(a []string, sep string) string {
 //self explanatory blah blah blah
 //more of the same }
  • 21. godoc - examples and testing func ExampleJoin() { s := []string{"foo", "bar", "baz"} fmt.Println(strings.Join(s, ", ")) // Output: foo, bar, baz } • Also integrated with the testing framework to provide testable example functions.
  • 23. Concurrency should be easy And not yet forced. Too much concurrency spoils the code.
  • 24. Code should be hard to mess with A compiler that catches bugs and is not too slow statically compiled binaries - no library mess
  • 25. Institutional knowledge Go brings google’s institutional knowledge to you, for free - Groupcache - Expvars - Single-flights and Cancellations
  • 26. Object Caching • In node.js - we built in an object caching solution in house, that can easily make a function called cached without changing much code. • var wrapper = cache.wrap(original); • Can chose whether to cache in memory or redis. • Can avoid thundering herds - single flighting
  • 27. Enter group cache • In memory • distributed • single flight ELB app groupcache app app groupcachegroupcache http http
  • 28. expvars - server metrics over http • Export variables over http • http://localhost:8123/debug/vars
 {
 "cmdline": ["/var/folders/bc/27hv15_d2zvcc3n3s9dxmfg00000gn/T/go-build421732654/command- line-arguments/_obj/exe/main","-l","debug","-s","i.sock","-c","realtest"],
 "counters": {"a": 10, "b": 10},
 "memstats": {"Alloc":1076016,"TotalAlloc":1801544,"Sys":5966072,"Lookups":209,"Mallocs": 7986,"Frees":4528,"HeapAlloc":1076016,"HeapSys":2097152,"HeapIdle":327680,"HeapInuse": 1769472,"HeapReleased":0,"HeapObjects":3458,"StackInuse":212992,"StackSys": 917504,"MSpanInuse":21504,"MSpanSys":32768,"MCacheInuse":8800,"MCacheSys": 16384,"BuckHashSys":1441160,"GCSys":1183744,"OtherSys":277360,"NextGC": 1436032,"LastGC":1418102095002592201,"PauseTotalNs":2744531,"PauseNs": [480149,171430,603839,288381,494934,522995,182803,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"NumGC":7,"EnableGC":true,"DebugGC":false}
 }
  • 29. Cancellations • User moves away, nginx sends 499, but queries keep running. • Not Abandoning work when user has moved away is often wasteful • Go’s has advisory cancellations - cancel across go- routines • facilitated by contexts
  • 30. moving from ‘dynamic’ to ‘compiled’ • Deployment changes • from git clone to compile, build & deploy • have a way of knowing binary version that is automatic BUILDHASH=$(shell cd src/$(SRCDIR) && git rev-parse --verify HEAD | cut -c 1-7)
 go build —ldflags -X $BUILDHASH appname —version • config and code is separate • make sure everything you may ever need to configure is in config/flags, can’t change binary appname —port appname —configtest appname —debug • have good debugging (we have debug() statements that are turned on by —debug flag)
  • 31. The go workflow jenkins dpkg- buildpackagetriggers build build dpkg using go get ansible srv1 srv1 srv1 elb nginx binary, run via upstart deploy dpkg restart 2 1 triggers deploy 3
  • 32. No templates, no exceptions, weird and sometimes inconsistent. Go is an opinionated language “Instructions, registers, and assembler directives are always in UPPER CASE to remind you that assembly programming is a fraught endeavor.” - Rob Pike
  • 33. -Dick Gabriel, from the golang FAQ Who would have guessed sophistication bought such noise?
  • 34. Golang - missing a package manager? • go get - but its not complete • No dependency management, unlike npm, no easy hermetic builds • gopkg.in is a solution - allows versioning • if you have to change versions, edit every single import
  • 35.
  • 36.
  • 37. Deployment Challenges • No Fork() - forking with subroutines ain’t easy • Facebook grace (https://github.com/facebookgo/grace) • PID changes - no relationship • problems with upstart / job monitor • log rotation
  • 38.
  • 39. Moving from a script to binary • Deployment changes (from git clone to build, package and deploy) • Need to know which version of code is running • appname —version • Need to debug easily • appname —debug - enables debug() output • Keep configuration flexible, because in case of issues, you can’t just edit and deploy • appname —configtest • appname —port (over ride config)
  • 40. Go @ Tokopedia • Go is a modern language, very suitable for web. • Go is Performant, unless you are doing C. • Go is mostly google still, and not 100% complete. • Go is opinionated, like Plan9, and there will be a learning curve. • Go is slower for prototyping, e.g. when compared to node.js