SlideShare una empresa de Scribd logo
1 de 34
SCALING APPLICATIONS
WITH GO
-Vimlesh Sharma
 Introduction
 What does Go offer?
 Where go can be used?
 Go in Production
 Go in comparison to other language
 Case studies
TABLE OF CONTENTS
 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
Thompson.
INTRODUCTION
WHAT DOES GO OFFER ?
 Go is relatively
 compact language
 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-
lang.org/docu/files/ScalaReference.pdf
 Go documentation is better than other languages.
A SIMPLE LANGUAGE THAT IS EASY TO
LEARN AND READ.
 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
FEEL
 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
applications.
 Go compiler compiles programs very quickly that helps
particularly when compiling large applications
 ‘Gocc’ is a go compiler’s compiler
 https://code.google.com/p/gocc/
COMPILED TO NATIVE MACHINE CODE
 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
 In Go, concurrency is a first-class citizen in the core language
 Go introduces Goroutines, which lets you run functions
concurrently.
 You can communicate and pass values between Goroutines
using Channels.
 Goroutines and Channels are great features of Go that let you
leverage concurrency and parallelism
LANGUAGE-LEVEL CONCURRENCY FEATURES
 Go’s standard libraries are exemplary.
 Go also provide 3rd party packages.
 Go’s package management system is designed to work with
modern scenarios
 e.g. sharing it with developers overs GIT repository) unlike NPM,
NuGet, RubyGem
EXPANSIVE STANDARD LIBRARY
 Go provides lots of tools for managing documentation,
testing, package management, and more.
 go doc : can be used to pull documentation for anything in
codebase.
 go test : This is one of the easiest testing setup
 go get : This is used to pull the shared source code from GIT
GREAT TOOLS
WHERE CAN GO CAN BE
USED?
 Server application
 Command-line tools - https://github.com/codegangsta/cli
 Web applications
 Games - http://go-ngine.com/
 Scientific computing -
https://archive.fosdem.org/2014/schedule/event/hpc_devroo
m_go/
 Android & IOS development (in upcoming versions)
 Many More...
USAGE
USING GO IN
PRODUCTION
 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.
SINGLE BINARY
 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. –
http://github.com/inconshreveable/gonative
 http://dave.cheney.net/2013/07/09/an-introduction-to-cross-
compilation-with-go-1-1
CROSS COMPILATION
 There is excellent support for
 Live profiling capability for CPU
 Memory
 Goroutines
 OS threads
 Lock contention etc
 Read more at http://blog.golang.org/profiling-go-programs
 Use go toolchain and profile the application on-demand.
BUILT-IN PROFILING
C++ Java Javascript Scala Go
Type Safe
Garbage
Collection
Compilation Slow Slow NA Slow Fast
Concurrency
Ease of
Programming
Efficiency Highest Moderate Slow Good Close to C++
GO IN COMPARISON TO OTHER LANGUAGE
BENCHMARKING ON JSON RESPONSE.
Nodejs 32.8% https://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=json
CASE STUDY FROM
GOPHERCONINDIA 15
 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.
 Concurrency
 The safest way to do concurrency in Ruby is through the use of
multiple processes, so app uses many workers and hence memory
consumption.
FROM A RUBY MONOLITH TO MICROSERVICES
IN GO
 Instead of refactoring the entire application, moving selected
component to a micro services architecture in go increased
the efficiency.
 Main Application + Go Micro services boost application
performance.
 https://sourcegraph.com/blog/live/gopherconindia/1126565
68167
SOLUTION/OBSERVATION
 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
SIGNIFICANT LOWER DEVELOPMENT COST.
C++ 210 days Go 150 days C++ 400 bugs Go 250 bugs
 Benchmarks show that Go compares favorably with C++ and
Java
 In C++, they had to experiment with a bunch of different
libraries
 In Java, they had to fiddle around with a bunch of parameters
like the min heap size
 Go worked well out of the box -
https://sourcegraph.com/blog/live/gopherconindia/1116380
91937
SOLUTION/OBSERVATION
 Extract dominant color from images.
 Generate Insight based on product color
 Pain Point:
 They were having high system usage.
 Avg mem. consumption was more than 70%
PROCESSING IMAGES WITH GO
Existing architecture
Modified architecture
 Serves more request
 Server usage never exceeds more than 50-60%
 Easier deployment
 Only golang standard library used -
https://sourcegraph.com/blog/live/gopherconindia/1116486
97747
SOLUTION/OBSERVATION
EMBD
http://www.raspberrypi.org
 Requirement
 Static binary.
 Efficient Code.
 Zero latency(real time)
 Cross Platform
 Initial choice was Python (Dropped – Restricted library)
 EMBD a package entirely written in Go
 High Performance.
