SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Building Microservices with gRPC and
NATS
Shiju Varghese
Consulting Solutions Architect
April 28, 2017
About Me
• Consulting Solutions Architect and Trainer
• Focused on Golang, Microservices and Cloud-Native
distributed systems architectures
• Published Author: “Web Development with Go” and “Go
Recipes”
• Honoured with Microsoft MVP award seven times
• Blog: https://medium.com/@shijuvar
Agenda
• Inter-Process communications in Microservices
architecture
• Building high performance APIs with gRPC and Protocol
Buffers
• Building Microservices with event-driven architectures
using NATS
MICROSERVICES
ARCHITECTURE
Monolithic Architecture
Catalog Management
Customer Accounts
Orders Management
Payment
Monolithic
Database
Monolithic E-Commerce App
eCom Store Web
Shipment
Moving to Microservices
Catalog Management
Customer Accounts
Orders Management
Payment
eCom Store Web
Shipment
Catalog DB
Accounts DB
Orders DB
Payment DB
Store DB
Shipment DB
Microservices
• Software broken up into functional components
• Componentization via Services in which each service is
packaged as one unit of execution
• Independent, autonomous process with no dependency
on other Microservices
• Autonomous services around Bounded Context
• Decentralization of data management
• Independently replaceable and upgradeable
Challenges
• A business transaction may span into multiple services
• Decentralization of data management
• Communications between Microservices without having
any performance bottleneck
Inter-Process Communications between
Microservices
• Communications over high performance APIs
• Event-Driven architecture using messaging systems
Design Considerations for Building APIs
• Scaling APIs into millions (even billions) of APIs calls
• Wire format; Serialisation and deserialisation of
messages
• Building streaming APIs
• RESTful Vs RPC?
• Text encoding Vs binary encoding?
Why not REST
• Uses HTTP/1.x; Separate TCP Connection per request
• Text on the wire; Not performance efficient
• Harder API evolution
• Not Domain-Specific
• Not strongly-typed
• Lack of streaming capabilities
GRPC AND PROTOCOL
BUFFERS
What is gRPC
• High performance, open-source universal RPC
framework
• A Cloud Native Computing Foundation(CNCF) project
• Open source version of Google’s internal framework
Stubby
• Uses Protocol Buffers as the IDL
• HTTP/2 for transport
• Bi-Directional streaming
• RPC is efficient, domain-specific and strongly-typed
• Works across languages and platforms
Protocol Buffers
• Google's language-neutral, platform-neutral, extensible
mechanism for serialising structured data
• IDL - Describe once and generate interfaces for multiple
languages
• Structure of the Request and Response
• Binary format for network transmission
• Supports multiple languages
Communication between gRPC Server and
Client app
Types of RPC Methods
• Simple RPC
• Server-side streaming RPC
• Client-side streaming RPC
• Bi-directional streaming RPC
gRPC Workflow
ProtoBuf
Definitions
protoc
Compiler
Go
Ruby
Java gRPC Server
gRPC Client
Define1 Compile2
Implement3Generate Code
protoc --go_out=plugins=grpc
DEMO
grpc-gateway - gRPC to JSON Proxy Generator
BUILDING MICROSERVICES
WITH EVENT-DRIVEN
ARCHITECTURE USING NATS
Inter-Process Communication Using an Event-
Driven Architecture
Event-Sourcing
Aggregate ID
Aggregate
Type
Event ID Event Type Event Data
301 Order 1001 OrderCreated …
301 Order 1002 OrderApproved …
301 Order 1003 OrderShipped …
301 Order 1004 OrderDelivered …
Event Table
• Open source, lightweight, high-performance cloud
native messaging system
• Highly performant, extremely light-weight; Capable of
sending 11-12 million messages per second
• Publish-Subscribe messaging system
• Available in two interoperable modules:
• NATS Server
• NATS Streaming Server (with persistent messaging)
Introducing NATS - Shiju Varghese's Blog
Chart source: bravenewgeek.com/dissecting-message-queues
Messaging Patterns
• Publish-Subscribe
• Queueing
• Request-Replay
Components of Messaging Architecture
• Message: Messages are the unit of data exchange. A
payload, which is used for exchanging the data between
applications.
• Subject: Subject specifies the destination of messages.
• Producer: Producers send messages to the NATS server.
• Consumer: Consumers receive messages from the NATS
server.
• Messaging Server: NATS Server distributes the messages
from producers to consumers.
Publish-Subscribe
DEMO
Demo App - Workflow
OrderService -
gRPC Server
gRPC client
Subscriber
OrderCreated
Event
Subscriber
Subscriber
Queue
Group
NATS publisher, which publishes events
when new orders are created
RPC call for creating a new order
Example Source: https://github.com/shijuvar/gokit/tree/master/examples/grpc-nats
Thank you
Blog: medium.com/@shijuvar
LinkedIn: linkedin.com/in/shijuvar
Email: gophermonk@gmail.com

