SlideShare une entreprise Scribd logo
1  sur  70
Télécharger pour lire hors ligne
import golang;
struct Microservice
Giulio De Donato - Giorgio Cefaro
rate our talk!
https://joind.in/14104
Giorgio Cefaro
Freelance Software Engineer
@giorrrgio
Giulio De Donato
CTO @ chupamobile
@liuggio
Once upon a time ... Monolith
BIG complex problem
vs
lots of small simple problems
MICROSERVICES:
While there is no precise definition of this architectural style,
there are certain common characteristics around
organization around business capability,
automated deployment, intelligence in the
endpoints, and decentralized control of languages
and data.
-- martin fowler
How small is “micro”?
php
ruby
nodejs
golang
scala
golang
GOLANG
Why we chose it
GOLANG
Go programs are statically compiled
Go compiler target multiple platforms
and architectures
Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Plan 9, and Microsoft
Windows OS and i386, amd64, ARM and IBM POWER architectures
are currently supported
GOLANG - PLATFORMS AND ARCHITECTURES
NO EXTERNAL LIBRARIES
NO VIRTUAL MACHINES
JUST A STATIC EXECUTABLE
NO JIT-COMPILING
Concurrency is easy to implement
through GOROUTINES , each goroutine
having a SMALL FOOTPRINT of memory
and being MULTIPLEXED through OS
threads to avoid that blocking routines
can block other running goroutines
GOLANG - CONCURRENCY
Go supports modern web technologies
through a set of bundled packages,
ready to import.
archive, bufio, builtin, bytes, compress, container, crypto,
database, debug, encoding, errors, expvar, flag, fmt, go,
hash, html, image, index, io, log, math, mime, net, os, path,
reflect, regexp, runtime, sort, strconv, strings, suffixarray, sync,
syscall, testing, text, time, unicode, unsafe
GOLANG - PACKAGES
// hello_codemotion.go
package main
import "fmt"
func main() {
// Create a channel to synchronize goroutines
done := make(chan bool)
// Execute println in goroutine
go func() {
fmt.Println("Hello Codemotion")
// Tell the main function everything is done.
// This channel is visible inside this goroutine because
// it is executed in the same address space.
done <- true
}()
fmt.Println("Bye Codemotion")
<-done // Wait for the goroutine to finish. what if we
// remove it?
}
$ go build hello_codemotion.go
$ ./hello_codemotion
Bye Codemotion
Hello Codemotion
Even if we run the goroutine that will print
the “Hello” as first, its output will be echoed
once it is synchronized with main (the “<-
done” final line)
Network I/O is supported through the
net package, which comes with TCP/IP,
UDP, DNS, and Unix domain socket
components.
Low level support is provided, but you
will probably only need Dial, Accept and
Listen
GOLANG - COMMUNICATION
The net/http package provides http
client and server implementations.
Building a web server is quite easy!
GOLANG - COMMUNICATION
package main
import "net/http"
import "log"
import "fmt"
func main() {
http.HandleFunc("/hello", func(w http.ResponseWriter, r
*http.Request) {
fmt.Fprintln(w, "Hello, Codemotion!")
})
log.Fatal(http.ListenAndServe(":8080", nil))
}
The encoding package provides
interfaces shared by other packages
that convert data to and from byte-level
and textual representations:
encoding/json
encoding/xml
encoding/gob
GOLANG - COMMUNICATION
type Message struct {
Name string
Body string
Time int64
}
m := Message{"Codemotion", "Hello", 1294706395881547000}
b, err := json.Marshal(m)
// b will be
// {"Name":"Alice","Body":"Hello","Time":1294706395881547000}
encoding/json package provides structures
to read and write JSON data
type Foo struct {
A, B int64
}
func main() {
conn, err := net.Dial("tcp", "localhost:8080")
if err != nil {
log.Fatal("Connection error", err)
}
encoder := gob.NewEncoder(conn)
foo := &Foo{1, 2}
encoder.Encode(foo)
conn.Close()
}
encoding/gob package provides native
golang RPC with binary transmission of
structures
INTERFACE
ALL THE THINGS
explicit is always better than implicit
Expose behaviour
Interface all the things
cat access.log | grep “porn” | wc -l
HTTP WINS
WEB FRAMEWORKS
HTTP FRAMEWORKS
GOLANG
HTTP INTERFACE
type Handler interface {
ServeHTTP(ResponseWriter, *Request)
}
type Handler interface {
ServeHTTP(http.ResponseWriter,*http.Request)
}
// handlerFunc
func(http.ResponseWriter,*http.Request)
handler := http.HandlerFunc(handlerFunc)
handler.ServeHTTP(w, r)
Interface
func
trick
Unit test on handlers
Huge handler
Compositions
Higher-order function
EXECUTE handlerFunc
//0 START
//1 START
//2 START
Controller
//2 END
//1 END
//0 END
middleware
● logger request logger with custom format support
● csrf Cross-site request forgery protection
● compress Gzip compression middleware
● basicAuth basic http authentication
● bodyParser extensible request body parser
● json application/json parser
● urlencoded application/x-www-form-urlencoded parser
● multipart multipart/form-data parser
● timeout request timeouts
● cookieParser cookie parser
● session session management support with bundled MemoryStore
● cookieSession cookie-based session support
● methodOverride faux HTTP method support
● responseTime calculates response-time and exposes via X-Response-Time
● staticCache memory cache layer for the static() middleware
● static streaming static file server supporting Range and more
● directory directory listing middleware
● vhost virtual host sub-domain mapping middleware
● favicon efficient favicon server (with default icon)
● limit limit the bytesize of request bodies
● query automatic querystring parser, populating req.query
● errorHandler flexible error handler
● …. many more
middleware
middleware
HTTP2
The future is already arrived —
it's just not very evenly
distributed
-- william gibson
Microservices need AUTOMATION
AUTOMATION
Build, Deploy, Scale
ARCHITECTURE - DOCKER
ARCHITECTURE - DOCKER
Docker is an open-source project that
automates the deployment of
applications inside software containers.
http://en.wikipedia.org/wiki/Docker_(software)
ARCHITECTURE - DOCKER
Docker allows independent "containers"
to run within a single Linux instance,
avoiding the overhead of starting virtual
machines.
http://en.wikipedia.org/wiki/Docker_(software)
# Dockerfile
# golang image where workspace (GOPATH) configured at /go.
FROM golang:1.4-onbuild
EXPOSE 3000
A container can be configured through a
Dockerfile
In this basic configuration, we specify that
our image is derived FROM the golang
image, available through the Docker Hub,
and that our container will EXPOSE port
3000
https://docs.docker.com/reference/builder/
$ sudo docker build -t codemotion_container .
The golang image is a great solution for go
microservices, it is configured to take care of
compiling our program and copy it inside the
container, ready to go with a single
command. Cross compiling is supported too!
https://registry.hub.docker.com/_/golang/
Microservices need AUTOMATION
Microservices need ORCHESTRATION
ARCHITECTURE - DOCKER ORCHESTRATION TOOLS
http://blog.docker.com/2015/02/orchestrating-docker-with-machine-swarm-and-compose/
◇ Provision Docker on any infrastructure, from
laptop to public cloud instance
◇ Compose an app using both proprietary
containers and Docker Hub Official Repos
◇ Manage all containers of an app as a single
group
◇ Cluster an application’s containers to optimize
resources and provide high-availability
ARCHITECTURE - DOCKER MACHINE
http://blog.docker.com/2015/02/announcing-docker-machine-beta/
◇ Provision Docker Engines across various
providers both local and remote, secured with
TLS, or not.
◇ Lightweight management of machines: Starting,
stopping, removing, etc.
◇ Run remote commands or log in to machines
via SSH
◇ Upgrade the Docker Engine when a new version
is released
$ docker-machine create -d virtualbox dev
[info] Downloading boot2docker...
[info] Creating SSH key...
[info] Creating VirtualBox VM…
[...]
$ docker run busybox echo hello world
hello world
With Machine docker hosts can be spawned
and controlled on different computers and
virtual machines from you local docker
client. Different clouds too!
Machine supports Amazon EC2, Microsoft Azure, Microsoft Hyper-V
DigitalOcean, Google Compute Engine, OpenStack, Rackspace, SoftLayer,
VirtualBox, VMware Fusion, VMware vCloud Air, VMware vSphere and
counting!
ARCHITECTURE - DOCKER SWARM
http://blog.docker.com/2015/02/scaling-docker-with-swarm/
◇ Native clustering for Docker
◇ Swarm is a standard Docker image
◇ Run one command to create a cluster.
◇ Run another command to start Swarm.
◇ On each host where the Docker Engine is
running, run a command to join said cluster.
$ docker run swarm create
5d9bc2f39ccc00500b36f23d90994f5f # <- cluster_id
# swarm master
$ docker-machine create -d virtualbox --swarm --swarm-master --
swarm-discovery token://5d9bc2f39ccc00500b36f23d90994f5f my-
swarm
# swarm nodes
$ docker-machine create -d virtualbox --swarm --swarm-discovery
token://5d9bc2f39ccc00500b36f23d90994f5f my-swarm-node1
$ docker-machine create -d virtualbox --swarm --swarm-discovery
token://5d9bc2f39ccc00500b36f23d90994f5f my-swarm-node3
$ docker run -d --name redis_1 -e ‘affinity:container!=redis_*’ redis
$ docker run -d --name redis_2 -e ‘affinity:container!=redis_*’ redis
Run two redis servers, but don’t run both on
the same machine:
Add a constraint on the type of storage, we
want a machine that has SSD storage:
$ docker run -d -e constraint:storage==ssd mysql
ARCHITECTURE - DOCKER COMPOSE
https://blog.docker.com/2015/02/announcing-docker-compose/
◇ Define your application’s components in a
single file
◇ Start, stop, and rebuild services
◇ View the status of running services
◇ Stream the log output of running services
◇ Run a one-off command on a service
# docker-compose.yml
cart:
build: ./cart
links:
- redis
ports:
- "5000:5000"
shipment:
build: ./shipment
links:
- mongo
ports:
- "5000:5000"
redis:
image: redis
mongo:
image: mongodb
Microservices need MONITORING
MONITORING - SOUNDCLOUD’S PROMETHEUS
http://5pi.de/2015/01/26/monitor-docker-containers-with-prometheus/
◇ Recently open-sourced by SoundCloud
◇ Written in GO with native client for in-
application monitoring
◇ Easy docker container monitoring
◇ Highly dimensional data model
◇ Flexible query language
◇ Powerful metrics types
◇ Alerting on any expression
◇ No fracking dependencies
$ docker run -p 9090:9090 prom/prometheus
CREDITS
http://en.wikipedia.org/wiki/List_of_largest_monoliths_in_the_world
https://www.flickr.com/photos/robwatling/3411172879
https://www.flickr.com/photos/dsevilla/139656712 FLOWER
https://www.flickr.com/photos/nickpiggott/5212359135 BRICKS
https://vimeo.com/105751281 PCFMA
http://www.youtube.com/watch?v=QY8mL6WARIE HTTP interface is a lie
http://martinfowler.com/articles/consumerDrivenContracts.html
http://www.infoq.com/news/2014/07/building-deploying-microservices
https://talks.golang.org/2014/readability.slide#27
http://www.morewords.com/contains/go/
http://martinfowler.com/articles/microservices.html (come non citarlo :))
https://blog.golang.org/docker (figata che docker ha il suo env golang)
https://speakerdeck.com/stilkov/microservices-talk-berlin
http://www.infoq.com/articles/microservices-practical-tips
http://nginx.com/blog/microservices-at-netflix-architectural-best-practices/
http://www.reddit.
com/r/golang/comments/252wjh/are_you_using_golang_for_webapi_development_what/
https://justinas.org/embrace-gos-http-tools/
https://news.ycombinator.com/item?id=6869710
https://crate.io/blog/deploying-crate-with-docker-machine-swarm/
THERE’S NO GOOD TALK WITH NO REFERENCES
JOIN GOLANGIT!
http://goo.gl/9am5vO
https://joind.in/14104
Questions? Answers?

