Micro on NATS - Microservices with Messaging

Apcera
ApceraTechnology / Managed-service at Apcera
Micro on NATS
Microservices with messaging
Who am I?
Asim Aslam
Working on Micro
Previously at Hailo
Before then Google
@chuhnk
asimaslam.com
What is Micro?
A microservice ecosystem
Simplifying building and managing distributed systems
What does that even mean?
Building OSS tools that make it easier to write and run micro service applications
Written in Go
100% Open Source
Micro A Microservice Toolkit
Go Micro - Pluggable RPC framework for writing microservices
API - API gateway. Translates HTTP to RPC. Path-to-Service resolution
Web - Dashboard and reverse proxy. Web apps as first class citizens
CLI - Command line interface. Straight forward. No frills.
Sidecar - HTTP interface with all the features of Go Micro
Bot - Hubot style bot for ChatOps. CLI Features. A bot? Really? Yea dude!
Go Micro RPC Framework
Registry - Service Discovery
Selector - Client side load balancer
Transport - Synchronous Communication
Broker - Asynchronous Communication
Codec - Message encoding
Client - RPC Client
Server - RPC Server
Why NATS?
Built for high performance and scale
Highly available - client and server side clustering
Extremely lightweight - written in Go, no persistence features
At most once delivery - fire and forget
Simple, focused and made for microservices
Written by Derek Collison, with two decades of experience building messaging systems
Micro on NATS NATS Plugins
Go-Micro has a pluggable architecture
Each feature written as a Go interface. Just implement the interface.
Integrate NATS using plugins for:
Registry - Service Discovery
Transport - Synchronous Communication
Broker - Asynchronous Communication
Transport Synchronous Communication
Handles request-response
Supports bidirectional streaming
Socket style semantics; Send(), Recv(), Close()
type Transport interface {
Dial(addr string, opts ...DialOption) (Client, error)
Listen(addr string, opts ...ListenOption) (Listener, error)
String() string
}
Transport
1. Server Listen - Subscribes to unique topic, wait for pseudo connections
2. Client Dial - Subscribes to unique topic, publishes to Server with reply topic set
3. Server Socket - Pseudo Socket created for every new “connection”
4. Client Socket - Same as server. Send() - Publish, Recv() - Subscribed messages
Broker Asynchronous Communication
Publish and Subscribe mechanism
Includes notion of Topics and Channels (Queues)
Distribute messages between subscribers
type Broker interface {
….
Connect() error
Disconnect() error
Publish(string, *Message, ...PublishOption) error
Subscribe(string, Handler, ...SubscribeOption) (Subscriber, error)
String() string
}
Broker
1. Subscribe - Register interest to Topic. Specify Queue to distribute messages
2. Publish - Asynchronously publish to Topic
3. Encoding - Broker encodes Message to JSON
Registry Service Discovery
Service discovery using a message bus? What magic is this?
type Registry interface {
Register(*Service, ...RegisterOption) error
Deregister(*Service) error
GetService(string) ([]*Service, error)
ListServices() ([]*Service, error)
Watch() (Watcher, error)
String() string
}
Broadcast Queries!
1. All services subscribe for queries on a broadcast topic
2. Publish query on broadcast topic with reply address
3. Instances of queried service respond
4. Wait for responses until upper time limit
5. Aggregate and return results
Scaling Like A Boss
Cluster per AZ or Region
Multi-AZ deployment
Fault tolerant of AZ failure
Pattern for high availability
Multi-region deployment
Use DNS latency based routing
Thanks for listening!
Micro on NATS blog post
blog.micro.mu/2016/04/11/micro-on-nats.html
Micro on GitHub Follow on Twitter!
github.com/micro @MicroHQ
Micro on Web Join the Slack community!
micro.mu slack.micro.mu
1 of 15

Recommended

