SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Microservice in Go
Moath Qasim
LOVOO GmbH
Microservice
Microservice
Microservice
Microservice
Microservice
Microservice
Microservice
Microservice
So what is this Microservices is all about?
Microservices Architecture is a software architecture style in which complex applications
are composed of small, independent processes communicating with each other using
language-agnostic APIs.
Switches
Load Balancer
bla bla bla
DB
DB
DB
Ohhhhhh !! So What??
Let’s go “Monolithic”
let us imagine we are building a social network application.
Front End
User Services
Messaging Services
Payment Services
DB
DB
DB
Web
Server
Yes, That’s what I am talking about
-Simple to develop
-Simple to deploy
-Simple to scale
, HOWEVER What if, the application get’s bigger and
bigger and the team gets also bigger and bigger.
You might run into these problems:
- Huge applications can be a boogieman specially for new
developers.
- Overloaded web containers.
- Continuous deployment is difficult.
- Requires a long-term commitment to a technology stack.
- Scaling the application can be difficult.
Hmm, I really didn’t see that coming!!
Enter Microservices Architecture
- Split your application into independent components based on the
functionality of each one of them.
- Find a protocol to make those services interact with each other whether
in synchronous way or in asynchronous way.
- Remember, each service is totally independent in order to be decoupled
from other services, so each one of them should have it’s own database.
- Consistency between those services can be achieved via having a
database replication mechanism or by applications-level events.
Looks a little bit better, right?
User Services
Messaging Services
Payment Services
DB
DB
DB
Front End
O.K, those are the benefits of what we have done:
- Each Microservice is relatively small.
- Each service can be deployed independently of other services
- Easier to scale development.
- Improved fault isolation.
- Each service can be developed and deployed independently.
- Eliminates any long-term commitment to a technology stack.
Enter our #ROCKSTAR, yes you are right, it’s Gopher the one and
only.
Implementing Microservice Architecture using Go
The powerful net/http package lets you write performant web services in a very
quick way.
Basically you want to have many independent worker applications that are
running separately, each with their own responsibility of doing certain tasks.
In real world scenarios you are going to have hundreds of applications running.
You want to talk with them securely (and also authenticated).
You can implement your own MS architecture, using the core package of Go
without looking on what’s already out there.
One of the most impressive packages which helps you building your
infrastructure of your MS architecture is Kite.
Bla, Bla, Bla, show me some code man!!!
You asked for it, and I listend ;)
First let me show you a Kite in the most simple form:
Here we just created a kite with the name first and version 1.0.0. The Run() method
is running a server, which is blocking (just like http.Serve).
This kite is now capable of receiving requests.
Because no port number is assigned the OS has picked one for us automatically.
Writing a kite
Let us assign a port now, so we can connect to it from another kite (otherwise you
need to pick the assigned URL from the logs).
To change the configuration of a Kite, such as Port number, the properties (such
as Environment, Region, etc… you’ll need to modify the Config fields:
The configuration values can be also overridden via environment variables if
needed.
Let us create a second kite to talk with the first kite:
The response of should be something like this:
Adding some methods to make things a little bit interesting
Let us add our first custom method. This simple method is going to accept a
name and return a welcome message. The name of the method will be
“sayHello”.
To assign a function to a method just be sure it’s satisfies the kite.Handler
interface (http://godoc.org/github.com/koding/kite#Handler):
Let’s call it via our “second” kite:
As you see the only thing that has changed is the method call. When we call the
“sayHello” method we also send the name “Marco Reus” with as an arguments.
You can send any JSON compatible Go type.
That was super easy and AWESOME :)))
“Dude!! Where is my car?? ”, Service Discovery
To be discovered by others they need to know your real identity. Basically you
need to be authenticated.
“kitectl” is a handy CLI program which can be used to manage kites easily via
command line. We can use it (via “kitectl register” command) to authenticate
our machine to Kontrol, so every kite running on our host will be authenticated
by default.
Kontrol Configs:
Install Kontrol:
Using Kontrol
Using Kontrol
That’s it
Thank you and keep up rocking with Go
Moath Qasim
LOVOO GmbH
Resources:
http://microservices.io/patterns/microservices.html
https://godoc.org/github.com/koding/kite
http://blog.gopheracademy.com/birthday-bash-2014/kite-microservice-library/
@MoadQassem

Contenu connexe

Tendances

Karate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingKarate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingRoman Liubun
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaUnit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaAndrey Kolodnitsky
 