SOLUTION/OBSERVATION
https://sourcegraph.com/blog/live/gopherconindia/111626334627
LIST OF COMPANIES USING GO IN
PRODUCTION
 Golang’s 3 hours online jumpstart course
 http://tour.golang.org/welcome/1
 Testimonials
 https://sendgrid.com/blog/convince-company-go-golang/
 http://www.scriptrock.com/blog/our-experience-with-golang
 Further reading
 http://golang.org/doc/
 https://talks.golang.org/
 http://thenewstack.io/a-closer-look-at-golang-from-an-architects-
perspective/
QUICK LINKS
THANKS

Más contenido relacionado

La actualidad más candente

Introduction to go
Introduction to goIntroduction to go
Introduction to goAnthony Chow
 
What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? Shady Selim
 
When, how & why use golang in 2021 go benefits & use cases
When, how & why use golang in 2021  go benefits & use casesWhen, how & why use golang in 2021  go benefits & use cases
When, how & why use golang in 2021 go benefits & use casesKaty Slemon
 
Developing Cross Platform Applications with Golang
Developing Cross Platform Applications with GolangDeveloping Cross Platform Applications with Golang
Developing Cross Platform Applications with GolangErhan Yakut
 
Mobile DevOps pipeline using Google Flutter
Mobile DevOps pipeline using Google FlutterMobile DevOps pipeline using Google Flutter
Mobile DevOps pipeline using Google FlutterAhmed Abu Eldahab
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonDevathon
 
Null safety in dart and flutter , the whole story!
Null safety in dart and flutter , the whole story!Null safety in dart and flutter , the whole story!
Null safety in dart and flutter , the whole story!Ahmed Abu Eldahab
 
Building Beautiful Apps using Google Flutter
Building Beautiful Apps using Google FlutterBuilding Beautiful Apps using Google Flutter
Building Beautiful Apps using Google FlutterAhmed Abu Eldahab
 
The magic of Flutter - Amman ioextended 6-7-2019
The magic of Flutter - Amman ioextended 6-7-2019The magic of Flutter - Amman ioextended 6-7-2019
The magic of Flutter - Amman ioextended 6-7-2019Ahmed Abu Eldahab
 
Building beautiful apps using google flutter
Building beautiful apps using google flutterBuilding beautiful apps using google flutter
Building beautiful apps using google flutterAhmed Abu Eldahab
 
Mobile development with Flutter
Mobile development with FlutterMobile development with Flutter
Mobile development with FlutterAwok
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009Christopher Judd
 
Flutter not yet another mobile cross-platform framework - i ox-kl19
Flutter   not yet another mobile cross-platform framework - i ox-kl19Flutter   not yet another mobile cross-platform framework - i ox-kl19
Flutter not yet another mobile cross-platform framework - i ox-kl19oradoe
 
Flutter latest updates and features 2022
Flutter latest updates and features 2022Flutter latest updates and features 2022
Flutter latest updates and features 2022Ahmed Abu Eldahab
 
Google flutter the easy and practical way
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical wayAhmed Abu Eldahab
 
Mobile Devolpment Slides
Mobile Devolpment SlidesMobile Devolpment Slides
Mobile Devolpment SlidesLuke Angel
 
Feedback from an eclipse plugin developer to provide support to large set of ...
Feedback from an eclipse plugin developer to provide support to large set of ...Feedback from an eclipse plugin developer to provide support to large set of ...
Feedback from an eclipse plugin developer to provide support to large set of ...Aurélien Pupier
 
Why companies like Google, Alibaba and UOL choose Flutter
Why companies like Google, Alibaba and UOL choose FlutterWhy companies like Google, Alibaba and UOL choose Flutter
Why companies like Google, Alibaba and UOL choose FlutterGeison Goes
 
A good intro to Flutter and its magic
A good intro to Flutter and its magicA good intro to Flutter and its magic
A good intro to Flutter and its magicTarek Alabd
 

La actualidad más candente (20)

6 x1 flutter_talk
6 x1 flutter_talk6 x1 flutter_talk
6 x1 flutter_talk
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
 
What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How?
 
When, how & why use golang in 2021 go benefits & use cases
When, how & why use golang in 2021  go benefits & use casesWhen, how & why use golang in 2021  go benefits & use cases
When, how & why use golang in 2021 go benefits & use cases
 