NATS for Modern Messaging and Microservices by
NATS for Modern Messaging and MicroservicesNATS for Modern Messaging and Microservices
NATS for Modern Messaging and MicroservicesApcera
3.2K views37 slides
NATS + Docker meetup talk Oct - 2016 by
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016wallyqs
924 views86 slides
The Zen of High Performance Messaging with NATS (Strange Loop 2016) by
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)wallyqs
3.7K views90 slides
Microservices Meetup San Francisco - August 2017 Talk on NATS by
Microservices Meetup San Francisco - August 2017 Talk on NATSMicroservices Meetup San Francisco - August 2017 Talk on NATS
Microservices Meetup San Francisco - August 2017 Talk on NATSNATS
1.1K views79 slides
Simple Solutions for Complex Problems - Boulder Meetup by
Simple Solutions for Complex Problems - Boulder MeetupSimple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder MeetupApcera
668 views84 slides
How Clarifai uses NATS and Kubernetes for Machine Learning by
How Clarifai uses NATS and Kubernetes for Machine LearningHow Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine LearningApcera
1.5K views22 slides

More Related Content

What's hot

Handle Large Messages In Apache Kafka by
Handle Large Messages In Apache KafkaHandle Large Messages In Apache Kafka
Handle Large Messages In Apache KafkaJiangjie Qin
46.7K views59 slides
Implementing Microservices with NATS by
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATSApcera
2.4K views22 slides
Modern Distributed Messaging and RPC by
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPCMax Alexejev
18.4K views39 slides
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATS by
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATSDeploy Secure and Scalable Services Across Kubernetes Clusters with NATS
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATSNATS
2K views81 slides
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati... by
GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...wallyqs
1.6K views102 slides
KubeConEU - NATS Deep Dive by
KubeConEU - NATS Deep DiveKubeConEU - NATS Deep Dive
KubeConEU - NATS Deep Divewallyqs
2.1K views47 slides

What's hot(20)

Handle Large Messages In Apache Kafka by Jiangjie Qin
Handle Large Messages In Apache KafkaHandle Large Messages In Apache Kafka
Handle Large Messages In Apache Kafka
Jiangjie Qin46.7K views
Implementing Microservices with NATS by Apcera
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
Apcera2.4K views
Modern Distributed Messaging and RPC by Max Alexejev
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
Max Alexejev18.4K views
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATS by NATS
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATSDeploy Secure and Scalable Services Across Kubernetes Clusters with NATS
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATS
NATS2K views
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati... by wallyqs
GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
wallyqs1.6K views
KubeConEU - NATS Deep Dive by wallyqs
KubeConEU - NATS Deep DiveKubeConEU - NATS Deep Dive
KubeConEU - NATS Deep Dive
wallyqs2.1K views
NATS Connect Live | NATS as a Service Mesh by NATS
NATS Connect Live | NATS as a Service MeshNATS Connect Live | NATS as a Service Mesh
NATS Connect Live | NATS as a Service Mesh
NATS264 views
Developing Realtime Data Pipelines With Apache Kafka by Joe Stein
Developing Realtime Data Pipelines With Apache KafkaDeveloping Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache Kafka
Joe Stein4.9K views
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi... by StreamNative
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
StreamNative318 views
What's New in Apache Pulsar 2.9- Pulsar Summit Asia 2021 by StreamNative
What's New in Apache Pulsar 2.9- Pulsar Summit Asia 2021What's New in Apache Pulsar 2.9- Pulsar Summit Asia 2021
What's New in Apache Pulsar 2.9- Pulsar Summit Asia 2021
StreamNative94 views
How Apache Pulsar Helps Tencent Process Tens of Billions of Transactions Effi... by StreamNative
How Apache Pulsar Helps Tencent Process Tens of Billions of Transactions Effi...How Apache Pulsar Helps Tencent Process Tens of Billions of Transactions Effi...
How Apache Pulsar Helps Tencent Process Tens of Billions of Transactions Effi...
StreamNative426 views
Zebus - Pitfalls of a P2P service bus by Kévin LOVATO
Zebus - Pitfalls of a P2P service busZebus - Pitfalls of a P2P service bus
Zebus - Pitfalls of a P2P service bus
Kévin LOVATO1K views
Apache kafka by Rahul Jain
Apache kafkaApache kafka
Apache kafka
Rahul Jain24.2K views
High-speed, Reactive Microservices 2017 by Rick Hightower
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017
Rick Hightower2.3K views
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era by wallyqs
NATS: Simple, Secure and Scalable Messaging For the Cloud Native EraNATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
wallyqs2.5K views
Kafka as Message Broker by Haluan Irsad
Kafka as Message BrokerKafka as Message Broker
Kafka as Message Broker
Haluan Irsad3.9K views
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ... by Brian O'Neill
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
Brian O'Neill2.3K views
Apache Kafka - Messaging System Overview by Dmitry Tolpeko
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System Overview
Dmitry Tolpeko3.2K views