Contenu connexe

Tendances

Docker 導入:障礙與對策
Docker 導入:障礙與對策Docker 導入:障礙與對策
Docker 導入:障礙與對策William Yeh
 
Docker for PHP Developers (NomadPHP)
Docker for PHP Developers (NomadPHP)Docker for PHP Developers (NomadPHP)
Docker for PHP Developers (NomadPHP)Chris Tankersley
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingRed Hat Developers
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...Docker, Inc.
 
Automated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesAutomated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesGraham Dumpleton
 
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017Chris Tankersley
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)Eric D. Schabell
 
Let's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateLet's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateSteffen Gebert
 
Joomla Continuous Delivery with Docker
Joomla Continuous Delivery with DockerJoomla Continuous Delivery with Docker
Joomla Continuous Delivery with DockerJirayut Nimsaeng
 
Jenkins Shared Libraries Workshop
Jenkins Shared Libraries WorkshopJenkins Shared Libraries Workshop
Jenkins Shared Libraries WorkshopJulien Pivotto
 
Social Connections 14 - ICS Integration with Node-RED and Open Source
Social Connections 14 - ICS Integration with Node-RED and Open SourceSocial Connections 14 - ICS Integration with Node-RED and Open Source
Social Connections 14 - ICS Integration with Node-RED and Open SourcePaul Withers
 