Developing Cross Platform Applications with Golang
Developing Cross Platform Applications with GolangDeveloping Cross Platform Applications with Golang
Developing Cross Platform Applications with Golang
 
Mobile DevOps pipeline using Google Flutter
Mobile DevOps pipeline using Google FlutterMobile DevOps pipeline using Google Flutter
Mobile DevOps pipeline using Google Flutter
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparison
 
Null safety in dart and flutter , the whole story!
Null safety in dart and flutter , the whole story!Null safety in dart and flutter , the whole story!
Null safety in dart and flutter , the whole story!
 
Building Beautiful Apps using Google Flutter
Building Beautiful Apps using Google FlutterBuilding Beautiful Apps using Google Flutter
Building Beautiful Apps using Google Flutter
 
The magic of Flutter - Amman ioextended 6-7-2019
The magic of Flutter - Amman ioextended 6-7-2019The magic of Flutter - Amman ioextended 6-7-2019
The magic of Flutter - Amman ioextended 6-7-2019
 
Building beautiful apps using google flutter
Building beautiful apps using google flutterBuilding beautiful apps using google flutter
Building beautiful apps using google flutter
 
Mobile development with Flutter
Mobile development with FlutterMobile development with Flutter
Mobile development with Flutter
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
 
Flutter not yet another mobile cross-platform framework - i ox-kl19
Flutter   not yet another mobile cross-platform framework - i ox-kl19Flutter   not yet another mobile cross-platform framework - i ox-kl19
Flutter not yet another mobile cross-platform framework - i ox-kl19
 
Flutter latest updates and features 2022
Flutter latest updates and features 2022Flutter latest updates and features 2022
Flutter latest updates and features 2022
 
Google flutter the easy and practical way
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical way
 
Mobile Devolpment Slides
Mobile Devolpment SlidesMobile Devolpment Slides
Mobile Devolpment Slides
 
Feedback from an eclipse plugin developer to provide support to large set of ...
Feedback from an eclipse plugin developer to provide support to large set of ...Feedback from an eclipse plugin developer to provide support to large set of ...
Feedback from an eclipse plugin developer to provide support to large set of ...
 
Why companies like Google, Alibaba and UOL choose Flutter
Why companies like Google, Alibaba and UOL choose FlutterWhy companies like Google, Alibaba and UOL choose Flutter
Why companies like Google, Alibaba and UOL choose Flutter
 
A good intro to Flutter and its magic
A good intro to Flutter and its magicA good intro to Flutter and its magic
A good intro to Flutter and its magic
 

Similar a Scaling applications with go

Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksKaty Slemon
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?Mindfire LLC
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageGanesh Samarthyam
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Ganesh Samarthyam
 
Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...Katy Slemon
 
Golang Vs NodeJS: Which One To Choose For Your 2023
Golang Vs NodeJS: Which One To Choose For Your 2023Golang Vs NodeJS: Which One To Choose For Your 2023
Golang Vs NodeJS: Which One To Choose For Your 2023SofiaCarter4
 
5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software DevelopmentNelsonSEO
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Ganesh Samarthyam
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageGanesh Samarthyam
 
Node.Js Vs Golang.pdf
Node.Js Vs Golang.pdfNode.Js Vs Golang.pdf
Node.Js Vs Golang.pdfRahimMakhani2
 
The Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventureThe Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventuremylittleadventure
 
Top Object-Oriented Programming Languages To Follow In December 2022.pdf
Top Object-Oriented Programming Languages To Follow In December 2022.pdfTop Object-Oriented Programming Languages To Follow In December 2022.pdf
Top Object-Oriented Programming Languages To Follow In December 2022.pdfJamesEddie2
 
Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Codemotion
 
Why Golang? Settling the Debate Once and For All
Why Golang? Settling the Debate Once and For AllWhy Golang? Settling the Debate Once and For All
Why Golang? Settling the Debate Once and For AllKaty Slemon
 

Similar a Scaling applications with go (20)

Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworks
 
Features of go
Features of goFeatures of go
Features of go
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language
 
Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...
 
Workshop - Golang language
Workshop - Golang languageWorkshop - Golang language
Workshop - Golang language
 
Golang Vs NodeJS: Which One To Choose For Your 2023
Golang Vs NodeJS: Which One To Choose For Your 2023Golang Vs NodeJS: Which One To Choose For Your 2023
Golang Vs NodeJS: Which One To Choose For Your 2023
 
5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Node.Js Vs Golang.pdf
Node.Js Vs Golang.pdfNode.Js Vs Golang.pdf
Node.Js Vs Golang.pdf
 
The Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventureThe Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventure
 
