Brian Ketelsen - Microservices in Go using Micro - Codemotion Milan 2017

22

Transcript of Brian Ketelsen - Microservices in Go using Micro - Codemotion Milan 2017

Microservices in Go with MicroBrian KetelsenCloud Developer Advocate, Microsoft

Microservices in Go Using Micro

https://micro.mu (Micro)

About Me

Co-Host gotime.fm weekly podcast

Co-Author "Go In Action" from Manning Press

Co-Organizer - GopherCon, Largest Go Conference in the World

This Talk

In this talk we will go from 0 to distributed microservices in less than an hour.

Buckle up Buttercup!

Buckle up, Buttercup!

Micro Is An Ecosystem

Framework

Toolkit

Pluggable Layers

Plugins Everywhere

message broker

encoding/decoding

transport

metrics

Nearly every choice in micro has a sane default and many optional replacements.

Abstractions

Broker

Transportation for events. Micro can emit events, and interested services can consumethem and react.

HTTP (default)

Google PubSub

Kafka

MQTT

NATS

NSQ

RabbitMQ

Redis

Amazon SQS

Codec

Encoding of messages before transport.

bsonrpc

jsonrpc

jsonrpc2

mercury

msgpackrpc

protorpc (default)

Registry

Service Discovery

consul (default)

etcd 2 or 3

Eureka

gossip

kubernetes

mdns (Multicast DNS)

NATS

zookeeper

Selector

How clients choose an instance of a service.

blacklist -- circuit breaker pattern for selecting service instances

cache -- random hash choice

label -- priority based labels, use for prioritized selection

named -- use with message bus/queue transport

static -- for use with upstream balancing

Transport

Physical transport of messages.

grpc

http (default)

NATS

RabbitMQ

TCP

UTP (UDP variation of BitTorrent protocol)

Batteries Included

All of these choices can be overwhelming, but Micro defaults are perfect for development.

In production, you can change any of the options without changing your code.

Demo

New Microservice

Demo

Calling a Service

Demo

More complex deployment

Authentication Service

Web Application with protected pages

Demo

Add Pro�les!

Demo

Distributed Tracing

OpenTracing

Demo

Managing from Slack

Demo

Custom Bot Commands

Thank you

Brian KetelsenCloud Developer Advocate, [email protected] (mailto:[email protected])

https://brianketelsen.com (https://brianketelsen.com)

@bketelsen (http://twitter.com/bketelsen)