RootedCON 2017 - Docker might not be your friend. Trojanizing Docker images
RootedCON 2017 - Docker might not be your friend. Trojanizing Docker imagesRootedCON 2017 - Docker might not be your friend. Trojanizing Docker images
RootedCON 2017 - Docker might not be your friend. Trojanizing Docker imagesDaniel Garcia (a.k.a cr0hn)
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Chris Tankersley
 
Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)bridgetkromhout
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopJirayut Nimsaeng
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsAll Things Open
 
drone continuous Integration
drone continuous Integrationdrone continuous Integration
drone continuous IntegrationBo-Yi Wu
 
Dockerize Laravel Application
Dockerize Laravel ApplicationDockerize Laravel Application
Dockerize Laravel ApplicationAfrimadoni Dinata
 
DockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @OrbitzDockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @OrbitzDocker, Inc.
 

Tendances (20)

Docker 導入:障礙與對策
Docker 導入:障礙與對策Docker 導入:障礙與對策
Docker 導入:障礙與對策
 
Docker for PHP Developers (NomadPHP)
Docker for PHP Developers (NomadPHP)Docker for PHP Developers (NomadPHP)
Docker for PHP Developers (NomadPHP)
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scripting
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
 
Automated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and KubernetesAutomated Image Builds in OpenShift and Kubernetes
Automated Image Builds in OpenShift and Kubernetes
 
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 
Let's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateLet's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a Certificate
 