Similar to Micro on NATS - Microservices with Messaging

Intro to Azure Service Bus by
Intro to Azure Service BusIntro to Azure Service Bus
Intro to Azure Service BusGeorge Grammatikos
285 views19 slides
Brokered Messaging in Windows Azure by
Brokered Messaging in Windows AzureBrokered Messaging in Windows Azure
Brokered Messaging in Windows AzureNeil Mackenzie
2.5K views30 slides
SOAP--Simple Object Access Protocol by
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolMasud Rahman
2.8K views33 slides
CocoaConf: The Language of Mobile Software is APIs by
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsTim Burks
473 views106 slides
Chat app case study - xmpp vs SIP by
Chat app case study - xmpp vs SIPChat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIPGenora Infotech
689 views19 slides
SOAP Services by
SOAP ServicesSOAP Services
SOAP ServicesShahid Shaik
119 views25 slides

Similar to Micro on NATS - Microservices with Messaging(20)

Brokered Messaging in Windows Azure by Neil Mackenzie
Brokered Messaging in Windows AzureBrokered Messaging in Windows Azure
Brokered Messaging in Windows Azure
Neil Mackenzie2.5K views
SOAP--Simple Object Access Protocol by Masud Rahman
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
Masud Rahman2.8K views
CocoaConf: The Language of Mobile Software is APIs by Tim Burks
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
Tim Burks473 views
Chat app case study - xmpp vs SIP by Genora Infotech
Chat app case study - xmpp vs SIPChat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIP
Genora Infotech689 views
Session 1: The SOAP Story by ukdpe
Session 1: The SOAP StorySession 1: The SOAP Story
Session 1: The SOAP Story
ukdpe581 views
Chat server nitish nagar by Nitish Nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
Nitish Nagar2.4K views
What I learned about APIs in my first year at Google by Tim Burks
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
Tim Burks491 views
AndroidThing (Internet of things) by Mayur Solanki
AndroidThing (Internet of things)AndroidThing (Internet of things)
AndroidThing (Internet of things)
Mayur Solanki83 views
Web services Concepts by pasam suresh
Web services ConceptsWeb services Concepts
Web services Concepts
pasam suresh125 views
video conference (peer to peer) by mohamed amr
video conference (peer to peer)video conference (peer to peer)
video conference (peer to peer)
mohamed amr916 views
Real-time Web with Rails and XMPP by Li Cai
Real-time Web with Rails and XMPPReal-time Web with Rails and XMPP
Real-time Web with Rails and XMPP
Li Cai4.5K views
AK 3 web services using apache axis by gauravashq
AK 3   web services using apache axisAK 3   web services using apache axis
AK 3 web services using apache axis
gauravashq2.3K views
REST APIs and MQ by Matt Leming
REST APIs and MQREST APIs and MQ
REST APIs and MQ
Matt Leming5.8K views

More from Apcera

Gopher fest 2017: Adding Context To NATS by
Gopher fest 2017: Adding Context To NATSGopher fest 2017: Adding Context To NATS
Gopher fest 2017: Adding Context To NATSApcera
495 views47 slides
Modernizing IT in the Platform Era by
Modernizing IT in the Platform EraModernizing IT in the Platform Era
Modernizing IT in the Platform EraApcera
684 views22 slides
Debugging Network Issues by
Debugging Network IssuesDebugging Network Issues
Debugging Network IssuesApcera
728 views57 slides
IT Modernization Doesn’t Mean You Leave Your Legacy Apps Behind by
IT Modernization Doesn’t Mean You Leave Your Legacy Apps BehindIT Modernization Doesn’t Mean You Leave Your Legacy Apps Behind
IT Modernization Doesn’t Mean You Leave Your Legacy Apps BehindApcera
1.2K views16 slides
How Greta uses NATS to revolutionize data distribution on the Internet by
How Greta uses NATS to revolutionize data distribution on the InternetHow Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the InternetApcera
760 views21 slides
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm by
Simple and Scalable Microservices: Using NATS with Docker Compose and SwarmSimple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and SwarmApcera
4.9K views86 slides