API Automation Testing Using RestAssured+Cucumber
API Automation Testing Using RestAssured+CucumberAPI Automation Testing Using RestAssured+Cucumber
API Automation Testing Using RestAssured+CucumberKnoldus Inc.
 
Getting started with karate dsl
Getting started with karate dslGetting started with karate dsl
Getting started with karate dslKnoldus Inc.
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming languageSlawomir Dorzak
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#Pascal Laurin
 
Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLangNVISIA
 
Karate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter ThomasKarate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter Thomasintuit_india
 
Go Programlama Dili - Seminer
Go Programlama Dili - SeminerGo Programlama Dili - Seminer
Go Programlama Dili - SeminerCihan Özhan
 
Domain-Driven Design und Hexagonale Architektur
Domain-Driven Design und Hexagonale ArchitekturDomain-Driven Design und Hexagonale Architektur
Domain-Driven Design und Hexagonale ArchitekturTorben Fojuth
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
 
How to build Micro Frontends with @angular/elements
How to build Micro Frontends with @angular/elementsHow to build Micro Frontends with @angular/elements
How to build Micro Frontends with @angular/elementsMarcellKiss7
 
Micro Frontends: Rompiendo el monolito en las aplicaciones Web
Micro Frontends: Rompiendo el monolito en las aplicaciones WebMicro Frontends: Rompiendo el monolito en las aplicaciones Web
Micro Frontends: Rompiendo el monolito en las aplicaciones WebBelatrix Software
 

Tendances (20)

Karate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingKarate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testing
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaUnit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and Karma
 
Kotlin
KotlinKotlin
Kotlin
 
API Automation Testing Using RestAssured+Cucumber
API Automation Testing Using RestAssured+CucumberAPI Automation Testing Using RestAssured+Cucumber
API Automation Testing Using RestAssured+Cucumber
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Getting started with karate dsl
Getting started with karate dslGetting started with karate dsl
Getting started with karate dsl
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming language
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
 
Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLang
 
Karate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter ThomasKarate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter Thomas
 
Go Programlama Dili - Seminer
Go Programlama Dili - SeminerGo Programlama Dili - Seminer
Go Programlama Dili - Seminer
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Domain-Driven Design und Hexagonale Architektur
Domain-Driven Design und Hexagonale ArchitekturDomain-Driven Design und Hexagonale Architektur
Domain-Driven Design und Hexagonale Architektur
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
 
How to build Micro Frontends with @angular/elements
How to build Micro Frontends with @angular/elementsHow to build Micro Frontends with @angular/elements
How to build Micro Frontends with @angular/elements
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
Micro Frontends: Rompiendo el monolito en las aplicaciones Web
Micro Frontends: Rompiendo el monolito en las aplicaciones WebMicro Frontends: Rompiendo el monolito en las aplicaciones Web
Micro Frontends: Rompiendo el monolito en las aplicaciones Web
 

En vedette

Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using GolangSeongJae Park
 
Manchester city
Manchester cityManchester city
Manchester cityofrancis
 
Waldorf Education
Waldorf EducationWaldorf Education
Waldorf EducationxMerodi
 
French Property Market 2014
French Property Market 2014French Property Market 2014
French Property Market 2014David Bourla
 
French Property market 2015 - Cushman & Wakefield
French Property market 2015 - Cushman & WakefieldFrench Property market 2015 - Cushman & Wakefield
French Property market 2015 - Cushman & WakefieldDavid Bourla
 
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014Marketing Festival
 
The big bang theory
The big bang theoryThe big bang theory
The big bang theorymreedy
 
The Big Bang Theory
The Big Bang TheoryThe Big Bang Theory
The Big Bang Theoryrose_aries15
 
Microservices in GO lang
Microservices in GO langMicroservices in GO lang
Microservices in GO langSHAKIL AKHTAR
 

En vedette (20)

Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using Golang
 
Golang online course
Golang online courseGolang online course
Golang online course
 
Manchester city
Manchester cityManchester city
Manchester city
 
Waldorf Education
Waldorf EducationWaldorf Education
Waldorf Education
 
Sap fiori
Sap fioriSap fiori
Sap fiori
 
French Property Market 2014
French Property Market 2014French Property Market 2014
French Property Market 2014
 
Medical devices
Medical devicesMedical devices
Medical devices
 
