Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Hitchhiker's Guide to Enterprise Microservices with Go - Mario-Leander Reimer - QAware

GoDays
January 22, 2020

A Hitchhiker's Guide to Enterprise Microservices with Go - Mario-Leander Reimer - QAware

Cloud native applications are popular these days. They promise superior reliability and almost arbitrary scalability. They follow three key principles: they are built and composed as microservices, packaged and distributed in containers and executed dynamically in the cloud. But building truly cloud-native, enterprise-ready microservices is a challenging endeavor, way more than just doing REST and Docker. A lot of concerns and design principles need to be addressed: service exposition, messaging, persistence, resiliency or diagnosability, just to name a few. This session shows that the Go language and it's library universe is well suited to tackle the challenges of building modern, rock-solid microservices that are fit for the enterprise.

GoDays

January 22, 2020
Tweet

More Decks by GoDays

Other Decks in Technology

Transcript

  1. A Hitchhiker's Guide to Enterprise Microservices with Go {{ define

    "GoDays 2020“ }} @LeanderReimer #cloudnativenerd {{ end }}
  2. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} #whoami 2 Mario-Leander Reimer Chief Software Architect QAware GmbH
  3. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} Why you should Go Cloud Native in 2020? 3 https://www.loodse.com/blog/why-you-should-go-cloud-native-in-2020 Today
  4. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} 4 Enterprise Cloud Native ANTIFRAGILITY HYPERSCALE TRAFFIC, DATA, FEATURES RECRUITING SPEED DEVOPS & CONTINUOUS DELIVERY OPEX SAVINGS (automation & utilization)
  5. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} 5 https://www.tiobe.com/tiobe-index/ Tiobe
 Ranking
  6. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} Criteria for Enterprise usage ✓ Maturity: active community, stable releases, security patches ✓ IDE Support: developer friendliness. IntelliJ, VS Code, Goland, … ✓ Tooling: build tools, dependency management, debuggers, profilers ✓ Library Ecosystem: good standard library and open source libraries ✓ Documentation: online docs, literature and training available ✓ Integration: good interop with Enterprise standards and technology 6
  7. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} This is NOT an Enterprise Microservice! 7 package main import ( "fmt" "net/http" "os" ) func main() { http.HandleFunc("/", index) http.ListenAndServe(":8080", nil) } func index(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) fmt.Fprintf(w, "Hello World @ GoDays 2020.“) } But Go provides a solid foundation to build Enterprise Microservices.
  8. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} Essential Cloud-native Design Principles • Design for Distribution: Containers; microservices; API driven development. • Design for Configuration: One image, multiple environments. • Design for Resiliency: Fault-tolerant and self-healing. • Design for Elasticity: Scales dynamically and reacts to stimuli. • Design for Delivery: Short roundtrips and automated provisioning. • Design for Performance: Responsive; concurrent; resource efficient. • Design for Automation: Automated Dev & Ops tasks. • Design for Diagnosability: Cluster-wide logs, metrics and traces. • Design for Security: Secure Endpoints, Zero Trust, E2E-Encryption 8
  9. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} The Anatomy of an Enterprise Microservice 9
  10. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} 10 • REST APIs • Swagger + OpenAPI v3 • RPC APIs • Loose Coupling • Event Driven Architecture • CQRS, Event Sourcing • Consul, Kubernetes, … • Cloud Provider • Circuit Breaking • Bulk Heading • Environment Variables • Kubernetes ConfigMaps • YAML or JSON files • Consensus with DDS, Raft, etcd, … • Support for RDBMS, noSQL, et al. • In-Memory Caches • Redis, Memcached • TLS, mTLS • Encryption + Signing • JWT, OpenID • Structured Logging • Health & Metrics • Prometheus, et.al. • OpenTracing Support • Jaeger, Zipkin Integration
  11. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} 11 go get github.com/micro/go-micro go get github.com/NYTimes/gizmo/… go get github.com/koding/kite Microservice Chassis go get github.com/gin-gonic/gin
 go get github.com/go-martini/martini
 go get github.com/urfave/negroni
 go get github.com/gorilla/mux Web Frameworks
  12. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} 12 import log "github.com/inconshreveable/log15"
 import log „github.com/sirupsen/logrus" import "github.com/prometheus/client_golang/prometheus"
 import "github.com/armon/go-metrics" import "github.com/opentracing/opentracing-go"
 import „github.com/uber/jaeger-client-go" import "github.com/jinzhu/gorm"
 import „upper.io/db.v3/postgresql" (mongo, …)
 import "gopkg.in/gorp.v1"
 import „github.com/jmoiron/sqlx"
  13. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} Is Go and its library universe fit for the Cloud-native enterprise? 13 Yes.
  14. {{ define "GoDays 2020" }} A Hitchhiker's Guide to Enterprise

    Microservices with Go // @LeanderReimer #cloudnativenerd #qaware {{ end }} Is Go and it’s library universe fit for the Cloud-native enterprise? 14 Yes, but …