Contenu connexe

Tendances

An overview of the Kubernetes architecture
An overview of the Kubernetes architectureAn overview of the Kubernetes architecture
An overview of the Kubernetes architectureIgor Sfiligoi
 
Kubernetes
KubernetesKubernetes
Kuberneteserialc_w
 
Observability in Java: Getting Started with OpenTelemetry
Observability in Java: Getting Started with OpenTelemetryObservability in Java: Getting Started with OpenTelemetry
Observability in Java: Getting Started with OpenTelemetryDevOps.com
 
End-to-End CI/CD at scale with Infrastructure-as-Code on AWS
End-to-End CI/CD at scale with Infrastructure-as-Code on AWSEnd-to-End CI/CD at scale with Infrastructure-as-Code on AWS
End-to-End CI/CD at scale with Infrastructure-as-Code on AWSBhuvaneswari Subramani
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architectureJanakiram MSV
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes NetworkingCJ Cullen
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview Krishna-Kumar
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep diveWinton Winton
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesRishabh Indoria
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanAraf Karsh Hamid
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopBob Killen
 
Big Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingBig Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingAraf Karsh Hamid
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 

Tendances (20)

An overview of the Kubernetes architecture
An overview of the Kubernetes architectureAn overview of the Kubernetes architecture
An overview of the Kubernetes architecture
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
02 api gateway
02 api gateway02 api gateway
02 api gateway
 
gRPC
gRPCgRPC
gRPC
 
Observability in Java: Getting Started with OpenTelemetry
Observability in Java: Getting Started with OpenTelemetryObservability in Java: Getting Started with OpenTelemetry
Observability in Java: Getting Started with OpenTelemetry
 
End-to-End CI/CD at scale with Infrastructure-as-Code on AWS
End-to-End CI/CD at scale with Infrastructure-as-Code on AWSEnd-to-End CI/CD at scale with Infrastructure-as-Code on AWS
End-to-End CI/CD at scale with Infrastructure-as-Code on AWS
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Big Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb ShardingBig Data Redis Mongodb Dynamodb Sharding
Big Data Redis Mongodb Dynamodb Sharding
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Microservices
MicroservicesMicroservices
Microservices
 

Similaire à Building Microservices with gRPC and NATS

Cloud Native Application Integration With APIs
Cloud Native Application Integration With APIsCloud Native Application Integration With APIs
Cloud Native Application Integration With APIsNirmal Fernando
 
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Building High Performance APIs In Go Using gRPC And Protocol BuffersBuilding High Performance APIs In Go Using gRPC And Protocol Buffers
Building High Performance APIs In Go Using gRPC And Protocol BuffersShiju Varghese
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservicesRon Barabash
 
[Workshop] API Management in Microservices Architecture
[Workshop] API Management in Microservices Architecture[Workshop] API Management in Microservices Architecture
[Workshop] API Management in Microservices ArchitectureWSO2
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! QAware GmbH
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftRX-M Enterprises LLC
 
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Mustafa AKIN
 
The what, why and how of knative
The what, why and how of knativeThe what, why and how of knative
The what, why and how of knativeMofizur Rahman
 
Brocade Software Networking Presentation at Interface 2016
Brocade Software Networking Presentation at Interface 2016Brocade Software Networking Presentation at Interface 2016
Brocade Software Networking Presentation at Interface 2016Scott Sims
 
[WSO2 Summit Americas 2020] Creating Smart Endpoints Using Integration Micros...
[WSO2 Summit Americas 2020] Creating Smart Endpoints Using Integration Micros...[WSO2 Summit Americas 2020] Creating Smart Endpoints Using Integration Micros...
[WSO2 Summit Americas 2020] Creating Smart Endpoints Using Integration Micros...WSO2
 
API Management within a Microservice Architecture
API Management within a Microservice ArchitectureAPI Management within a Microservice Architecture
API Management within a Microservice ArchitectureWSO2
 
API Management Within a Microservices Architecture
API Management Within a Microservices Architecture API Management Within a Microservices Architecture
API Management Within a Microservices Architecture Nadeesha Gamage
 
Introducing the Microservices Reference Architecture Version 1.2
Introducing the Microservices Reference Architecture Version 1.2Introducing the Microservices Reference Architecture Version 1.2
Introducing the Microservices Reference Architecture Version 1.2NGINX, Inc.
 
Modern apps in a microservices age May meet up Architecting for Innovation
Modern apps in a microservices age May meet up Architecting for InnovationModern apps in a microservices age May meet up Architecting for Innovation
Modern apps in a microservices age May meet up Architecting for InnovationAndrew Blades
 