More from Apcera(20)

Gopher fest 2017: Adding Context To NATS by Apcera
Gopher fest 2017: Adding Context To NATSGopher fest 2017: Adding Context To NATS
Gopher fest 2017: Adding Context To NATS
Apcera495 views
Modernizing IT in the Platform Era by Apcera
Modernizing IT in the Platform EraModernizing IT in the Platform Era
Modernizing IT in the Platform Era
Apcera684 views
Debugging Network Issues by Apcera
Debugging Network IssuesDebugging Network Issues
Debugging Network Issues
Apcera728 views
IT Modernization Doesn’t Mean You Leave Your Legacy Apps Behind by Apcera
IT Modernization Doesn’t Mean You Leave Your Legacy Apps BehindIT Modernization Doesn’t Mean You Leave Your Legacy Apps Behind
IT Modernization Doesn’t Mean You Leave Your Legacy Apps Behind
Apcera1.2K views
How Greta uses NATS to revolutionize data distribution on the Internet by Apcera
How Greta uses NATS to revolutionize data distribution on the InternetHow Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet
Apcera760 views
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm by Apcera
Simple and Scalable Microservices: Using NATS with Docker Compose and SwarmSimple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Apcera4.9K views
The Zen of High Performance Messaging with NATS by Apcera
The Zen of High Performance Messaging with NATSThe Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS
Apcera3.6K views
Actor Patterns and NATS - Boulder Meetup by Apcera
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
Apcera2.4K views
NATS Connector Framework - Boulder Meetup by Apcera
NATS Connector Framework - Boulder MeetupNATS Connector Framework - Boulder Meetup
NATS Connector Framework - Boulder Meetup
Apcera759 views
Patterns for Asynchronous Microservices with NATS by Apcera
Patterns for Asynchronous Microservices with NATSPatterns for Asynchronous Microservices with NATS
Patterns for Asynchronous Microservices with NATS
Apcera1.5K views
NATS vs HTTP by Apcera
NATS vs HTTPNATS vs HTTP
NATS vs HTTP
Apcera3.1K views
NATS: A Central Nervous System for IoT Messaging - Larry McQueary by Apcera
NATS: A Central Nervous System for IoT Messaging - Larry McQuearyNATS: A Central Nervous System for IoT Messaging - Larry McQueary
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
Apcera4.2K views
Securing the Cloud Native Stack by Apcera
Securing the Cloud Native StackSecuring the Cloud Native Stack
Securing the Cloud Native Stack
Apcera716 views
Simple Solutions for Complex Problems by Apcera
Simple Solutions for Complex Problems Simple Solutions for Complex Problems
Simple Solutions for Complex Problems
Apcera7.3K views
How to Migrate to Cloud with Complete Confidence and Trust by Apcera
How to Migrate to Cloud with Complete Confidence and TrustHow to Migrate to Cloud with Complete Confidence and Trust
How to Migrate to Cloud with Complete Confidence and Trust
Apcera691 views
KURMA - A Containerized Container Platform - KubeCon 2016 by Apcera
KURMA - A Containerized Container Platform - KubeCon 2016KURMA - A Containerized Container Platform - KubeCon 2016
KURMA - A Containerized Container Platform - KubeCon 2016
Apcera2.8K views
Integration Patterns and Anti-Patterns for Microservices Architectures by Apcera
Integration Patterns and Anti-Patterns for Microservices ArchitecturesIntegration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices Architectures
Apcera8.6K views
NATS: Control Flow for Distributed Systems by Apcera
NATS: Control Flow for Distributed SystemsNATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed Systems
Apcera2.7K views
Kubernetes, The Day After by Apcera
Kubernetes, The Day AfterKubernetes, The Day After
Kubernetes, The Day After
Apcera2.7K views
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World by Apcera
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud WorldPolicy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Apcera1.1K views

Recently uploaded

DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...ShapeBlue
98 views29 slides
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPoolShapeBlue
84 views10 slides
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TShapeBlue
112 views34 slides
Data Integrity for Banking and Financial Services by
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial ServicesPrecisely
78 views26 slides
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...ShapeBlue
154 views62 slides
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...ShapeBlue
117 views25 slides

Recently uploaded(20)

DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue98 views
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by ShapeBlue
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool
ShapeBlue84 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue112 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely78 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue154 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue117 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue94 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue88 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li80 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson156 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash153 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE69 views
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue132 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue140 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue120 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue138 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue253 views

Micro on NATS - Microservices with Messaging

  • 2. Who am I? Asim Aslam Working on Micro Previously at Hailo Before then Google @chuhnk asimaslam.com
  • 3. What is Micro? A microservice ecosystem Simplifying building and managing distributed systems What does that even mean? Building OSS tools that make it easier to write and run micro service applications Written in Go 100% Open Source
  • 4. Micro A Microservice Toolkit Go Micro - Pluggable RPC framework for writing microservices API - API gateway. Translates HTTP to RPC. Path-to-Service resolution Web - Dashboard and reverse proxy. Web apps as first class citizens CLI - Command line interface. Straight forward. No frills. Sidecar - HTTP interface with all the features of Go Micro Bot - Hubot style bot for ChatOps. CLI Features. A bot? Really? Yea dude!
  • 5. Go Micro RPC Framework Registry - Service Discovery Selector - Client side load balancer Transport - Synchronous Communication Broker - Asynchronous Communication Codec - Message encoding Client - RPC Client Server - RPC Server
  • 6. Why NATS? Built for high performance and scale Highly available - client and server side clustering Extremely lightweight - written in Go, no persistence features At most once delivery - fire and forget Simple, focused and made for microservices Written by Derek Collison, with two decades of experience building messaging systems
  • 7. Micro on NATS NATS Plugins Go-Micro has a pluggable architecture Each feature written as a Go interface. Just implement the interface. Integrate NATS using plugins for: Registry - Service Discovery Transport - Synchronous Communication Broker - Asynchronous Communication
  • 8. Transport Synchronous Communication Handles request-response Supports bidirectional streaming Socket style semantics; Send(), Recv(), Close() type Transport interface { Dial(addr string, opts ...DialOption) (Client, error) Listen(addr string, opts ...ListenOption) (Listener, error) String() string }
  • 9. Transport 1. Server Listen - Subscribes to unique topic, wait for pseudo connections 2. Client Dial - Subscribes to unique topic, publishes to Server with reply topic set 3. Server Socket - Pseudo Socket created for every new “connection” 4. Client Socket - Same as server. Send() - Publish, Recv() - Subscribed messages
  • 10. Broker Asynchronous Communication Publish and Subscribe mechanism Includes notion of Topics and Channels (Queues) Distribute messages between subscribers type Broker interface { …. Connect() error Disconnect() error Publish(string, *Message, ...PublishOption) error Subscribe(string, Handler, ...SubscribeOption) (Subscriber, error) String() string }
  • 11. Broker 1. Subscribe - Register interest to Topic. Specify Queue to distribute messages 2. Publish - Asynchronously publish to Topic 3. Encoding - Broker encodes Message to JSON
  • 12. Registry Service Discovery Service discovery using a message bus? What magic is this? type Registry interface { Register(*Service, ...RegisterOption) error Deregister(*Service) error GetService(string) ([]*Service, error) ListServices() ([]*Service, error) Watch() (Watcher, error) String() string }
  • 13. Broadcast Queries! 1. All services subscribe for queries on a broadcast topic 2. Publish query on broadcast topic with reply address 3. Instances of queried service respond 4. Wait for responses until upper time limit 5. Aggregate and return results
  • 14. Scaling Like A Boss Cluster per AZ or Region Multi-AZ deployment Fault tolerant of AZ failure Pattern for high availability Multi-region deployment Use DNS latency based routing
  • 15. Thanks for listening! Micro on NATS blog post blog.micro.mu/2016/04/11/micro-on-nats.html Micro on GitHub Follow on Twitter! github.com/micro @MicroHQ Micro on Web Join the Slack community! micro.mu slack.micro.mu