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

Microservices in Action

Microservices in Action

Building Microservices is a style of software development where an application is not developed as a monolith but as a suite of small services. Such microservices run independently, can be developed in different programming languages, are deployed independently, and might use different persistence technologies. The talk will give an introduction into microservices and show their advantages.

Github links: https://github.com/torstenwerner/hellospringboot and https://github.com/torstenwerner/playground-jpa

Torsten Werner

June 25, 2015
Tweet

Other Decks in Technology

Transcript

  1. Monolith One big piece of software, e.g. 1 WAR file

    or 1 executable. typically using 1 programming language often has 1 database backend Deployments / upgrades are difficult. Scaling is not very flexible. business flow design
  2. Microservices 1 Microservice can be fully understood by 1 developer.

    polyglot programming languages polyglot databases, but losing ACID properties Multiple versions might run simultaneously if needed. Each microservice can be scaled independently. event driven design (publish / subscribe) easy upgrades - new definition of „done“
  3. Netflix - the pioneer 2008 … 2012:
 1 WAR …

    hundreds of fine grained services 100 deployments per day now 2011 Prague: Linux containers „conspiracy“ 2014: Docker 1.0 2014: Spring Boot 1.0 History
  4. Spring Boot simplifies application development for Java and Groovy „T

    akes an opinionated view of building production- ready Spring applications. Spring Boot favors convention over configuration and is designed to get you up and running as quickly as possible.“ not a code generator like spring-roo
  5. Linux Containers isolated processes („containers“) as lightweight as a regular

    process isolation similar to more heavy weight virtualization environments prominent tools: Docker, CoreOS
  6. Go Programming language developed by Robert Griesemer, Rob Pike, and

    Ken Thompson at Google C family of programming languages native, statically linked binaries static and strong typing, garbage collector
  7. Docker & Go on Mac OS build cross compilers:
 brew

    reinstall go —cross-compile-all build linux amd64 binary:
 GOOS=linux GOARCH=amd64 go build src/main/web.go install Virtualbox:
 brew cask install virtualbox install boot2docker:
 brew install boot2docker
  8. initialize boot2docker:
 boot2docker init start boot2docker:
 boot2docker up setup docker

    variables:
 $(boot2docker shellinit) get the IP address:
 boot2docker ip
  9. simple test:
 docker run hello-world build image:
 docker build -t

    web . run image:
 docker run --rm -p 4000:4000 web open in browser:
 http://192.168.59.103:4000/Microservices
  10. Docker Cloud Providers https://giantswarm.io/ https://www.tutum.co/ Amazon EC2 Container Service (ECS)

    Google Container Engine Microsoft Azure many more based on Kubernetes, CoreOS, …
  11. AWS Lambda http://aws.amazon.com/lambda/ primarily used for backend services pricing: per

    1 million requests + computing time e.g. per 100ms * 128MB Node.js and Java deployment units are Lambda Functions
  12. Conway’s law „Organizations which design systems ... are constrained to

    produce designs which are copies of the communication structures of these organizations.“ (M. Conway) „If you have four groups working on a compiler, you'll get a 4-pass compiler.“ (Eric S Raymond) Every talk about Microservices must refer to Conway’s law.