DigitalOcean Microservices Talk Rocket Internet Conf '16
DigitalOcean Microservices Talk Rocket Internet Conf '16DigitalOcean Microservices Talk Rocket Internet Conf '16
DigitalOcean Microservices Talk Rocket Internet Conf '16Matthew Campbell
 
Kubernetes and the NGINX Plus Ingress Controller
Kubernetes and the NGINX Plus Ingress ControllerKubernetes and the NGINX Plus Ingress Controller
Kubernetes and the NGINX Plus Ingress ControllerKatherine Bagood
 
Agile Integration Workshop
Agile Integration WorkshopAgile Integration Workshop
Agile Integration WorkshopJudy Breedlove
 
[WSO2 API Day Toronto 2019] Cloud-native Integration for the Enterprise
[WSO2 API Day Toronto 2019] Cloud-native Integration for the Enterprise[WSO2 API Day Toronto 2019] Cloud-native Integration for the Enterprise
[WSO2 API Day Toronto 2019] Cloud-native Integration for the EnterpriseWSO2
 
NGINX: The Past, Present and Future of the Modern Web
NGINX: The Past, Present and Future of the Modern WebNGINX: The Past, Present and Future of the Modern Web
NGINX: The Past, Present and Future of the Modern WebKevin Jones
 

Similaire à Building Microservices with gRPC and NATS (20)

Cloud Native Application Integration With APIs
Cloud Native Application Integration With APIsCloud Native Application Integration With APIs
Cloud Native Application Integration With APIs
 
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Building High Performance APIs In Go Using gRPC And Protocol BuffersBuilding High Performance APIs In Go Using gRPC And Protocol Buffers
Building High Performance APIs In Go Using gRPC And Protocol Buffers
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservices
 
[Workshop] API Management in Microservices Architecture
[Workshop] API Management in Microservices Architecture[Workshop] API Management in Microservices Architecture
[Workshop] API Management in Microservices Architecture
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
 
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
 
The what, why and how of knative
The what, why and how of knativeThe what, why and how of knative
The what, why and how of knative
 
Brocade Software Networking Presentation at Interface 2016
Brocade Software Networking Presentation at Interface 2016Brocade Software Networking Presentation at Interface 2016
Brocade Software Networking Presentation at Interface 2016
 
[WSO2 Summit Americas 2020] Creating Smart Endpoints Using Integration Micros...
[WSO2 Summit Americas 2020] Creating Smart Endpoints Using Integration Micros...[WSO2 Summit Americas 2020] Creating Smart Endpoints Using Integration Micros...
[WSO2 Summit Americas 2020] Creating Smart Endpoints Using Integration Micros...
 
API Management within a Microservice Architecture
API Management within a Microservice ArchitectureAPI Management within a Microservice Architecture
API Management within a Microservice Architecture
 
API Management Within a Microservices Architecture
API Management Within a Microservices Architecture API Management Within a Microservices Architecture
API Management Within a Microservices Architecture
 
Introducing the Microservices Reference Architecture Version 1.2
Introducing the Microservices Reference Architecture Version 1.2Introducing the Microservices Reference Architecture Version 1.2
Introducing the Microservices Reference Architecture Version 1.2
 
Go mico
Go micoGo mico
Go mico
 
Modern apps in a microservices age May meet up Architecting for Innovation
Modern apps in a microservices age May meet up Architecting for InnovationModern apps in a microservices age May meet up Architecting for Innovation
Modern apps in a microservices age May meet up Architecting for Innovation
 
DigitalOcean Microservices Talk Rocket Internet Conf '16
DigitalOcean Microservices Talk Rocket Internet Conf '16DigitalOcean Microservices Talk Rocket Internet Conf '16
DigitalOcean Microservices Talk Rocket Internet Conf '16
 
Kubernetes and the NGINX Plus Ingress Controller
Kubernetes and the NGINX Plus Ingress ControllerKubernetes and the NGINX Plus Ingress Controller
Kubernetes and the NGINX Plus Ingress Controller
 
Agile Integration Workshop
Agile Integration WorkshopAgile Integration Workshop
Agile Integration Workshop
 
[WSO2 API Day Toronto 2019] Cloud-native Integration for the Enterprise
[WSO2 API Day Toronto 2019] Cloud-native Integration for the Enterprise[WSO2 API Day Toronto 2019] Cloud-native Integration for the Enterprise
[WSO2 API Day Toronto 2019] Cloud-native Integration for the Enterprise
 
NGINX: The Past, Present and Future of the Modern Web
NGINX: The Past, Present and Future of the Modern WebNGINX: The Past, Present and Future of the Modern Web
NGINX: The Past, Present and Future of the Modern Web
 

Plus de 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
 
Microservices in Go with Go kit
Microservices in Go with Go kitMicroservices in Go with Go kit
Microservices in Go with Go kitShiju 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
 
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
 

Plus de 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
 