French Property market 2015 - Cushman & Wakefield
French Property market 2015 - Cushman & WakefieldFrench Property market 2015 - Cushman & Wakefield
French Property market 2015 - Cushman & Wakefield
 
Cerebral Palsy
Cerebral PalsyCerebral Palsy
Cerebral Palsy
 
Elon Musk
Elon MuskElon Musk
Elon Musk
 
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014
 
The big bang theory
The big bang theoryThe big bang theory
The big bang theory
 
Chess
ChessChess
Chess
 
Lionel Messi
Lionel MessiLionel Messi
Lionel Messi
 
Lionel messi
Lionel messiLionel messi
Lionel messi
 
David guetta
David guettaDavid guetta
David guetta
 
The Big Bang Theory
The Big Bang TheoryThe Big Bang Theory
The Big Bang Theory
 
Microservices in GO lang
Microservices in GO langMicroservices in GO lang
Microservices in GO lang
 
Go lang
Go langGo lang
Go lang
 
Rest security with oauth 2.0
Rest security with oauth 2.0Rest security with oauth 2.0
Rest security with oauth 2.0
 

Similaire à Microservices in Golang

Introduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleIntroduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleSandeep Hijam
 
2009 10-08 soa-og_itil_does service in it service rhyme with service as in so...
2009 10-08 soa-og_itil_does service in it service rhyme with service as in so...2009 10-08 soa-og_itil_does service in it service rhyme with service as in so...
2009 10-08 soa-og_itil_does service in it service rhyme with service as in so...Peter Rosenberg
 
A Gentle introduction to microservices
A Gentle introduction to microservicesA Gentle introduction to microservices
A Gentle introduction to microservicesGianluca Padovani
 
Introduction to meteor
Introduction to meteorIntroduction to meteor
Introduction to meteorNodeXperts
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 uploadDebnath Sinha
 
Summarize the What Is Web 2.0
Summarize the What Is Web 2.0Summarize the What Is Web 2.0
Summarize the What Is Web 2.0wacerone
 
Steve Bennett .Net Architect/Developer Resume
Steve Bennett .Net Architect/Developer ResumeSteve Bennett .Net Architect/Developer Resume
Steve Bennett .Net Architect/Developer Resume?? Stephen Bennett ??
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioJérôme Petazzoni
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsNicholas Jansma
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekDr. Felix Raab
 
The Case Against Microservices
The Case Against MicroservicesThe Case Against Microservices
The Case Against Microservicesaledsage
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS UniverseStefano Di Paola
 
Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Jérôme Petazzoni
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdflubnayasminsebl
 
Introjs10.5.17SD
Introjs10.5.17SDIntrojs10.5.17SD
Introjs10.5.17SDThinkful
 
Scaling Engineering with Docker
Scaling Engineering with DockerScaling Engineering with Docker
Scaling Engineering with DockerTom Leach
 

Similaire à Microservices in Golang (20)

Introduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleIntroduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning Simple
 
Let's talk about... Microservices
Let's talk about... MicroservicesLet's talk about... Microservices
Let's talk about... Microservices
 
2009 10-08 soa-og_itil_does service in it service rhyme with service as in so...
2009 10-08 soa-og_itil_does service in it service rhyme with service as in so...2009 10-08 soa-og_itil_does service in it service rhyme with service as in so...
2009 10-08 soa-og_itil_does service in it service rhyme with service as in so...
 
A Gentle introduction to microservices
A Gentle introduction to microservicesA Gentle introduction to microservices
A Gentle introduction to microservices
 
Introduction to meteor
Introduction to meteorIntroduction to meteor
Introduction to meteor
 
Micro services
Micro servicesMicro services
Micro services
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 upload
 
Summarize the What Is Web 2.0
Summarize the What Is Web 2.0Summarize the What Is Web 2.0
Summarize the What Is Web 2.0
 
Steve Bennett .Net Architect/Developer Resume
Steve Bennett .Net Architect/Developer ResumeSteve Bennett .Net Architect/Developer Resume
Steve Bennett .Net Architect/Developer Resume
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.js
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
 
The Case Against Microservices
The Case Against MicroservicesThe Case Against Microservices
The Case Against Microservices
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe
 
Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)Microservices. Microservices everywhere! (At OSCON 2015)
Microservices. Microservices everywhere! (At OSCON 2015)
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
Introjs10.5.17SD
Introjs10.5.17SDIntrojs10.5.17SD
Introjs10.5.17SD
 