Joomla Continuous Delivery with Docker
Joomla Continuous Delivery with DockerJoomla Continuous Delivery with Docker
Joomla Continuous Delivery with Docker
 
Jenkins Shared Libraries Workshop
Jenkins Shared Libraries WorkshopJenkins Shared Libraries Workshop
Jenkins Shared Libraries Workshop
 
Social Connections 14 - ICS Integration with Node-RED and Open Source
Social Connections 14 - ICS Integration with Node-RED and Open SourceSocial Connections 14 - ICS Integration with Node-RED and Open Source
Social Connections 14 - ICS Integration with Node-RED and Open Source
 
RootedCON 2017 - Docker might not be your friend. Trojanizing Docker images
RootedCON 2017 - Docker might not be your friend. Trojanizing Docker imagesRootedCON 2017 - Docker might not be your friend. Trojanizing Docker images
RootedCON 2017 - Docker might not be your friend. Trojanizing Docker images
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016
 
Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery Workshop
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with Jenkins
 
drone continuous Integration
drone continuous Integrationdrone continuous Integration
drone continuous Integration
 
Dockerize Laravel Application
Dockerize Laravel ApplicationDockerize Laravel Application
Dockerize Laravel Application
 
DockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @OrbitzDockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @Orbitz
 

En vedette

MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService ArchitectureFred George
 
20150526 오픈업 mcn의 미래_명승은
20150526 오픈업 mcn의 미래_명승은20150526 오픈업 mcn의 미래_명승은
20150526 오픈업 mcn의 미래_명승은VentureSquare
 
[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance TuningJi-Woong Choi
 
Serialization and performance in Java
Serialization and performance in JavaSerialization and performance in Java
Serialization and performance in JavaStrannik_2013
 
Advanced nGrinder 2nd Edition
Advanced nGrinder 2nd EditionAdvanced nGrinder 2nd Edition
Advanced nGrinder 2nd EditionJunHo Yoon
 
[D2]java 성능에 대한 오해와 편견
[D2]java 성능에 대한 오해와 편견[D2]java 성능에 대한 오해와 편견
[D2]java 성능에 대한 오해와 편견NAVER D2
 
Micro Service Architecture 탐방기
Micro Service Architecture 탐방기Micro Service Architecture 탐방기
Micro Service Architecture 탐방기jbugkorea
 
Practical Machine Learning
Practical Machine LearningPractical Machine Learning
Practical Machine LearningDavid Jones
 
왜 레진코믹스는 구글앱엔진을 선택했나
왜 레진코믹스는 구글앱엔진을 선택했나왜 레진코믹스는 구글앱엔진을 선택했나
왜 레진코믹스는 구글앱엔진을 선택했나소리 강
 
공짜 경제에서 어떻게 돈을 버는가?(How to Make Money in Free Economy)
공짜 경제에서 어떻게 돈을 버는가?(How to Make Money in Free Economy)공짜 경제에서 어떻게 돈을 버는가?(How to Make Money in Free Economy)
공짜 경제에서 어떻게 돈을 버는가?(How to Make Money in Free Economy)Sangkyu Rho
 
Programming skills 1부
Programming skills 1부Programming skills 1부
Programming skills 1부JiHyung Lee
 
XECon+PHPFest2014 발표자료 - 효율적인 css 개발방법 - 최대영
XECon+PHPFest2014 발표자료 - 효율적인 css 개발방법 - 최대영XECon+PHPFest2014 발표자료 - 효율적인 css 개발방법 - 최대영
XECon+PHPFest2014 발표자료 - 효율적인 css 개발방법 - 최대영XpressEngine
 
Front end 웹사이트 성능 측정 및 개선
Front end 웹사이트 성능 측정 및 개선Front end 웹사이트 성능 측정 및 개선
Front end 웹사이트 성능 측정 및 개선기동 이
 
객체지향 개념 (쫌 아는체 하기)
객체지향 개념 (쫌 아는체 하기)객체지향 개념 (쫌 아는체 하기)
객체지향 개념 (쫌 아는체 하기)Seung-June Lee
 
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA) 오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA) Yongho Ha
 

En vedette (16)

MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
20150526 오픈업 mcn의 미래_명승은
20150526 오픈업 mcn의 미래_명승은20150526 오픈업 mcn의 미래_명승은
20150526 오픈업 mcn의 미래_명승은
 
