SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Microservices in Go with Go kit
Shiju Varghese
https://medium.com/@shijuvar
DevConf.IN
August 02, 2019
Bengaluru
About Me
• Consulting Solutions Architect on Go and Distributed Systems

• Published Author: Web Development with Go and Go Recipes
• Awarded Microsoft MVP seven times

• Speaker at numerous conferences

• medium.com/@shijuvar | github.com/shijuvar | linkedin.com/in/shijuvar
Agenda
• Introduction to Microservices Architecture 

• Introduction to Go kit

• Building Microservices with Go kit
Microservices Architecture
Scale Cube : 3 Dimensions to Scale
Microservices is an architectural style for building
highly scalable applications, in which an application
decomposes into a set of services as functional
components.
Microservices Architecture is all about functional
decomposition.
• A modern, practical programming language
• Concurrent, Simple, Fast, Type-safe, Compiled very quickly
• A great language for Cloud-Native, Microservices
Go Programming Language
Go kit
Go kit
• A programming toolkit (collection of Go packages) for building
robust, reliable, maintainable microservices
• Solves common problems in distributed systems
• Bootstrap development towards Microservices
• Go kit design is well-suited for modern software design: both
microservices and elegant monoliths
Go kit Architecture
There are three major components in the Go kit based application
architecture:

• Transport layer: The transport domain 

• Endpoint layer: An RPC method

• Service layer: Business logic layer
Transports
• The transport domain is bound to concrete transports 

• Provide transports like HTTP, gRPC, NATS, AMQP, Thrift, etc

• A single microservice can support multiple transports
Endpoints
• An RPC method bound to a service method

• RPC as the primary messaging pattern

• Each endpoint exposes the service method to the outside world using
Transport layer 

type Endpoint func(ctx context.Context, request interface{}) (response
interface{}, err error)
Services
• Business logic modelled as interfaces

• Based on the Clean Architecture or the Hexagonal Architecture

• No knowledge about endpoint, concrete transports and encoding/
decoding
Clean Architecture
The central rule of The Clean Architecture is
the Dependency Rule, which says:
Source code dependencies can only point inwards.
In other words, the source code of each circle can
only access code in an inner circle but never any
code in an outer circle.
Flow of requests and responses
• Request flow: Transport layer -> Endpoint layer -> Service layer

• Response flow: Service layer -> Endpoint layer -> Transport layer
Demo: Building Services with Go kit
Middleware
• A strict separation of concerns through use of the decorator

• Wrap endpoints or services to add functionality, such as logging, rate
limiting and distributed tracing

• Two types of middlewares: Endpoint middleware and Service middleware
Endpoint Middleware
• An endpoint middleware is a function that takes an endpoint and returns
an endpoint.

type Middleware func(Endpoint) Endpoint
• Use endpoint middlewares for transport-domain concerns, like circuit
breaking and rate limiting.
Service Middleware
• An service middleware is a function that takes a service and returns a
service.

type Middleware func(Service) Service
• Use service middlewares for business-domain concerns, like logging and
instrumentation.
Demo: Wrapping Go kit services
with Middlewares
Design of Go kit services
1. Implements the core business logic by defining
an interface for service and providing a concrete
implementation.

2. Writes service middlewares to provide additional
functionality, like logging, analytics,
instrumentation — anything that needs
knowledge of business domain.

3. Go kit provides endpoint and transport domain
middlewares, for functionality like rate limiting,
circuit breaking, load balancing, and distributed
tracing — all of which are generally agnostic to
business domain.
Source Code
https://github.com/shijuvar/gokit-examples
Thanks
Shiju Varghese
gophermonk@gmail.com
https://medium.com/@shijuvar
https://github.com/shijuvar
https://linkedin.com/in/shijuvar
Go Programming Workshops: https://bit.ly/shijuv-go

Weitere ähnliche Inhalte

Was ist angesagt?

Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and PracticeBo-Yi Wu
 
CI-Jenkins.pptx
CI-Jenkins.pptxCI-Jenkins.pptx
CI-Jenkins.pptxMEDOBEST1
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC ServiceJessie Barnett
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersYajushi Srivastava
 
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
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
What is Docker Architecture | Edureka
What is Docker Architecture | EdurekaWhat is Docker Architecture | Edureka
What is Docker Architecture | EdurekaEdureka!
 
Building Microservices with gRPC and NATS
Building Microservices with gRPC and NATSBuilding Microservices with gRPC and NATS
Building Microservices with gRPC and NATSShiju Varghese
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageAniruddha Chakrabarti
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIDavid Hahn
 
Asynchronous javascript
 Asynchronous javascript Asynchronous javascript