Top Object-Oriented Programming Languages To Follow In December 2022.pdf
Top Object-Oriented Programming Languages To Follow In December 2022.pdfTop Object-Oriented Programming Languages To Follow In December 2022.pdf
Top Object-Oriented Programming Languages To Follow In December 2022.pdf
 
Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016
 
Golang web development
Golang web developmentGolang web development
Golang web development
 
Enterprise 2020
Enterprise 2020Enterprise 2020
Enterprise 2020
 
Why Golang? Settling the Debate Once and For All
Why Golang? Settling the Debate Once and For AllWhy Golang? Settling the Debate Once and For All
Why Golang? Settling the Debate Once and For All
 

Último

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 

Último (20)

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 

Scaling applications with go

  • 2.  Introduction  What does Go offer?  Where go can be used?  Go in Production  Go in comparison to other language  Case studies 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 Thompson. INTRODUCTION
  • 4. WHAT DOES GO OFFER ?
  • 5.  Go is relatively  compact language  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- lang.org/docu/files/ScalaReference.pdf  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 FEEL
  • 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 applications.  Go compiler compiles programs very quickly that helps particularly when compiling large applications  ‘Gocc’ is a go compiler’s compiler  https://code.google.com/p/gocc/ 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 concurrently.  You can communicate and pass values between Goroutines using Channels.  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 modern scenarios  e.g. sharing it with developers overs GIT repository) unlike NPM, NuGet, RubyGem 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 codebase.  go test : This is one of the easiest testing setup  go get : This is used to pull the shared source code from GIT GREAT TOOLS
  • 12. WHERE CAN GO CAN BE USED?
  • 13.  Server application  Command-line tools - https://github.com/codegangsta/cli  Web applications  Games - http://go-ngine.com/  Scientific computing - https://archive.fosdem.org/2014/schedule/event/hpc_devroo m_go/  Android & IOS development (in upcoming versions)  Many More... USAGE
  • 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. SINGLE BINARY
  • 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. – http://github.com/inconshreveable/gonative  http://dave.cheney.net/2013/07/09/an-introduction-to-cross- compilation-with-go-1-1 CROSS COMPILATION
  • 17.  There is excellent support for  Live profiling capability for CPU  Memory  Goroutines  OS threads  Lock contention etc  Read more at http://blog.golang.org/profiling-go-programs  Use go toolchain and profile the application on-demand. BUILT-IN PROFILING
  • 18. C++ Java Javascript Scala Go Type Safe Garbage Collection Compilation Slow Slow NA Slow Fast Concurrency Ease of Programming 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.  Concurrency  The safest way to do concurrency in Ruby is through the use of multiple processes, so app uses many workers and hence memory consumption. FROM A RUBY MONOLITH TO MICROSERVICES IN GO
  • 22.  Instead of refactoring the entire application, moving selected component to a micro services architecture in go increased the efficiency.  Main Application + Go Micro services boost application performance.  https://sourcegraph.com/blog/live/gopherconindia/1126565 68167 SOLUTION/OBSERVATION
  • 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
  • 24. SIGNIFICANT LOWER DEVELOPMENT COST. C++ 210 days Go 150 days C++ 400 bugs Go 250 bugs
  • 25.  Benchmarks show that Go compares favorably with C++ and Java  In C++, they had to experiment with a bunch of different libraries  In Java, they had to fiddle around with a bunch of parameters like the min heap size  Go worked well out of the box - https://sourcegraph.com/blog/live/gopherconindia/1116380 91937 SOLUTION/OBSERVATION
  • 26.  Extract dominant color from images.  Generate Insight based on product color  Pain Point:  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%  Easier deployment  Only golang standard library used - https://sourcegraph.com/blog/live/gopherconindia/1116486 97747 SOLUTION/OBSERVATION
  • 30.  Requirement  Static binary.  Efficient Code.  Zero latency(real time)  Cross Platform  Initial choice was Python (Dropped – Restricted library)  EMBD a package entirely written in Go  High Performance. SOLUTION/OBSERVATION https://sourcegraph.com/blog/live/gopherconindia/111626334627
  • 31. LIST OF COMPANIES USING GO IN PRODUCTION
  • 32.
  • 33.  Golang’s 3 hours online jumpstart course  http://tour.golang.org/welcome/1  Testimonials  https://sendgrid.com/blog/convince-company-go-golang/  http://www.scriptrock.com/blog/our-experience-with-golang  Further reading  http://golang.org/doc/  https://talks.golang.org/  http://thenewstack.io/a-closer-look-at-golang-from-an-architects- perspective/ QUICK LINKS