[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning
 
Serialization and performance in Java
Serialization and performance in JavaSerialization and performance in Java
Serialization and performance in Java
 
Advanced nGrinder 2nd Edition
Advanced nGrinder 2nd EditionAdvanced nGrinder 2nd Edition
Advanced nGrinder 2nd Edition
 
[D2]java 성능에 대한 오해와 편견
[D2]java 성능에 대한 오해와 편견[D2]java 성능에 대한 오해와 편견
[D2]java 성능에 대한 오해와 편견
 
Micro Service Architecture 탐방기
Micro Service Architecture 탐방기Micro Service Architecture 탐방기
Micro Service Architecture 탐방기
 
Practical Machine Learning
Practical Machine LearningPractical Machine Learning
Practical Machine Learning
 
왜 레진코믹스는 구글앱엔진을 선택했나
왜 레진코믹스는 구글앱엔진을 선택했나왜 레진코믹스는 구글앱엔진을 선택했나
왜 레진코믹스는 구글앱엔진을 선택했나
 
공짜 경제에서 어떻게 돈을 버는가?(How to Make Money in Free Economy)
공짜 경제에서 어떻게 돈을 버는가?(How to Make Money in Free Economy)공짜 경제에서 어떻게 돈을 버는가?(How to Make Money in Free Economy)
공짜 경제에서 어떻게 돈을 버는가?(How to Make Money in Free Economy)
 
From SOA to MSA
From SOA to MSAFrom SOA to MSA
From SOA to MSA
 
Programming skills 1부
Programming skills 1부Programming skills 1부
Programming skills 1부
 
XECon+PHPFest2014 발표자료 - 효율적인 css 개발방법 - 최대영
XECon+PHPFest2014 발표자료 - 효율적인 css 개발방법 - 최대영XECon+PHPFest2014 발표자료 - 효율적인 css 개발방법 - 최대영
XECon+PHPFest2014 발표자료 - 효율적인 css 개발방법 - 최대영
 
Front end 웹사이트 성능 측정 및 개선
Front end 웹사이트 성능 측정 및 개선Front end 웹사이트 성능 측정 및 개선
Front end 웹사이트 성능 측정 및 개선
 
객체지향 개념 (쫌 아는체 하기)
객체지향 개념 (쫌 아는체 하기)객체지향 개념 (쫌 아는체 하기)
객체지향 개념 (쫌 아는체 하기)
 
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA) 오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
오늘 밤부터 쓰는 google analytics (구글 애널리틱스, GA)
 

Similaire à Import golang; struct microservice - Codemotion Rome 2015

Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with DockerAndrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with DockerAndrey Hristov
 
presentation @ docker meetup
presentation @ docker meetuppresentation @ docker meetup
presentation @ docker meetupDaniël van Gils
 
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)DynamicInfraDays
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET DevelopersTaswar Bhatti
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안양재동 코드랩
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Docker - Der Wal in der Kiste
Docker - Der Wal in der KisteDocker - Der Wal in der Kiste
Docker - Der Wal in der KisteUlrich Krause
 
Dockerize WordPress on Mac/Windows
Dockerize WordPress on Mac/WindowsDockerize WordPress on Mac/Windows
Dockerize WordPress on Mac/WindowsKite Koga
 
Docker Internet Money Gateway
Docker Internet Money GatewayDocker Internet Money Gateway
Docker Internet Money GatewayMathieu Buffenoir
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker composeLinkMe Srl
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios
 
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ....docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ...ICON UK EVENTS Limited
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with DockerPatrick Mizer
 
Docker
DockerDocker
DockerNarato
 
Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main
Introduction to Docker and Linux Containers @ Cloud Computing Rhein MainIntroduction to Docker and Linux Containers @ Cloud Computing Rhein Main
Introduction to Docker and Linux Containers @ Cloud Computing Rhein MainPuja Abbassi
 

Similaire à Import golang; struct microservice - Codemotion Rome 2015 (20)

Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
presentation @ docker meetup
presentation @ docker meetuppresentation @ docker meetup
presentation @ docker meetup
 
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Docker - Der Wal in der Kiste
Docker - Der Wal in der KisteDocker - Der Wal in der Kiste
Docker - Der Wal in der Kiste
 
Dockerize WordPress on Mac/Windows
Dockerize WordPress on Mac/WindowsDockerize WordPress on Mac/Windows
Dockerize WordPress on Mac/Windows
 
Docker 101 Checonf 2016
Docker 101 Checonf 2016Docker 101 Checonf 2016
Docker 101 Checonf 2016
 
Docker Internet Money Gateway
Docker Internet Money GatewayDocker Internet Money Gateway
Docker Internet Money Gateway
 
Docker img-no-disclosure
Docker img-no-disclosureDocker img-no-disclosure
Docker img-no-disclosure
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ....docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
Docker
DockerDocker
Docker
 
Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main
Introduction to Docker and Linux Containers @ Cloud Computing Rhein MainIntroduction to Docker and Linux Containers @ Cloud Computing Rhein Main
Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main
 

Plus de Giorgio Cefaro

Alexa, AWS lambda & wikidata (ITA)
Alexa, AWS lambda & wikidata (ITA)Alexa, AWS lambda & wikidata (ITA)
Alexa, AWS lambda & wikidata (ITA)Giorgio Cefaro
 
PHP object calisthenics
PHP object calisthenicsPHP object calisthenics
PHP object calisthenicsGiorgio Cefaro
 