Microservices in Go with Go kit
Microservices in Go with Go kitMicroservices in Go with Go kit
Microservices in Go with Go kit
 
NATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging SystemNATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging System
 
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
 

Dernier

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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
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
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Dernier (20)

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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
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
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
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)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

Building Microservices with gRPC and NATS

  • 1. Building Microservices with gRPC and NATS Shiju Varghese Consulting Solutions Architect April 28, 2017
  • 2. About Me • Consulting Solutions Architect and Trainer • Focused on Golang, Microservices and Cloud-Native distributed systems architectures • Published Author: “Web Development with Go” and “Go Recipes” • Honoured with Microsoft MVP award seven times • Blog: https://medium.com/@shijuvar
  • 3. Agenda • Inter-Process communications in Microservices architecture • Building high performance APIs with gRPC and Protocol Buffers • Building Microservices with event-driven architectures using NATS
  • 5. Monolithic Architecture Catalog Management Customer Accounts Orders Management Payment Monolithic Database Monolithic E-Commerce App eCom Store Web Shipment
  • 6. Moving to Microservices Catalog Management Customer Accounts Orders Management Payment eCom Store Web Shipment Catalog DB Accounts DB Orders DB Payment DB Store DB Shipment DB
  • 7. Microservices • Software broken up into functional components • Componentization via Services in which each service is packaged as one unit of execution • Independent, autonomous process with no dependency on other Microservices • Autonomous services around Bounded Context • Decentralization of data management • Independently replaceable and upgradeable
  • 8. Challenges • A business transaction may span into multiple services • Decentralization of data management • Communications between Microservices without having any performance bottleneck
  • 9. Inter-Process Communications between Microservices • Communications over high performance APIs • Event-Driven architecture using messaging systems
  • 10. Design Considerations for Building APIs • Scaling APIs into millions (even billions) of APIs calls • Wire format; Serialisation and deserialisation of messages • Building streaming APIs • RESTful Vs RPC? • Text encoding Vs binary encoding?
  • 11. Why not REST • Uses HTTP/1.x; Separate TCP Connection per request • Text on the wire; Not performance efficient • Harder API evolution • Not Domain-Specific • Not strongly-typed • Lack of streaming capabilities
  • 13. What is gRPC • High performance, open-source universal RPC framework • A Cloud Native Computing Foundation(CNCF) project • Open source version of Google’s internal framework Stubby • Uses Protocol Buffers as the IDL • HTTP/2 for transport • Bi-Directional streaming • RPC is efficient, domain-specific and strongly-typed • Works across languages and platforms
  • 14. Protocol Buffers • Google's language-neutral, platform-neutral, extensible mechanism for serialising structured data • IDL - Describe once and generate interfaces for multiple languages • Structure of the Request and Response • Binary format for network transmission • Supports multiple languages
  • 15. Communication between gRPC Server and Client app
  • 16. Types of RPC Methods • Simple RPC • Server-side streaming RPC • Client-side streaming RPC • Bi-directional streaming RPC
  • 17. gRPC Workflow ProtoBuf Definitions protoc Compiler Go Ruby Java gRPC Server gRPC Client Define1 Compile2 Implement3Generate Code protoc --go_out=plugins=grpc
  • 18. DEMO
  • 19. grpc-gateway - gRPC to JSON Proxy Generator
  • 21. Inter-Process Communication Using an Event- Driven Architecture
  • 22. Event-Sourcing Aggregate ID Aggregate Type Event ID Event Type Event Data 301 Order 1001 OrderCreated … 301 Order 1002 OrderApproved … 301 Order 1003 OrderShipped … 301 Order 1004 OrderDelivered … Event Table
  • 23. • Open source, lightweight, high-performance cloud native messaging system • Highly performant, extremely light-weight; Capable of sending 11-12 million messages per second • Publish-Subscribe messaging system • Available in two interoperable modules: • NATS Server • NATS Streaming Server (with persistent messaging) Introducing NATS - Shiju Varghese's Blog
  • 25. Messaging Patterns • Publish-Subscribe • Queueing • Request-Replay
  • 26. Components of Messaging Architecture • Message: Messages are the unit of data exchange. A payload, which is used for exchanging the data between applications. • Subject: Subject specifies the destination of messages. • Producer: Producers send messages to the NATS server. • Consumer: Consumers receive messages from the NATS server. • Messaging Server: NATS Server distributes the messages from producers to consumers.
  • 28. DEMO
  • 29. Demo App - Workflow OrderService - gRPC Server gRPC client Subscriber OrderCreated Event Subscriber Subscriber Queue Group NATS publisher, which publishes events when new orders are created RPC call for creating a new order Example Source: https://github.com/shijuvar/gokit/tree/master/examples/grpc-nats
  • 30. Thank you Blog: medium.com/@shijuvar LinkedIn: linkedin.com/in/shijuvar Email: gophermonk@gmail.com