Asynchronous javascriptEman Mohamed
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoIanDavidson56
 

Was ist angesagt? (20)

Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
CI-Jenkins.pptx
CI-Jenkins.pptxCI-Jenkins.pptx
CI-Jenkins.pptx
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC Service
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
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
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
 
What is Docker Architecture | Edureka
What is Docker Architecture | EdurekaWhat is Docker Architecture | Edureka
What is Docker Architecture | Edureka
 
Building Microservices with gRPC and NATS
Building Microservices with gRPC and NATSBuilding Microservices with gRPC and NATS
Building Microservices with gRPC and NATS
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Go lang
Go langGo lang
Go lang
 
gRPC with java
gRPC with javagRPC with java
gRPC with java
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
 
Cloud Native In-Depth
Cloud Native In-DepthCloud Native In-Depth
Cloud Native In-Depth
 
Asynchronous javascript
 Asynchronous javascript Asynchronous javascript
Asynchronous javascript
 
GraalVM
GraalVMGraalVM
GraalVM
 
Docker in real life
Docker in real lifeDocker in real life
Docker in real life
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
 

Ähnlich wie Microservices Go kit Build Services

Application Centric Microservices from Redhat Summit 2015
Application Centric Microservices from Redhat Summit 2015Application Centric Microservices from Redhat Summit 2015
Application Centric Microservices from Redhat Summit 2015Ken Owens
 
Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)Ahmed Misbah
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumRick Hightower
 
Ekon20 mORMot SOA Delphi Conference
Ekon20 mORMot SOA Delphi Conference Ekon20 mORMot SOA Delphi Conference
Ekon20 mORMot SOA Delphi Conference Arnaud Bouchez
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)Ahmed Misbah
 
Microdeployments for microservices dev ops nashville
Microdeployments for microservices   dev ops nashvilleMicrodeployments for microservices   dev ops nashville
Microdeployments for microservices dev ops nashvilleNathaniel (Ned) Bauerle
 
Automating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native MeetupAutomating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native MeetupMatt Ray
 
Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Lucas Jellema
 
Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfAhmed Misbah
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing MicroservicesDavid Chou
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1Amin Arab
 
MICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptxMICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptxMohammedShahid562503
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationXPDays
 
Rez gateway - RezOS - innovate the future
Rez gateway - RezOS -   innovate the futureRez gateway - RezOS -   innovate the future
Rez gateway - RezOS - innovate the futureindikaMaligaspe
 
Rez gateway (RezOS) innovate the future
Rez gateway  (RezOS) innovate the futureRez gateway  (RezOS) innovate the future
Rez gateway (RezOS) innovate the futureindikaMaligaspe
 
Agile methodology in cloud computing
Agile methodology in cloud computingAgile methodology in cloud computing
Agile methodology in cloud computingAhmed M. Abed
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitectureAshwini Kuntamukkala
 

Ähnlich wie Microservices Go kit Build Services (20)

Application Centric Microservices from Redhat Summit 2015
Application Centric Microservices from Redhat Summit 2015Application Centric Microservices from Redhat Summit 2015
Application Centric Microservices from Redhat Summit 2015
 
Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)Istio as an enabler for migrating to microservices (edition 2022)
Istio as an enabler for migrating to microservices (edition 2022)
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
 
Ekon20 mORMot SOA Delphi Conference
Ekon20 mORMot SOA Delphi Conference Ekon20 mORMot SOA Delphi Conference
Ekon20 mORMot SOA Delphi Conference
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)
 
Microdeployments for microservices dev ops nashville
Microdeployments for microservices   dev ops nashvilleMicrodeployments for microservices   dev ops nashville
Microdeployments for microservices dev ops nashville
 
Automating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native MeetupAutomating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native Meetup
 
Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...
 
Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdf
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing Microservices
 
Microservices-101
Microservices-101Microservices-101
Microservices-101
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1
 
MICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptxMICROSERVICES ARCHITECTURE unit -2.pptx
MICROSERVICES ARCHITECTURE unit -2.pptx
 
Newt global meetup microservices
Newt global meetup microservicesNewt global meetup microservices
Newt global meetup microservices
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
CV - Abhijit
CV - AbhijitCV - Abhijit
CV - Abhijit
 
Rez gateway - RezOS - innovate the future
Rez gateway - RezOS -   innovate the futureRez gateway - RezOS -   innovate the future
Rez gateway - RezOS - innovate the future
 
Rez gateway (RezOS) innovate the future
Rez gateway  (RezOS) innovate the futureRez gateway  (RezOS) innovate the future
Rez gateway (RezOS) innovate the future
 