I came, I saw, I GO! - Golangit meetup @ Codemotion Rome 2014
I came, I saw, I GO! - Golangit meetup @ Codemotion Rome 2014I came, I saw, I GO! - Golangit meetup @ Codemotion Rome 2014
I came, I saw, I GO! - Golangit meetup @ Codemotion Rome 2014Giorgio Cefaro
 
Nanos gigantium humeris insidentes (design patterns inside symfony 2)
Nanos gigantium humeris insidentes (design patterns inside symfony 2)Nanos gigantium humeris insidentes (design patterns inside symfony 2)
Nanos gigantium humeris insidentes (design patterns inside symfony 2)Giorgio Cefaro
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridGiorgio Cefaro
 
High Performance Web Apps con PHP e Symfony 2
High Performance Web Apps con PHP  e Symfony 2High Performance Web Apps con PHP  e Symfony 2
High Performance Web Apps con PHP e Symfony 2Giorgio Cefaro
 
An introduction to Symfony 2 for symfony 1 developers
An introduction to Symfony 2 for symfony 1 developersAn introduction to Symfony 2 for symfony 1 developers
An introduction to Symfony 2 for symfony 1 developersGiorgio Cefaro
 
Netbeans e Xdebug per debugging e profiling di applicazioni PHP
Netbeans e Xdebug per debugging e profiling di applicazioni PHPNetbeans e Xdebug per debugging e profiling di applicazioni PHP
Netbeans e Xdebug per debugging e profiling di applicazioni PHPGiorgio Cefaro
 

Plus de Giorgio Cefaro (11)

Alexa, AWS lambda & wikidata (ITA)
Alexa, AWS lambda & wikidata (ITA)Alexa, AWS lambda & wikidata (ITA)
Alexa, AWS lambda & wikidata (ITA)
 
PHP object calisthenics
PHP object calisthenicsPHP object calisthenics
PHP object calisthenics
 
Don't fear the rebase
Don't fear the rebaseDon't fear the rebase
Don't fear the rebase
 
jsDay 2016 recap
jsDay 2016 recapjsDay 2016 recap
jsDay 2016 recap
 
I came, I saw, I GO! - Golangit meetup @ Codemotion Rome 2014
I came, I saw, I GO! - Golangit meetup @ Codemotion Rome 2014I came, I saw, I GO! - Golangit meetup @ Codemotion Rome 2014
I came, I saw, I GO! - Golangit meetup @ Codemotion Rome 2014
 
Nanos gigantium humeris insidentes (design patterns inside symfony 2)
Nanos gigantium humeris insidentes (design patterns inside symfony 2)Nanos gigantium humeris insidentes (design patterns inside symfony 2)
Nanos gigantium humeris insidentes (design patterns inside symfony 2)
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
 
High Performance Web Apps con PHP e Symfony 2
High Performance Web Apps con PHP  e Symfony 2High Performance Web Apps con PHP  e Symfony 2
High Performance Web Apps con PHP e Symfony 2
 
From LAMP to LNNP
From LAMP to LNNPFrom LAMP to LNNP
From LAMP to LNNP
 
An introduction to Symfony 2 for symfony 1 developers
An introduction to Symfony 2 for symfony 1 developersAn introduction to Symfony 2 for symfony 1 developers
An introduction to Symfony 2 for symfony 1 developers
 
Netbeans e Xdebug per debugging e profiling di applicazioni PHP
Netbeans e Xdebug per debugging e profiling di applicazioni PHPNetbeans e Xdebug per debugging e profiling di applicazioni PHP
Netbeans e Xdebug per debugging e profiling di applicazioni PHP
 

Dernier

Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 

Dernier (20)

Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 