Sustainability and bit-rot
Sustainability and bit-rotSustainability and bit-rot
Sustainability and bit-rot
 
Scaling Engineering with Docker
Scaling Engineering with DockerScaling Engineering with Docker
Scaling Engineering with Docker
 

Dernier

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Dernier (20)

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Microservices in Golang

  • 1. Microservice in Go Moath Qasim LOVOO GmbH
  • 3. So what is this Microservices is all about? Microservices Architecture is a software architecture style in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs. Switches Load Balancer bla bla bla DB DB DB
  • 4. Ohhhhhh !! So What??
  • 5. Let’s go “Monolithic” let us imagine we are building a social network application. Front End User Services Messaging Services Payment Services DB DB DB Web Server
  • 6. Yes, That’s what I am talking about -Simple to develop -Simple to deploy -Simple to scale
  • 7. , HOWEVER What if, the application get’s bigger and bigger and the team gets also bigger and bigger. You might run into these problems: - Huge applications can be a boogieman specially for new developers. - Overloaded web containers. - Continuous deployment is difficult. - Requires a long-term commitment to a technology stack. - Scaling the application can be difficult.
  • 8. Hmm, I really didn’t see that coming!!
  • 9. Enter Microservices Architecture - Split your application into independent components based on the functionality of each one of them. - Find a protocol to make those services interact with each other whether in synchronous way or in asynchronous way. - Remember, each service is totally independent in order to be decoupled from other services, so each one of them should have it’s own database. - Consistency between those services can be achieved via having a database replication mechanism or by applications-level events.
  • 10. Looks a little bit better, right? User Services Messaging Services Payment Services DB DB DB Front End
  • 11. O.K, those are the benefits of what we have done: - Each Microservice is relatively small. - Each service can be deployed independently of other services - Easier to scale development. - Improved fault isolation. - Each service can be developed and deployed independently. - Eliminates any long-term commitment to a technology stack.
  • 12. Enter our #ROCKSTAR, yes you are right, it’s Gopher the one and only.
  • 13. Implementing Microservice Architecture using Go The powerful net/http package lets you write performant web services in a very quick way. Basically you want to have many independent worker applications that are running separately, each with their own responsibility of doing certain tasks. In real world scenarios you are going to have hundreds of applications running. You want to talk with them securely (and also authenticated). You can implement your own MS architecture, using the core package of Go without looking on what’s already out there. One of the most impressive packages which helps you building your infrastructure of your MS architecture is Kite.
  • 14. Bla, Bla, Bla, show me some code man!!!
  • 15. You asked for it, and I listend ;) First let me show you a Kite in the most simple form: Here we just created a kite with the name first and version 1.0.0. The Run() method is running a server, which is blocking (just like http.Serve). This kite is now capable of receiving requests. Because no port number is assigned the OS has picked one for us automatically.
  • 16. Writing a kite Let us assign a port now, so we can connect to it from another kite (otherwise you need to pick the assigned URL from the logs). To change the configuration of a Kite, such as Port number, the properties (such as Environment, Region, etc… you’ll need to modify the Config fields: The configuration values can be also overridden via environment variables if needed.
  • 17. Let us create a second kite to talk with the first kite: The response of should be something like this:
  • 18. Adding some methods to make things a little bit interesting Let us add our first custom method. This simple method is going to accept a name and return a welcome message. The name of the method will be “sayHello”. To assign a function to a method just be sure it’s satisfies the kite.Handler interface (http://godoc.org/github.com/koding/kite#Handler):
  • 19. Let’s call it via our “second” kite: As you see the only thing that has changed is the method call. When we call the “sayHello” method we also send the name “Marco Reus” with as an arguments. You can send any JSON compatible Go type.
  • 20. That was super easy and AWESOME :)))
  • 21. “Dude!! Where is my car?? ”, Service Discovery To be discovered by others they need to know your real identity. Basically you need to be authenticated. “kitectl” is a handy CLI program which can be used to manage kites easily via command line. We can use it (via “kitectl register” command) to authenticate our machine to Kontrol, so every kite running on our host will be authenticated by default. Kontrol Configs: Install Kontrol:
  • 24. That’s it Thank you and keep up rocking with Go Moath Qasim LOVOO GmbH Resources: http://microservices.io/patterns/microservices.html https://godoc.org/github.com/koding/kite http://blog.gopheracademy.com/birthday-bash-2014/kite-microservice-library/ @MoadQassem