Agile methodology in cloud computing
Agile methodology in cloud computingAgile methodology in cloud computing
Agile methodology in cloud computing
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
 

Mehr von Shiju Varghese

Building Modern Distributed Applications in Go with Service Weaver
Building Modern Distributed Applications in Go with Service WeaverBuilding Modern Distributed Applications in Go with Service Weaver
Building Modern Distributed Applications in Go with Service WeaverShiju Varghese
 
NATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging SystemNATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging SystemShiju Varghese
 
Event-Driven Microservices With NATS Streaming
Event-Driven Microservices With NATS StreamingEvent-Driven Microservices With NATS Streaming
Event-Driven Microservices With NATS StreamingShiju Varghese
 
Building Scalable Backends with Go
Building Scalable Backends with GoBuilding Scalable Backends with Go
Building Scalable Backends with GoShiju Varghese
 
A Primer to Containerization & Microservices
A Primer to Containerization & MicroservicesA Primer to Containerization & Microservices
A Primer to Containerization & MicroservicesShiju Varghese
 
Writing HTTP Middleware In Go
Writing HTTP Middleware In GoWriting HTTP Middleware In Go
Writing HTTP Middleware In GoShiju Varghese
 
Building RESTful Services With Go and MongoDB
Building RESTful Services With Go and MongoDBBuilding RESTful Services With Go and MongoDB
Building RESTful Services With Go and MongoDBShiju Varghese
 
Practicing Mindfulness
Practicing MindfulnessPracticing Mindfulness
Practicing MindfulnessShiju Varghese
 
Azure Mobile Services .NET Backend
Azure Mobile Services .NET BackendAzure Mobile Services .NET Backend
Azure Mobile Services .NET BackendShiju Varghese
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile ServicesShiju Varghese
 
JavaScript, Meet Cloud : Node.js on Windows Azure
JavaScript, Meet Cloud : Node.js on Windows AzureJavaScript, Meet Cloud : Node.js on Windows Azure
JavaScript, Meet Cloud : Node.js on Windows AzureShiju Varghese
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsShiju Varghese
 
Windows Azure Cloud Services
Windows Azure Cloud Services Windows Azure Cloud Services
Windows Azure Cloud Services Shiju Varghese
 
Windows Azure Webs Sites
Windows Azure Webs SitesWindows Azure Webs Sites
Windows Azure Webs SitesShiju Varghese
 
Building Apps with Node.js
Building Apps with Node.jsBuilding Apps with Node.js
Building Apps with Node.jsShiju Varghese
 
Introducing Razor - A new view engine for ASP.NET
Introducing Razor - A new view engine for ASP.NET Introducing Razor - A new view engine for ASP.NET
Introducing Razor - A new view engine for ASP.NET Shiju Varghese
 
NoSQL Database in .NET Apps
NoSQL Database in .NET AppsNoSQL Database in .NET Apps
NoSQL Database in .NET AppsShiju Varghese
 

Mehr von Shiju Varghese (20)

Building Modern Distributed Applications in Go with Service Weaver
Building Modern Distributed Applications in Go with Service WeaverBuilding Modern Distributed Applications in Go with Service Weaver
Building Modern Distributed Applications in Go with Service Weaver
 
NATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging SystemNATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging System
 
Event-Driven Microservices With NATS Streaming
Event-Driven Microservices With NATS StreamingEvent-Driven Microservices With NATS Streaming
Event-Driven Microservices With NATS Streaming
 
Building Scalable Backends with Go
Building Scalable Backends with GoBuilding Scalable Backends with Go
Building Scalable Backends with Go
 
A Primer to Containerization & Microservices
A Primer to Containerization & MicroservicesA Primer to Containerization & Microservices
A Primer to Containerization & Microservices
 
Writing HTTP Middleware In Go
Writing HTTP Middleware In GoWriting HTTP Middleware In Go
Writing HTTP Middleware In Go
 
Building RESTful Services With Go and MongoDB
Building RESTful Services With Go and MongoDBBuilding RESTful Services With Go and MongoDB
Building RESTful Services With Go and MongoDB
 
Docker and Kubernetes
Docker and KubernetesDocker and Kubernetes
Docker and Kubernetes
 
Practicing Mindfulness
Practicing MindfulnessPracticing Mindfulness
Practicing Mindfulness
 
Azure DocumentDB
Azure DocumentDBAzure DocumentDB
Azure DocumentDB
 
Azure Mobile Services .NET Backend
Azure Mobile Services .NET BackendAzure Mobile Services .NET Backend
Azure Mobile Services .NET Backend
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
JavaScript, Meet Cloud : Node.js on Windows Azure
JavaScript, Meet Cloud : Node.js on Windows AzureJavaScript, Meet Cloud : Node.js on Windows Azure
JavaScript, Meet Cloud : Node.js on Windows Azure
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Windows Azure Cloud Services
Windows Azure Cloud Services Windows Azure Cloud Services
Windows Azure Cloud Services
 