Import golang; struct microservice - Codemotion Rome 2015

  • 1. import golang; struct Microservice Giulio De Donato - Giorgio Cefaro rate our talk! https://joind.in/14104
  • 2. Giorgio Cefaro Freelance Software Engineer @giorrrgio
  • 3.
  • 4. Giulio De Donato CTO @ chupamobile @liuggio
  • 5. Once upon a time ... Monolith
  • 6. BIG complex problem vs lots of small simple problems
  • 7. MICROSERVICES: While there is no precise definition of this architectural style, there are certain common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data. -- martin fowler
  • 8. How small is “micro”?
  • 9.
  • 13. Go programs are statically compiled Go compiler target multiple platforms and architectures Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Plan 9, and Microsoft Windows OS and i386, amd64, ARM and IBM POWER architectures are currently supported GOLANG - PLATFORMS AND ARCHITECTURES
  • 14. NO EXTERNAL LIBRARIES NO VIRTUAL MACHINES JUST A STATIC EXECUTABLE NO JIT-COMPILING
  • 15. Concurrency is easy to implement through GOROUTINES , each goroutine having a SMALL FOOTPRINT of memory and being MULTIPLEXED through OS threads to avoid that blocking routines can block other running goroutines GOLANG - CONCURRENCY
  • 16. Go supports modern web technologies through a set of bundled packages, ready to import. archive, bufio, builtin, bytes, compress, container, crypto, database, debug, encoding, errors, expvar, flag, fmt, go, hash, html, image, index, io, log, math, mime, net, os, path, reflect, regexp, runtime, sort, strconv, strings, suffixarray, sync, syscall, testing, text, time, unicode, unsafe GOLANG - PACKAGES
  • 17. // hello_codemotion.go package main import "fmt" func main() { // Create a channel to synchronize goroutines done := make(chan bool) // Execute println in goroutine go func() { fmt.Println("Hello Codemotion") // Tell the main function everything is done. // This channel is visible inside this goroutine because // it is executed in the same address space. done <- true }() fmt.Println("Bye Codemotion") <-done // Wait for the goroutine to finish. what if we // remove it? }
  • 18. $ go build hello_codemotion.go $ ./hello_codemotion Bye Codemotion Hello Codemotion Even if we run the goroutine that will print the “Hello” as first, its output will be echoed once it is synchronized with main (the “<- done” final line)
  • 19. Network I/O is supported through the net package, which comes with TCP/IP, UDP, DNS, and Unix domain socket components. Low level support is provided, but you will probably only need Dial, Accept and Listen GOLANG - COMMUNICATION
  • 20. The net/http package provides http client and server implementations. Building a web server is quite easy! GOLANG - COMMUNICATION
  • 21. package main import "net/http" import "log" import "fmt" func main() { http.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Hello, Codemotion!") }) log.Fatal(http.ListenAndServe(":8080", nil)) }
  • 22. The encoding package provides interfaces shared by other packages that convert data to and from byte-level and textual representations: encoding/json encoding/xml encoding/gob GOLANG - COMMUNICATION
  • 23. type Message struct { Name string Body string Time int64 } m := Message{"Codemotion", "Hello", 1294706395881547000} b, err := json.Marshal(m) // b will be // {"Name":"Alice","Body":"Hello","Time":1294706395881547000} encoding/json package provides structures to read and write JSON data
  • 24. type Foo struct { A, B int64 } func main() { conn, err := net.Dial("tcp", "localhost:8080") if err != nil { log.Fatal("Connection error", err) } encoder := gob.NewEncoder(conn) foo := &Foo{1, 2} encoder.Encode(foo) conn.Close() } encoding/gob package provides native golang RPC with binary transmission of structures
  • 26. explicit is always better than implicit
  • 29. cat access.log | grep “porn” | wc -l
  • 30.
  • 33.
  • 34. GOLANG HTTP INTERFACE type Handler interface { ServeHTTP(ResponseWriter, *Request) }
  • 35. type Handler interface { ServeHTTP(http.ResponseWriter,*http.Request) } // handlerFunc func(http.ResponseWriter,*http.Request) handler := http.HandlerFunc(handlerFunc) handler.ServeHTTP(w, r) Interface func trick
  • 36. Unit test on handlers
  • 41.
  • 42. //0 START //1 START //2 START Controller //2 END //1 END //0 END middleware
  • 43. ● logger request logger with custom format support ● csrf Cross-site request forgery protection ● compress Gzip compression middleware ● basicAuth basic http authentication ● bodyParser extensible request body parser ● json application/json parser ● urlencoded application/x-www-form-urlencoded parser ● multipart multipart/form-data parser ● timeout request timeouts ● cookieParser cookie parser ● session session management support with bundled MemoryStore ● cookieSession cookie-based session support ● methodOverride faux HTTP method support ● responseTime calculates response-time and exposes via X-Response-Time ● staticCache memory cache layer for the static() middleware ● static streaming static file server supporting Range and more ● directory directory listing middleware ● vhost virtual host sub-domain mapping middleware ● favicon efficient favicon server (with default icon) ● limit limit the bytesize of request bodies ● query automatic querystring parser, populating req.query ● errorHandler flexible error handler ● …. many more middleware
  • 45. HTTP2 The future is already arrived — it's just not very evenly distributed -- william gibson
  • 49. ARCHITECTURE - DOCKER Docker is an open-source project that automates the deployment of applications inside software containers. http://en.wikipedia.org/wiki/Docker_(software)
  • 50. ARCHITECTURE - DOCKER Docker allows independent "containers" to run within a single Linux instance, avoiding the overhead of starting virtual machines. http://en.wikipedia.org/wiki/Docker_(software)
  • 51. # Dockerfile # golang image where workspace (GOPATH) configured at /go. FROM golang:1.4-onbuild EXPOSE 3000 A container can be configured through a Dockerfile In this basic configuration, we specify that our image is derived FROM the golang image, available through the Docker Hub, and that our container will EXPOSE port 3000 https://docs.docker.com/reference/builder/
  • 52. $ sudo docker build -t codemotion_container . The golang image is a great solution for go microservices, it is configured to take care of compiling our program and copy it inside the container, ready to go with a single command. Cross compiling is supported too! https://registry.hub.docker.com/_/golang/
  • 53.
  • 56. ARCHITECTURE - DOCKER ORCHESTRATION TOOLS http://blog.docker.com/2015/02/orchestrating-docker-with-machine-swarm-and-compose/ ◇ Provision Docker on any infrastructure, from laptop to public cloud instance ◇ Compose an app using both proprietary containers and Docker Hub Official Repos ◇ Manage all containers of an app as a single group ◇ Cluster an application’s containers to optimize resources and provide high-availability
  • 57. ARCHITECTURE - DOCKER MACHINE http://blog.docker.com/2015/02/announcing-docker-machine-beta/ ◇ Provision Docker Engines across various providers both local and remote, secured with TLS, or not. ◇ Lightweight management of machines: Starting, stopping, removing, etc. ◇ Run remote commands or log in to machines via SSH ◇ Upgrade the Docker Engine when a new version is released
  • 58. $ docker-machine create -d virtualbox dev [info] Downloading boot2docker... [info] Creating SSH key... [info] Creating VirtualBox VM… [...] $ docker run busybox echo hello world hello world With Machine docker hosts can be spawned and controlled on different computers and virtual machines from you local docker client. Different clouds too! Machine supports Amazon EC2, Microsoft Azure, Microsoft Hyper-V DigitalOcean, Google Compute Engine, OpenStack, Rackspace, SoftLayer, VirtualBox, VMware Fusion, VMware vCloud Air, VMware vSphere and counting!
  • 59. ARCHITECTURE - DOCKER SWARM http://blog.docker.com/2015/02/scaling-docker-with-swarm/ ◇ Native clustering for Docker ◇ Swarm is a standard Docker image ◇ Run one command to create a cluster. ◇ Run another command to start Swarm. ◇ On each host where the Docker Engine is running, run a command to join said cluster.
  • 60. $ docker run swarm create 5d9bc2f39ccc00500b36f23d90994f5f # <- cluster_id # swarm master $ docker-machine create -d virtualbox --swarm --swarm-master -- swarm-discovery token://5d9bc2f39ccc00500b36f23d90994f5f my- swarm # swarm nodes $ docker-machine create -d virtualbox --swarm --swarm-discovery token://5d9bc2f39ccc00500b36f23d90994f5f my-swarm-node1 $ docker-machine create -d virtualbox --swarm --swarm-discovery token://5d9bc2f39ccc00500b36f23d90994f5f my-swarm-node3
  • 61. $ docker run -d --name redis_1 -e ‘affinity:container!=redis_*’ redis $ docker run -d --name redis_2 -e ‘affinity:container!=redis_*’ redis Run two redis servers, but don’t run both on the same machine: Add a constraint on the type of storage, we want a machine that has SSD storage: $ docker run -d -e constraint:storage==ssd mysql
  • 62. ARCHITECTURE - DOCKER COMPOSE https://blog.docker.com/2015/02/announcing-docker-compose/ ◇ Define your application’s components in a single file ◇ Start, stop, and rebuild services ◇ View the status of running services ◇ Stream the log output of running services ◇ Run a one-off command on a service
  • 63. # docker-compose.yml cart: build: ./cart links: - redis ports: - "5000:5000" shipment: build: ./shipment links: - mongo ports: - "5000:5000" redis: image: redis mongo: image: mongodb
  • 65.
  • 66. MONITORING - SOUNDCLOUD’S PROMETHEUS http://5pi.de/2015/01/26/monitor-docker-containers-with-prometheus/ ◇ Recently open-sourced by SoundCloud ◇ Written in GO with native client for in- application monitoring ◇ Easy docker container monitoring ◇ Highly dimensional data model ◇ Flexible query language ◇ Powerful metrics types ◇ Alerting on any expression ◇ No fracking dependencies
  • 67. $ docker run -p 9090:9090 prom/prometheus
  • 68. CREDITS http://en.wikipedia.org/wiki/List_of_largest_monoliths_in_the_world https://www.flickr.com/photos/robwatling/3411172879 https://www.flickr.com/photos/dsevilla/139656712 FLOWER https://www.flickr.com/photos/nickpiggott/5212359135 BRICKS https://vimeo.com/105751281 PCFMA http://www.youtube.com/watch?v=QY8mL6WARIE HTTP interface is a lie http://martinfowler.com/articles/consumerDrivenContracts.html http://www.infoq.com/news/2014/07/building-deploying-microservices https://talks.golang.org/2014/readability.slide#27 http://www.morewords.com/contains/go/ http://martinfowler.com/articles/microservices.html (come non citarlo :)) https://blog.golang.org/docker (figata che docker ha il suo env golang) https://speakerdeck.com/stilkov/microservices-talk-berlin http://www.infoq.com/articles/microservices-practical-tips http://nginx.com/blog/microservices-at-netflix-architectural-best-practices/ http://www.reddit. com/r/golang/comments/252wjh/are_you_using_golang_for_webapi_development_what/ https://justinas.org/embrace-gos-http-tools/ https://news.ycombinator.com/item?id=6869710 https://crate.io/blog/deploying-crate-with-docker-machine-swarm/ THERE’S NO GOOD TALK WITH NO REFERENCES