What does Go offer?
Where go can be used?
Go in Production
Go in comparison to other language
TABLE OF CONTENTS
3. Go is a general-purpose programming language, like Python,
Java, or C
It is commonly referred to as golang.
A programming language developed at Google in 2007
Main contributor were Robert Griesemer, Rob Pike, and Ken
5. Go is relatively
easier to learn
Go language spec is webpage (http://golang.org/ref/spec )
that prints as a 56 page PDF compared to others
Java SE – 768 pages http://docs.oracle.com/javase/specs/
Scala – 183 pages http://www.scala-
Go documentation is better than other languages.
A SIMPLE LANGUAGE THAT IS EASY TO
LEARN AND READ.
6. Go combines ease of programming in an interpreted &
dynamically typed language.
Also it provides high efficiency and safety of a statically
typed, compiled language.
var intA int
intA = 32 // intA has 32 and is static type int
intB := 42 // intB has value 42 and dynamic type int
STATICALLY TYPED, BUT WITH A DYNAMIC
7. Like C and C++, Go compiles to native machine code so that
we don’t need environments such as CLR and JVM to run Go
Go compiler compiles programs very quickly that helps
particularly when compiling large applications
‘Gocc’ is a go compiler’s compiler
COMPILED TO NATIVE MACHINE CODE
8. Go is concurrent system
Concurrency is a way to structure a program by breaking it
into pieces that can be executed independently.
Concurrency vs. parallelism
Concurrency is about dealing with lots of things at once
Parallelism is about doing lots of things at once
Not the same, but related
Concurrency is about structure, parallelism is about execution
Concurrency provides a way to structure a solution to solve a
problem that may (but not necessarily) be parallelizable
GO SUPPORTS CONCURRENCY
9. In Go, concurrency is a first-class citizen in the core language
Go introduces Goroutines, which lets you run functions
You can communicate and pass values between Goroutines
Goroutines and Channels are great features of Go that let you
leverage concurrency and parallelism
LANGUAGE-LEVEL CONCURRENCY FEATURES
10. Go’s standard libraries are exemplary.
Go also provide 3rd party packages.
Go’s package management system is designed to work with
e.g. sharing it with developers overs GIT repository) unlike NPM,
EXPANSIVE STANDARD LIBRARY
11. Go provides lots of tools for managing documentation,
testing, package management, and more.
go doc : can be used to pull documentation for anything in
go test : This is one of the easiest testing setup
go get : This is used to pull the shared source code from GIT
15. Go produces statically linked binaries that are self sufficient.
Single binary makes deployment super-easy.
This is great when compared to other dependency setup that
is required for most other application.
16. Go has excellent support for cross compilation.
gonative is a simple tool which creates a build of Go that can
cross compile to all platforms. –
17. There is excellent support for
Live profiling capability for CPU
Lock contention etc
Read more at http://blog.golang.org/profiling-go-programs
Use go toolchain and profile the application on-demand.
Compilation Slow Slow NA Slow Fast
Efficiency Highest Moderate Slow Good Close to C++
GO IN COMPARISON TO OTHER LANGUAGE
19. BENCHMARKING ON JSON RESPONSE.
Nodejs 32.8% https://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=json
21. Ruby is a complex language
Memory consumption and speed
Lot of caching data in memory for speed, GC in Ruby consumed a lot
of time ultimately hindering performance.
The safest way to do concurrency in Ruby is through the use of
multiple processes, so app uses many workers and hence memory
FROM A RUBY MONOLITH TO MICROSERVICES
22. Instead of refactoring the entire application, moving selected
component to a micro services architecture in go increased
Main Application + Go Micro services boost application
23. N1QL pronounced as “nickel”.
N1QL is a query language developed in Go for Couchbase, a
distributed NoSQL database.
With N1QL scalable application can be developed quickly
N1QL: A QUERY LANGUAGE IN GO
25. Benchmarks show that Go compares favorably with C++ and
In C++, they had to experiment with a bunch of different
In Java, they had to fiddle around with a bunch of parameters
like the min heap size
Go worked well out of the box -
26. Extract dominant color from images.
Generate Insight based on product color
They were having high system usage.
Avg mem. consumption was more than 70%
PROCESSING IMAGES WITH GO
28. Serves more request
Server usage never exceeds more than 50-60%
Only golang standard library used -