Windows Azure Webs Sites
Windows Azure Webs SitesWindows Azure Webs Sites
Windows Azure Webs Sites
 
Building Apps with Node.js
Building Apps with Node.jsBuilding Apps with Node.js
Building Apps with Node.js
 
Node on Windows Azure
Node on Windows AzureNode on Windows Azure
Node on Windows Azure
 
Introducing Razor - A new view engine for ASP.NET
Introducing Razor - A new view engine for ASP.NET Introducing Razor - A new view engine for ASP.NET
Introducing Razor - A new view engine for ASP.NET
 
NoSQL Database in .NET Apps
NoSQL Database in .NET AppsNoSQL Database in .NET Apps
NoSQL Database in .NET Apps
 

Kürzlich hochgeladen

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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Kürzlich hochgeladen (20)

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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
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
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
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
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Microservices Go kit Build Services

  • 1. Microservices in Go with Go kit Shiju Varghese https://medium.com/@shijuvar DevConf.IN August 02, 2019 Bengaluru
  • 2. About Me • Consulting Solutions Architect on Go and Distributed Systems • Published Author: Web Development with Go and Go Recipes • Awarded Microsoft MVP seven times • Speaker at numerous conferences • medium.com/@shijuvar | github.com/shijuvar | linkedin.com/in/shijuvar
  • 3. Agenda • Introduction to Microservices Architecture • Introduction to Go kit • Building Microservices with Go kit
  • 5. Scale Cube : 3 Dimensions to Scale
  • 6. Microservices is an architectural style for building highly scalable applications, in which an application decomposes into a set of services as functional components. Microservices Architecture is all about functional decomposition.
  • 7. • A modern, practical programming language • Concurrent, Simple, Fast, Type-safe, Compiled very quickly • A great language for Cloud-Native, Microservices Go Programming Language
  • 9. Go kit • A programming toolkit (collection of Go packages) for building robust, reliable, maintainable microservices • Solves common problems in distributed systems • Bootstrap development towards Microservices • Go kit design is well-suited for modern software design: both microservices and elegant monoliths
  • 10. Go kit Architecture There are three major components in the Go kit based application architecture: • Transport layer: The transport domain • Endpoint layer: An RPC method • Service layer: Business logic layer
  • 11. Transports • The transport domain is bound to concrete transports • Provide transports like HTTP, gRPC, NATS, AMQP, Thrift, etc • A single microservice can support multiple transports
  • 12. Endpoints • An RPC method bound to a service method • RPC as the primary messaging pattern • Each endpoint exposes the service method to the outside world using Transport layer type Endpoint func(ctx context.Context, request interface{}) (response interface{}, err error)
  • 13. Services • Business logic modelled as interfaces • Based on the Clean Architecture or the Hexagonal Architecture • No knowledge about endpoint, concrete transports and encoding/ decoding
  • 14. Clean Architecture The central rule of The Clean Architecture is the Dependency Rule, which says: Source code dependencies can only point inwards. In other words, the source code of each circle can only access code in an inner circle but never any code in an outer circle.
  • 15. Flow of requests and responses • Request flow: Transport layer -> Endpoint layer -> Service layer • Response flow: Service layer -> Endpoint layer -> Transport layer
  • 16. Demo: Building Services with Go kit
  • 17. Middleware • A strict separation of concerns through use of the decorator • Wrap endpoints or services to add functionality, such as logging, rate limiting and distributed tracing • Two types of middlewares: Endpoint middleware and Service middleware
  • 18. Endpoint Middleware • An endpoint middleware is a function that takes an endpoint and returns an endpoint. type Middleware func(Endpoint) Endpoint • Use endpoint middlewares for transport-domain concerns, like circuit breaking and rate limiting.
  • 19.
  • 20. Service Middleware • An service middleware is a function that takes a service and returns a service. type Middleware func(Service) Service • Use service middlewares for business-domain concerns, like logging and instrumentation.
  • 21.
  • 22. Demo: Wrapping Go kit services with Middlewares
  • 23. Design of Go kit services 1. Implements the core business logic by defining an interface for service and providing a concrete implementation. 2. Writes service middlewares to provide additional functionality, like logging, analytics, instrumentation — anything that needs knowledge of business domain. 3. Go kit provides endpoint and transport domain middlewares, for functionality like rate limiting, circuit breaking, load balancing, and distributed tracing — all of which are generally agnostic to business domain.