SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Golang getting started
Golang getting startedGolang getting started
Golang getting startedHarshad Patil
 
Go language presentation
Go language presentationGo language presentation
Go language presentationparamisoft
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageAniruddha Chakrabarti
 
Why you should care about Go (Golang)
Why you should care about Go (Golang)Why you should care about Go (Golang)
Why you should care about Go (Golang)Aaron Schlesinger
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)ShubhamMishra485
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming languageSlawomir Dorzak
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceEvan McGee
 
An Evening with... Go Lang
An Evening with... Go LangAn Evening with... Go Lang
An Evening with... Go LangArkhotech
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesLuciano Fiandesio
 
MPI Introduction
MPI IntroductionMPI Introduction
MPI IntroductionRohit Banga
 
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
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)Ishin Vin
 
Gnome on wayland at a glance
Gnome on wayland at a glanceGnome on wayland at a glance
Gnome on wayland at a glancegnomekr
 
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...Igalia
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptxGuy Komari
 
Golang 101
Golang 101Golang 101
Golang 101宇 傅
 
Using gcov and lcov
Using gcov and lcovUsing gcov and lcov
Using gcov and lcovtest test
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkSVDevOps
 

Was ist angesagt? (20)

Golang getting started
Golang getting startedGolang getting started
Golang getting started
 
Go language presentation
Go language presentationGo language presentation
Go language presentation
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Why you should care about Go (Golang)
Why you should care about Go (Golang)Why you should care about Go (Golang)
Why you should care about Go (Golang)
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming language
 
Linux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platformLinux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platform
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
An Evening with... Go Lang
An Evening with... Go LangAn Evening with... Go Lang
An Evening with... Go Lang
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
MPI Introduction
MPI IntroductionMPI Introduction
MPI Introduction
 
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
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)
 
Gnome on wayland at a glance
Gnome on wayland at a glanceGnome on wayland at a glance
Gnome on wayland at a glance
 
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptx
 
Golang 101
Golang 101Golang 101
Golang 101
 
Using gcov and lcov
Using gcov and lcovUsing gcov and lcov
Using gcov and lcov
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
 

Andere mochten auch

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
 
Support Vector Machine(SVM) with Iris and Mushroom Dataset
Support Vector Machine(SVM) with Iris and Mushroom DatasetSupport Vector Machine(SVM) with Iris and Mushroom Dataset
Support Vector Machine(SVM) with Iris and Mushroom DatasetPawandeep Kaur
 

Andere mochten auch (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
 
Rest security with oauth 2.0
Rest security with oauth 2.0Rest security with oauth 2.0
Rest security with oauth 2.0
 
Support Vector Machine(SVM) with Iris and Mushroom Dataset
Support Vector Machine(SVM) with Iris and Mushroom DatasetSupport Vector Machine(SVM) with Iris and Mushroom Dataset
Support Vector Machine(SVM) with Iris and Mushroom Dataset
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 

Kürzlich hochgeladen (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 

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